Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump golang version with the latest supported one #108

Merged
merged 2 commits into from
Jun 23, 2021

Conversation

v1v
Copy link
Member

@v1v v1v commented Jun 18, 2021

What

I used #106 and #107 as the references for the implementation.

It only supports the latest existing minor version, 1.16 at the moment.

For a bump of minor versions, the automation does not work yet, since it requires some other actions:

  • Create the go1.17 folder structure with its files
  • Update the README.md
  • Remove go1.15 folder

You can use this script locally:

.ci/bump-go-release-version.sh <new-go-version>

NOTE: it will add and commit the changes in the existing branch. The push and PR creation is not done within this script.

Why

No more manual actions.

Further details

This automation will not merge the PR automatically. We do want the teams to do so:

  • Review the changes and validate the CI status
  • Merge when needed.
  • Create PR in the beats project with the bump.

This particular automation will run on weekly basis. The pipeline is bump-go-release-version-pipeline

Test

If we want to support go1.17 then:

Given:

$ .ci/bump-go-release-version.sh 1.17.1

produces:

.ci/bump-go-release-version.sh 1.17.1
A new minor version has been released. Bump cannot happen
Add Golang go1.17 crossbuild images.
See https://github.com/elastic/golang-crossbuild/pull/85
You might need to deprecate one of the existing Golang versions since
we only support the last two releases.
➜  golang-crossbuild git:(feature/upgrade-golang-crossbuild) ✗ echo $?   
1

Hypothetically 1.16.6 was released then

Given:

$ .ci/bump-go-release-version.sh 1.16.6                            
Update go version 1.16.6
[feature/upgrade-golang-crossbuild f5d5094] [Automation] Update go release version to 1.16.6
 4 files changed, 6 insertions(+), 6 deletions(-)
commit f5d5094aede5912ad8a34092ff51ca550687778d (HEAD -> feature/upgrade-golang-crossbuild)
Author: Victor Martinez <[email protected]>
Date:   Fri Jun 18 14:03:09 2021 +0100

    [Automation] Update go release version to 1.16.6
You can now push and create a Pull Request

SHA256 requires the release to exist, that's the reason is empty!

produces:

diff --git a/Jenkinsfile b/Jenkinsfile
index 040dc56..158d48e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -12,7 +12,7 @@ pipeline {
     DOCKER_REGISTRY_SECRET = 'secret/observability-team/ci/docker-registry/prod'
     REGISTRY = 'docker.elastic.co'
     STAGING_IMAGE = "${env.REGISTRY}/observability-ci"
-    GO_VERSION = '1.16.4'
+    GO_VERSION = '1.16.6'
   }
   options {
     timeout(time: 3, unit: 'HOURS')
diff --git a/go1.16/Makefile.common b/go1.16/Makefile.common
index 9dbab81..21d289b 100644
--- a/go1.16/Makefile.common
+++ b/go1.16/Makefile.common
@@ -2,7 +2,7 @@ SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 include $(SELF_DIR)/../Makefile.common
 
 NAME           := golang-crossbuild
-VERSION        := 1.16.5
+VERSION        := 1.16.6
 DEBIAN_VERSION ?= 9
 SUFFIX         := -$(shell basename $(CURDIR))
 TAG_EXTENSION  ?=
diff --git a/go1.16/base-arm/Dockerfile.tmpl b/go1.16/base-arm/Dockerfile.tmpl
index d43a2be..6328521 100644
--- a/go1.16/base-arm/Dockerfile.tmpl
+++ b/go1.16/base-arm/Dockerfile.tmpl
@@ -37,9 +37,9 @@ RUN \
             libsqlite3-0 \
         && rm -rf /var/lib/apt/lists/*
 
-ARG GOLANG_VERSION=1.16.5
+ARG GOLANG_VERSION=1.16.6
 ARG GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-arm64.tar.gz
-ARG GOLANG_DOWNLOAD_SHA256=d5446b46ef6f36fdffa852f73dfbbe78c1ddf010b99fa4964944b9ae8b4d6799
+ARG GOLANG_DOWNLOAD_SHA256=
 
 RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
 	&& echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \
diff --git a/go1.16/base/Dockerfile.tmpl b/go1.16/base/Dockerfile.tmpl
index 7bd9085..1f53e6b 100644
--- a/go1.16/base/Dockerfile.tmpl
+++ b/go1.16/base/Dockerfile.tmpl
@@ -29,9 +29,9 @@ RUN apt-get -o Acquire::Check-Valid-Until=false update -y --no-install-recommend
 RUN ln -s /usr/bin/pip3 /usr/bin/pip
 {{ end }}
 
-ARG GOLANG_VERSION=1.16.5
+ARG GOLANG_VERSION=1.16.6
 ARG GOLANG_DOWNLOAD_URL=https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz
-ARG GOLANG_DOWNLOAD_SHA256=b12c23023b68de22f74c0524f10b753e7b08b1504cb7e417eccebdd3fae49061
+ARG GOLANG_DOWNLOAD_SHA256=
 
 RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \
 	&& echo "$GOLANG_DOWNLOAD_SHA256  golang.tar.gz" | sha256sum -c - \

@elasticmachine
Copy link

💔 Build Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #108 opened

  • Start Time: 2021-06-18T13:09:43.975+0000

  • Duration: 141 min 57 sec

  • Commit: 6d5eba8

Trends 🧪

Image of Build Times

Log output

Expand to view the last 100 lines of log output

[2021-06-18T15:26:19.313Z] 64943252820c: Preparing
[2021-06-18T15:26:19.313Z] d986755351da: Preparing
[2021-06-18T15:26:19.313Z] e87177daa08c: Preparing
[2021-06-18T15:26:19.313Z] 72c50d7a0cbb: Preparing
[2021-06-18T15:26:19.313Z] 63227c6390d3: Preparing
[2021-06-18T15:26:19.313Z] eb9700ae2707: Preparing
[2021-06-18T15:26:19.313Z] bf1f49b67d9f: Preparing
[2021-06-18T15:26:19.313Z] 466b556c1fe1: Preparing
[2021-06-18T15:26:19.313Z] 9b36c7c913c6: Preparing
[2021-06-18T15:26:19.313Z] 9253306e6eaa: Preparing
[2021-06-18T15:26:19.313Z] 07ccb6bfadd5: Preparing
[2021-06-18T15:26:19.313Z] 5358ce232b71: Preparing
[2021-06-18T15:26:19.313Z] 688e187d6c79: Preparing
[2021-06-18T15:26:19.313Z] 63227c6390d3: Waiting
[2021-06-18T15:26:19.313Z] eb9700ae2707: Waiting
[2021-06-18T15:26:19.313Z] bf1f49b67d9f: Waiting
[2021-06-18T15:26:19.313Z] 466b556c1fe1: Waiting
[2021-06-18T15:26:19.313Z] 9b36c7c913c6: Waiting
[2021-06-18T15:26:19.313Z] 9253306e6eaa: Waiting
[2021-06-18T15:26:19.313Z] 07ccb6bfadd5: Waiting
[2021-06-18T15:26:19.313Z] 5358ce232b71: Waiting
[2021-06-18T15:26:19.313Z] d986755351da: Waiting
[2021-06-18T15:26:19.313Z] 72c50d7a0cbb: Waiting
[2021-06-18T15:26:19.313Z] 64943252820c: Waiting
[2021-06-18T15:26:20.698Z] a658d213e7d6: Pushed
[2021-06-18T15:26:21.271Z] c8bcaf9da910: Pushed
[2021-06-18T15:26:21.533Z] 2862efc3e250: Pushed
[2021-06-18T15:26:21.794Z] e9eb0c50e19b: Pushed
[2021-06-18T15:26:21.794Z] 72c50d7a0cbb: Layer already exists
[2021-06-18T15:26:21.794Z] 63227c6390d3: Layer already exists
[2021-06-18T15:26:22.055Z] eb9700ae2707: Layer already exists
[2021-06-18T15:26:22.055Z] bf1f49b67d9f: Layer already exists
[2021-06-18T15:26:22.055Z] 466b556c1fe1: Layer already exists
[2021-06-18T15:26:22.055Z] 5cd11f76b487: Pushed
[2021-06-18T15:26:22.055Z] 9b36c7c913c6: Layer already exists
[2021-06-18T15:26:22.317Z] 9253306e6eaa: Layer already exists
[2021-06-18T15:26:22.317Z] 07ccb6bfadd5: Layer already exists
[2021-06-18T15:26:22.317Z] 5358ce232b71: Layer already exists
[2021-06-18T15:26:22.317Z] 688e187d6c79: Layer already exists
[2021-06-18T15:26:27.610Z] d986755351da: Pushed
[2021-06-18T15:26:42.538Z] 64943252820c: Pushed
[2021-06-18T15:26:49.138Z] e87177daa08c: Pushed
[2021-06-18T15:26:51.694Z] 1.16.5-s390x-debian10: digest: sha256:6fd7c35de1fbfb7f5c44b2eb983f776f11c615cbaf571f98db429b8af731e812 size: 4090
[2021-06-18T15:26:51.694Z] make[1]: Leaving directory '/var/lib/jenkins/workspace/ats_golang-crossbuild-mbp_PR-108/src/github.com/elastic/golang-crossbuild/go1.16/s390x'
[2021-06-18T15:26:51.694Z] make[1]: Entering directory '/var/lib/jenkins/workspace/ats_golang-crossbuild-mbp_PR-108/src/github.com/elastic/golang-crossbuild/go1.16/darwin-arm64'
[2021-06-18T15:26:51.694Z] echo ">> Pushing docker.elastic.co/observability-ci/golang-crossbuild:1.16.5-darwin-arm64-debian10"
[2021-06-18T15:26:51.694Z] >> Pushing docker.elastic.co/observability-ci/golang-crossbuild:1.16.5-darwin-arm64-debian10
[2021-06-18T15:26:51.694Z] The push refers to repository [docker.elastic.co/observability-ci/golang-crossbuild]
[2021-06-18T15:26:51.694Z] 31be849aab35: Preparing
[2021-06-18T15:26:51.694Z] 4ee009ea9011: Preparing
[2021-06-18T15:26:51.694Z] 8ad50ed2773a: Preparing
[2021-06-18T15:26:51.694Z] de70b6349b6b: Preparing
[2021-06-18T15:26:51.694Z] ab7247dafa5a: Preparing
[2021-06-18T15:26:51.694Z] 72c50d7a0cbb: Preparing
[2021-06-18T15:26:51.694Z] 63227c6390d3: Preparing
[2021-06-18T15:26:51.694Z] eb9700ae2707: Preparing
[2021-06-18T15:26:51.694Z] bf1f49b67d9f: Preparing
[2021-06-18T15:26:51.694Z] 466b556c1fe1: Preparing
[2021-06-18T15:26:51.694Z] 9b36c7c913c6: Preparing
[2021-06-18T15:26:51.694Z] 9253306e6eaa: Preparing
[2021-06-18T15:26:51.694Z] 07ccb6bfadd5: Preparing
[2021-06-18T15:26:51.694Z] 5358ce232b71: Preparing
[2021-06-18T15:26:51.694Z] 688e187d6c79: Preparing
[2021-06-18T15:26:51.694Z] eb9700ae2707: Waiting
[2021-06-18T15:26:51.694Z] bf1f49b67d9f: Waiting
[2021-06-18T15:26:51.694Z] 466b556c1fe1: Waiting
[2021-06-18T15:26:51.694Z] 9b36c7c913c6: Waiting
[2021-06-18T15:26:51.694Z] 9253306e6eaa: Waiting
[2021-06-18T15:26:51.694Z] 72c50d7a0cbb: Waiting
[2021-06-18T15:26:51.694Z] 07ccb6bfadd5: Waiting
[2021-06-18T15:26:51.694Z] 688e187d6c79: Waiting
[2021-06-18T15:26:51.694Z] 5358ce232b71: Waiting
[2021-06-18T15:26:53.617Z] 4ee009ea9011: Pushed
[2021-06-18T15:26:53.617Z] 8ad50ed2773a: Pushed
[2021-06-18T15:26:53.617Z] 72c50d7a0cbb: Layer already exists
[2021-06-18T15:26:53.617Z] 31be849aab35: Pushed
[2021-06-18T15:26:53.617Z] 63227c6390d3: Layer already exists
[2021-06-18T15:26:53.617Z] eb9700ae2707: Layer already exists
[2021-06-18T15:26:53.617Z] bf1f49b67d9f: Layer already exists
[2021-06-18T15:26:53.617Z] 466b556c1fe1: Layer already exists
[2021-06-18T15:26:53.617Z] 9b36c7c913c6: Layer already exists
[2021-06-18T15:26:53.617Z] 9253306e6eaa: Layer already exists
[2021-06-18T15:26:53.617Z] 07ccb6bfadd5: Layer already exists
[2021-06-18T15:26:53.879Z] 5358ce232b71: Layer already exists
[2021-06-18T15:26:53.879Z] 688e187d6c79: Layer already exists
[2021-06-18T15:27:08.815Z] ab7247dafa5a: Pushed
[2021-06-18T15:30:30.445Z] de70b6349b6b: Pushed
[2021-06-18T15:30:37.031Z] 1.16.5-darwin-arm64-debian10: digest: sha256:5a135f23e532062a329dac9de017da591d27256cb87e76b9150145ce1cc83c9c size: 3459
[2021-06-18T15:30:37.031Z] make[1]: Leaving directory '/var/lib/jenkins/workspace/ats_golang-crossbuild-mbp_PR-108/src/github.com/elastic/golang-crossbuild/go1.16/darwin-arm64'
[2021-06-18T15:30:37.031Z] make: Leaving directory '/var/lib/jenkins/workspace/ats_golang-crossbuild-mbp_PR-108/src/github.com/elastic/golang-crossbuild/go1.16'
[2021-06-18T15:30:38.340Z] Stage "Release" skipped due to when conditional
[2021-06-18T15:30:39.772Z] Running on Jenkins in /var/lib/jenkins/workspace/ats_golang-crossbuild-mbp_PR-108
[2021-06-18T15:30:39.864Z] [INFO] getVaultSecret: Getting secrets
[2021-06-18T15:30:39.910Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2021-06-18T15:30:40.874Z] + chmod 755 generate-build-data.sh
[2021-06-18T15:30:40.875Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/golang-crossbuild-mbp/PR-108/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/golang-crossbuild-mbp/PR-108/runs/1 FAILURE 8456623
[2021-06-18T15:30:40.875Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/golang-crossbuild-mbp/PR-108/runs/1/steps/?limit=10000 -o steps-info.json
[2021-06-18T15:30:41.425Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/golang-crossbuild-mbp/PR-108/runs/1/tests/?status=FAILED -o tests-errors.json
[2021-06-18T15:30:41.426Z] Retry 1/3 exited 22, retrying in 1 seconds...
[2021-06-18T15:30:42.337Z] Retry 2/3 exited 22, retrying in 2 seconds...

Copy link
Contributor

@michel-laterman michel-laterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks for working on this!

@v1v v1v merged commit bc9586e into elastic:master Jun 23, 2021
@v1v v1v deleted the feature/upgrade-golang-crossbuild branch June 23, 2021 11:15
@elasticmachine
Copy link

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #108 updated

  • Start Time: 2021-06-23T09:33:30.748+0000

  • Duration: 140 min 21 sec

  • Commit: e6c0d3a

Trends 🧪

Image of Build Times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants