Skip to content

Commit

Permalink
podvm: enhancement for RHEL PodVM image creation
Browse files Browse the repository at this point in the history
This fix streamlines RHEL PodVM image creation via Makefile integration with version.yaml.

Signed-off-by: Saripalli Lavanya <[email protected]>
  • Loading branch information
Saripalli-lavanya authored and bpradipt committed Apr 10, 2024
1 parent 4547b3e commit bb6d3d2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
20 changes: 18 additions & 2 deletions src/cloud-api-adaptor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SOURCES := $(shell find $(SOURCEDIRS) -name '*.go' -print)
TEST_E2E_TIMEOUT ?= 60m

RESOURCE_CTRL ?= true

YQ_CHECKSUM_${ARCH} ?= $(YQ_CHECKSUM)
# BUILTIN_CLOUD_PROVIDERS is used for binary build -- what providers are built in the binaries.
ifeq ($(RELEASE_BUILD),true)
BUILTIN_CLOUD_PROVIDERS ?= aws azure ibmcloud vsphere
Expand Down Expand Up @@ -163,13 +163,27 @@ BINARIES_DOCKERFILE := Dockerfile.podvm_binaries$(DOCKERFILE_SUFFIX)
PODVM_DOCKERFILE := Dockerfile.podvm$(DOCKERFILE_SUFFIX)

podvm-builder:
ifeq ($(PODVM_DISTRO),rhel)
docker buildx build -t $(PODVM_BUILDER_IMAGE) -f podvm/$(BUILDER_DOCKERFILE) \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg ORG_ID=$(ORG_ID) \
--build-arg ARCH=$(ARCH) \
--build-arg ACTIVATION_KEY=$(ACTIVATION_KEY) \
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
--build-arg PROTOC_VERSION=$(PROTOC_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg YQ_VERSION=$(YQ_VERSION) \
--build-arg YQ_CHECKSUM=${YQ_CHECKSUM_$(ARCH)} \
$(DOCKER_OPTS) .
else
docker buildx build -t $(PODVM_BUILDER_IMAGE) -f podvm/$(BUILDER_DOCKERFILE) \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg PROTOC_VERSION=$(PROTOC_VERSION) \
--build-arg RUST_VERSION=$(RUST_VERSION) \
--build-arg YQ_VERSION=$(YQ_VERSION) \
--build-arg YQ_CHECKSUM=$(YQ_CHECKSUM) \
--build-arg YQ_CHECKSUM=${YQ_CHECKSUM_$(ARCH)} \
$(DOCKER_OPTS) .
endif

podvm-binaries:
cp -rf ../../.git .git
Expand All @@ -190,5 +204,7 @@ podvm-image:
--build-arg PODVM_DISTRO=$(PODVM_DISTRO) \
--build-arg ARCH=$(ARCH) \
--build-arg CLOUD_PROVIDER=$(or $(CLOUD_PROVIDER),generic) \
--build-arg IMAGE_URL=$(IMAGE_URL) \
--build-arg IMAGE_CHECKSUM=$(IMAGE_CHECKSUM) \
$(DOCKER_OPTS) .
rm -rf .git
2 changes: 2 additions & 0 deletions src/cloud-api-adaptor/Makefile.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ endif
# stored in versions.yaml
YQ_VERSION := v4.35.1
YQ_CHECKSUM := "sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
YQ_CHECKSUM_s390x:= "sha256:4e6324d08630e7df733894a11830412a43703682d65a76f1fc925aac08268a45"

MINIMUM_YQ_MAJOR_VERSION := 4
INSTALLED_YQ_MAJOR_VERSION := $(shell $(YQ_COMMAND) --version | sed -nE 's/.* v?([0-9]+).*/\1/p')
Expand Down Expand Up @@ -51,3 +52,4 @@ PAUSE_REPO := $(or $(PAUSE_REPO),$(call query,oci.pause.registry))
PAUSE_VERSION := $(or $(PAUSE_VERSION),$(call query,oci.pause.tag))
OPA_REPO := $(or $(OPA_REPO),$(call query,git.opa.url))
OPA_VERSION := $(or $(OPA_VERSION),$(call query,git.opa.reference))
PACKER_VERSION := $(or $(PACKER_VERSION),$(call query,tools.packer))
2 changes: 1 addition & 1 deletion src/cloud-api-adaptor/podvm/Dockerfile.podvm.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV PODVM_DISTRO ${PODVM_DISTRO}
ENV ARCH ${ARCH}
ENV UEFI ${UEFI}

ARG IMAGE_URL="/tmp/rhel.qcow2"
ARG IMAGE_URL
ARG IMAGE_CHECKSUM

ENV IMAGE_URL ${IMAGE_URL}
Expand Down
3 changes: 2 additions & 1 deletion src/cloud-api-adaptor/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ cloudimg:
url: https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.2/x86_64/product-software
checksum: "sha256:34ff41b5274692c984e3860b21136af8b6ae502744c6c7578dda82002fba0287"
s390x:
url: hhttps://access.redhat.com/downloads/content/433/ver=/rhel---9/9.3%20Beta/s390x/product-software
url: https://access.redhat.com/downloads/content/433/ver=/rhel---9/9.3%20Beta/s390x/product-software
checksum: "sha256:d436ffeac7d468f75526ca8b8bab1cba64ba3ab2889ccd11fa107a7323b267db"

tools:
bats: 1.10.0
golang: 1.21.9
rust: 1.72.0
protoc: 3.15.0
packer: v1.9.4
# Referenced Git repositories
git:
guest-components:
Expand Down

0 comments on commit bb6d3d2

Please sign in to comment.