Skip to content

Commit

Permalink
podvm_builder: Remove duplicated versions
Browse files Browse the repository at this point in the history
Just before the 0.9.0 release we found that the rust version in
the builder image hadn't been updated when the `versions.yaml`
was, which caused issues which certain builds that weren't in our
CI tests.

If we remove the defaults and enforce them to be specified, we
can avoid this happening and stop having to maintain versions in
multiple places.

See #1939 for the example

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
  • Loading branch information
stevenhorsman committed Aug 15, 2024
1 parent 3a79239 commit 8de633b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 25 deletions.
1 change: 1 addition & 0 deletions src/cloud-api-adaptor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ podvm-builder:
--build-arg YQ_CHECKSUM=${YQ_CHECKSUM_$(ARCH)} \
--build-arg YQ_ARCH=$(ARCH) \
--build-arg PROTOC_ARCH=$(if $(filter amd64,$(ARCH)),x86_64,s390_64) \
--build-arg PACKER_VERSION=$(PACKER_VERSION) \
$(DOCKER_OPTS) .

podvm-binaries:
Expand Down
12 changes: 5 additions & 7 deletions src/cloud-api-adaptor/podvm/Dockerfile.podvm_builder
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ ARG ARCH="amd64"
ARG YQ_ARCH="amd64"
# PROTOC_ARCH="x86_64" | "s390_64"
ARG PROTOC_ARCH="x86_64"
ARG GO_VERSION="1.21.12"
ARG PROTOC_VERSION="3.15.0"
ARG RUST_VERSION="1.75.0"
ARG YQ_VERSION="v4.35.1"
# amd64: YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
# s390x: YQ_CHECKSUM="sha256:4e6324d08630e7df733894a11830412a43703682d65a76f1fc925aac08268a45"
ARG YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
ARG GO_VERSION
ARG PROTOC_VERSION
ARG RUST_VERSION
ARG YQ_VERSION
ARG YQ_CHECKSUM
# Without setting ENV gh-action is failing to use the correct values
ENV GO_VERSION=${GO_VERSION}
ENV RUST_VERSION=${RUST_VERSION}
Expand Down
12 changes: 5 additions & 7 deletions src/cloud-api-adaptor/podvm/Dockerfile.podvm_builder.fedora
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ ARG ARCH="amd64"
ARG YQ_ARCH="amd64"
# PROTOC_ARCH="x86_64" | "s390_64"
ARG PROTOC_ARCH="x86_64"
ARG GO_VERSION="1.21.12"
ARG PROTOC_VERSION="3.15.0"
ARG RUST_VERSION="1.75.0"
ARG YQ_VERSION="v4.35.1"
# amd64: YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
# s390x: YQ_CHECKSUM="sha256:4e6324d08630e7df733894a11830412a43703682d65a76f1fc925aac08268a45"
ARG YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
ARG GO_VERSION
ARG PROTOC_VERSION
ARG RUST_VERSION
ARG YQ_VERSION
ARG YQ_CHECKSUM

RUN dnf groupinstall -y 'Development Tools' && \
dnf install -y yum-utils gnupg git perl-core pkg-config libseccomp-devel gpgme-devel \
Expand Down
20 changes: 9 additions & 11 deletions src/cloud-api-adaptor/podvm/Dockerfile.podvm_builder.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ ARG ARCH="amd64"
ARG YQ_ARCH="amd64"
# PROTOC_ARCH="x86_64" | "s390_64"
ARG PROTOC_ARCH="x86_64"
ARG GO_VERSION="1.21.12"
ARG PROTOC_VERSION="3.15.0"
ARG RUST_VERSION="1.75.0"
ARG YQ_VERSION="v4.35.1"
ARG PACKER_VERSION="v1.9.4"
# amd64: YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
# s390x: YQ_CHECKSUM="sha256:4e6324d08630e7df733894a11830412a43703682d65a76f1fc925aac08268a45"
ARG YQ_CHECKSUM="sha256:bd695a6513f1196aeda17b174a15e9c351843fb1cef5f9be0af170f2dd744f08"
ARG GO_VERSION
ARG PROTOC_VERSION
ARG RUST_VERSION
ARG YQ_VERSION
ARG PACKER_VERSION
ARG YQ_CHECKSUM
ARG ORG_ID
ARG ACTIVATION_KEY

Expand All @@ -38,7 +36,7 @@ RUN if [[ -n "${ACTIVATION_KEY}" && -n "${ORG_ID}" ]]; then \
rm -f /etc/rhsm-host && rm -f /etc/pki/entitlement-host; \
subscription-manager register --org=${ORG_ID} --activationkey=${ACTIVATION_KEY}; \
fi

RUN subscription-manager repos --enable codeready-builder-for-rhel-9-${ARCH/amd64/x86_64}-rpms; \
dnf groupinstall -y 'Development Tools'; \
dnf install -y yum-utils gnupg git --allowerasing curl pkg-config clang perl libseccomp-devel gpgme-devel \
Expand All @@ -53,12 +51,12 @@ RUN chmod a+x /usr/local/bin/yq && \
rm -f go${GO_VERSION}.linux-${YQ_ARCH}.tar.gz
ENV PATH="/usr/local/go/bin:${PATH}"

# Install packer. Packer doesn't does not have prebuilt s390x arch binaries above Packer version 0.1.5
# Install packer. Packer doesn't does not have prebuilt s390x arch binaries above Packer version 0.1.5
RUN if [ "${ARCH}" == "s390x" ]; then \
git clone --depth 1 --single-branch https://github.com/hashicorp/packer.git -b ${PACKER_VERSION}; \
cd packer; \
sed -i -- "s/ALL_XC_ARCH=.*/ALL_XC_ARCH=\"${ARCH}\"/g" scripts/build.sh; \
sed -i -- "s/ALL_XC_OS=.*/ALL_XC_OS=\"Linux\"/g" scripts/build.sh; \
sed -i -- "s/ALL_XC_OS=.*/ALL_XC_OS=\"Linux\"/g" scripts/build.sh; \
make bin && cp bin/packer /usr/local/bin/; \
cd $OLDPWD; \
else \
Expand Down

0 comments on commit 8de633b

Please sign in to comment.