From 8042657cbe43028869ba34e8f4366674765ec7b3 Mon Sep 17 00:00:00 2001 From: Sajia Zafreen <42818305+zafs23@users.noreply.github.com> Date: Wed, 20 Sep 2023 18:55:40 -0700 Subject: [PATCH] Add eks go1.21 in builder-base (#1136) * Add eks go1.21 in builder-base * update * resolve merge conflict * resolve merge conflict * Add 1.21 in scripts * bump go licenses versio * test * update golang release number --- EKS_DISTRO_TAG_FILE.yaml | 6 ++++ builder-base/Dockerfile | 33 +++++++++++++++++++ builder-base/versions.yaml | 5 +-- .../conformanceTests/golangBuildspec.yaml | 4 +++ .../go/scripts/golang-patching-tools.sh | 2 +- 5 files changed, 47 insertions(+), 3 deletions(-) diff --git a/EKS_DISTRO_TAG_FILE.yaml b/EKS_DISTRO_TAG_FILE.yaml index 1b6a7d58e..1007d7c20 100644 --- a/EKS_DISTRO_TAG_FILE.yaml +++ b/EKS_DISTRO_TAG_FILE.yaml @@ -27,6 +27,9 @@ al2: eks-distro-minimal-base-golang-compiler-1.20-base: 1.20-2023-09-13-1694631680.2 eks-distro-minimal-base-golang-compiler-1.20-yum: 1.20-yum-2023-09-13-1694631680.2 eks-distro-minimal-base-golang-compiler-1.20-gcc: 1.20-gcc-2023-09-13-1694631680.2 + eks-distro-minimal-base-golang-compiler-1.21-base: null + eks-distro-minimal-base-golang-compiler-1.21-yum: null + eks-distro-minimal-base-golang-compiler-1.21-gcc: null eks-distro-minimal-base-nodejs-compiler-16-base: 16-2023-09-13-1694631680.2 eks-distro-minimal-base-nodejs-compiler-16-yum: 16-yum-2023-09-13-1694631680.2 eks-distro-minimal-base-nodejs-compiler-16-gcc: 16-gcc-2023-09-13-1694631680.2 @@ -68,6 +71,9 @@ al2023: eks-distro-minimal-base-golang-compiler-1.20-base: 1.20-2023-09-08-1694199666.2023 eks-distro-minimal-base-golang-compiler-1.20-yum: 1.20-yum-2023-09-08-1694199666.2023 eks-distro-minimal-base-golang-compiler-1.20-gcc: 1.20-gcc-2023-09-08-1694199666.2023 + eks-distro-minimal-base-golang-compiler-1.21-base: null + eks-distro-minimal-base-golang-compiler-1.21-yum: null + eks-distro-minimal-base-golang-compiler-1.21-gcc: null eks-distro-minimal-base-nodejs-compiler-16-base: 16-2023-09-08-1694199666.2023 eks-distro-minimal-base-nodejs-compiler-16-yum: 16-yum-2023-09-08-1694199666.2023 eks-distro-minimal-base-nodejs-compiler-16-gcc: 16-gcc-2023-09-08-1694199666.2023 diff --git a/builder-base/Dockerfile b/builder-base/Dockerfile index 664f66ae4..54ede1488 100644 --- a/builder-base/Dockerfile +++ b/builder-base/Dockerfile @@ -288,6 +288,22 @@ RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \ /install_golang.sh $GOLANG_VERSION_120 && \ /remove_yum_packages.sh +FROM ${BUILDER_IMAGE} as golang-1.21 +ARG TARGETARCH +ARG GOLANG_VERSION_121 +ARG GOLANG_RPM_SOURCE_DIR +WORKDIR /workdir +ENV GOPATH /go +ENV PATH="/go/bin/:$PATH" +COPY ./scripts/install_base_yum_packages.sh ./scripts/remove_yum_packages.sh ./scripts/common_vars.sh \ + ./scripts/install_golang.sh / +COPY $GOLANG_RPM_SOURCE_DIR/x86_64/golang*1.21*.rpm /tmp/x86_64/ +COPY $GOLANG_RPM_SOURCE_DIR/aarch64/golang*1.21*.rpm /tmp/aarch64/ +RUN --mount=type=cache,target=/var/cache/yum,sharing=locked \ + /install_base_yum_packages.sh && \ + /install_golang.sh $GOLANG_VERSION_121 && \ + /remove_yum_packages.sh + FROM ${BUILDER_IMAGE} as skopeo ARG TARGETARCH ARG GOPROXY @@ -396,6 +412,21 @@ RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \ --mount=type=secret,id=netrc,target=/root/.netrc \ /install_go_licenses.sh +FROM ${BUILDER_IMAGE} as go-licenses-1.21 +ARG TARGETARCH +ARG GOPROXY +ARG GO_LICENSES_VERSION +ENV GO_LICENSES_VERSION=$GO_LICENSES_VERSION +WORKDIR /workdir +ENV GOPATH /go +ENV PATH="/go/bin/:$PATH" +COPY --link --from=golang-1.21 /golang-1.21 / +COPY ./scripts/common_vars.sh \ + ./scripts/install_go_licenses.sh / +RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \ + --mount=type=secret,id=netrc,target=/root/.netrc \ + /install_go_licenses.sh + FROM ${BASE_IMAGE} as minimal-copy-stage @@ -427,6 +458,8 @@ COPY --link --from=golang-1.19 /golang-1.19 / COPY --link --from=go-licenses-1.19 /go-licenses-1.19 / COPY --link --from=golang-1.20 /golang-1.20 / COPY --link --from=go-licenses-1.20 /go-licenses-1.20 / +COPY --link --from=golang-1.21 /golang-1.21 / +COPY --link --from=go-licenses-1.21 /go-licenses-1.21 / # add the default golang verison last so its /usr/bin/go # takes precendent COPY --link --from=golang-1.18 /golang-1.18 / diff --git a/builder-base/versions.yaml b/builder-base/versions.yaml index 80fc8bf34..1589816ec 100644 --- a/builder-base/versions.yaml +++ b/builder-base/versions.yaml @@ -8,7 +8,8 @@ GOLANG_VERSION_117: 1.17.13-6 GOLANG_VERSION_118: 1.18.10-8 GOLANG_VERSION_119: 1.19.12-10 GOLANG_VERSION_120: 1.20.8-9 -GO_LICENSES_VERSION: v1.2.1 +GOLANG_VERSION_121: 1.21.1-2 +GO_LICENSES_VERSION: v1.6.0 GOVC_VERSION: 0.25.0 GOSS_VERSION: 3.1.4 HELM_VERSION: 3.8.1 @@ -19,4 +20,4 @@ OVERRIDE_BASH_VERSION: 4.3 PACKER_VERSION: 1.8.5 PYWINRM_VERSION: 0.4.1 SKOPEO_VERSION: v1.5.2 -YQ_VERSION: v4.30.6 +YQ_VERSION: v4.30.6 \ No newline at end of file diff --git a/projects/golang/go/build/conformanceTests/golangBuildspec.yaml b/projects/golang/go/build/conformanceTests/golangBuildspec.yaml index decfc5f62..271be2e76 100644 --- a/projects/golang/go/build/conformanceTests/golangBuildspec.yaml +++ b/projects/golang/go/build/conformanceTests/golangBuildspec.yaml @@ -30,6 +30,10 @@ batch: env: variables: GO_SOURCE_VERSION: 1.20 + - identifier: golang_121 + env: + variables: + GO_SOURCE_VERSION: 1.21 env: variables: diff --git a/projects/golang/go/scripts/golang-patching-tools.sh b/projects/golang/go/scripts/golang-patching-tools.sh index e5290e554..913dad09b 100755 --- a/projects/golang/go/scripts/golang-patching-tools.sh +++ b/projects/golang/go/scripts/golang-patching-tools.sh @@ -9,7 +9,7 @@ GO_REPO_URL="https://github.com/golang/go.git" GO_REPO="$(dirname "$BASE_DIRECTORY")/go" -GO_VERSIONS=('1.18.10' '1.19.10' '1.20.5') +GO_VERSIONS=('1.18.10' '1.19.12' '1.20.8' '1.21.1') function build::go::clone() { if [[ ! -e $GO_REPO ]]; then