From d77863b2e8a97df32a9230c9c8e2e28ceb613ccb Mon Sep 17 00:00:00 2001 From: Ben Courliss Date: Fri, 3 Nov 2023 09:04:25 -0400 Subject: [PATCH] Issue 3929 - Updated build to use latest Golang 1.21 Signed-off-by: Ben Courliss --- .github/workflows/E2E-test.yml | 4 ++-- .github/workflows/build-push.yml | 11 +++++++---- go.mod | 2 +- go.sum | 12 ++++++++++++ test/Makefile | 3 ++- test/README.md | 4 ++-- test/docker/Dockerfile | 3 ++- 7 files changed, 28 insertions(+), 11 deletions(-) diff --git a/.github/workflows/E2E-test.yml b/.github/workflows/E2E-test.yml index 0a1fc3dd2..c2e318eb5 100644 --- a/.github/workflows/E2E-test.yml +++ b/.github/workflows/E2E-test.yml @@ -32,10 +32,10 @@ jobs: path: go/src/github.com/${{github.repository}} # Prepares the environment by setting up golang - - name: Set up golang 1.19 + - name: Set up golang 1.21 uses: actions/setup-go@v2 with: - go-version: '1.19' + go-version: '1.21' check-latest: true # Build anax binaries diff --git a/.github/workflows/build-push.yml b/.github/workflows/build-push.yml index f69b25ff9..262c2869a 100644 --- a/.github/workflows/build-push.yml +++ b/.github/workflows/build-push.yml @@ -3,6 +3,7 @@ name: build-push # Workflow triggers -- When a push (including merge) is made to the listed branches on: + workflow_dispatch: push: branches: - master @@ -143,17 +144,19 @@ jobs: path: go/src/github.com/${{ github.repository }} # Prepare the environment - - name: Set up golang 1.19 + - name: Set up golang 1.21 uses: actions/setup-go@v3 with: - go-version: '1.19' + go-version: '1.21' check-latest: true # The go version will change, so we must get which one we are using for when we build the ppc64el images in the docker env. - name: Check Go Version id: get_go run: | + go version echo "GO_VERSION=$(go version | awk '{print $3}')" >> $GITHUB_OUTPUT + # Configure version variables for later steps, stored in our workflow env. variables - name: Config Version Variables @@ -334,10 +337,10 @@ jobs: path: go/src/github.com/${{ github.repository }} # Prepare the environment - - name: Set up golang 1.19 + - name: Set up golang 1.21 uses: actions/setup-go@v3 with: - go-version: '1.19' + go-version: '1.21' check-latest: true # Configure version variables for later steps, stored in our workflow env. variables diff --git a/go.mod b/go.mod index 1dac95238..01a146938 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/open-horizon/anax -go 1.19 +go 1.21 require ( github.com/adams-sarah/test2doc v0.0.0-20211124171229-79cd42e7411d diff --git a/go.sum b/go.sum index 84251bf26..af80093e3 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,7 @@ cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2k cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8 h1:V8krnnfGj4pV65YLUm3C0/8bl7V5Nry2Pwvy3ru/wLc= +github.com/AdaLogics/go-fuzz-headers v0.0.0-20210715213245-6c3934b029d8/go.mod h1:CzsSbkDixRphAF5hS6wbMKq0eI6ccJRb7/A0M6JBnwg= github.com/Azure/azure-sdk-for-go v46.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v62.0.0+incompatible h1:8N2k27SYtc12qj5nTsuFMFJPZn5CGmgMWqTy4y9I7Jw= github.com/Azure/azure-sdk-for-go v62.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -53,6 +54,7 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.9.6 h1:VwnDOgLeoi2du6dAznfmspNqTiwczvjv4K7NxuY9jsY= +github.com/Microsoft/hcsshim v0.9.6/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= @@ -148,6 +150,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:ma github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY= +github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -179,11 +182,13 @@ github.com/emicklei/go-restful/v3 v3.10.2/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRr github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= +github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/fsouza/go-dockerclient v1.9.8-0.20230522150442-ffee66d6477f h1:M/+oJNU6jkwDmMVGsi7NnUGuSZAUM7wURjSQxxE48jc= github.com/fsouza/go-dockerclient v1.9.8-0.20230522150442-ffee66d6477f/go.mod h1:iZQdSAzjKMlgbG3wrj/bklC2zfsEZUvlkaCstJkBg8s= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -375,10 +380,14 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.4.0 h1:+Ig9nvqgS5OBSACXNk15PLdp0U9XPYROt9CFzVdFGIs= +github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkAt4OrFo= github.com/onsi/gomega v1.23.0 h1:/oxKu9c2HVap+F3PfKort2Hw5DEU+HGlW8n+tguWsys= +github.com/onsi/gomega v1.23.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2vQAg= github.com/open-horizon/edge-sync-service v1.10.1 h1:+b+YTPqyxyhieixaFoV03Bs0Fmy5HGZtOIkhMG8OkMo= github.com/open-horizon/edge-sync-service v1.10.1/go.mod h1:yCK3f59UHnoLU0Tz2/RhuLGygJFlZoqlP8kpmQ3Gqd4= github.com/open-horizon/edge-utilities v0.0.0-20190711093331-0908b45a7152 h1:YEvNOMo3ANOQ3AwsU0cCcBA4nKHDLUlyUCRWk5rBf68= @@ -669,6 +678,7 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= @@ -676,6 +686,7 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -689,6 +700,7 @@ gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.1.0 h1:rVV8Tcg/8jHUkPUorwjaMTtemIMVXfIPKiOqnhEhakk= +gotest.tools/v3 v3.1.0/go.mod h1:fHy7eyTmJFO5bQbUsEGQ1v4m2J3Jz9eWL54TP2/ZuYQ= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/test/Makefile b/test/Makefile index 066f85756..4811c3921 100644 --- a/test/Makefile +++ b/test/Makefile @@ -208,7 +208,8 @@ run-test: test-image e2edevtest-docker-prereqs test-network -e "HZN_AGBOT_URL"="$(AGBOT_SAPI_URL)" \ -e "TEST_PATTERNS"="$(TEST_PATTERNS)" \ -t $(DOCKER_TEST_INAME):$(DOCKER_TEST_TAG) - docker cp $(E2EDEVTEST_TEMPFS)/. $(DOCKER_TEST_CNAME):/ + docker cp -a $(E2EDEVTEST_TEMPFS)/. $(DOCKER_TEST_CNAME):/ + docker exec --user root $(DOCKER_TEST_CNAME) chown -R 1000:1000 /certs run-dockerreg: test-network @echo "Handling Docker $(DOCKER_REG_CNAME)" diff --git a/test/README.md b/test/README.md index 720d61696..180b7f59c 100644 --- a/test/README.md +++ b/test/README.md @@ -22,9 +22,9 @@ And depending on which PATTERN is chosen, a series of workload containers - `curl https://get.docker.com/ | sh` - Install make and jq - `apt update && apt install -y make jq build-essential` -- Install `golang=^1.19.*`... +- Install `golang=^1.21.*`... - `export ARCH=$(uname -m)` - - `curl https://dl.google.com/go/go1.19.linux-.tar.gz | tar -xzf- -C /usr/local/` + - `curl https://dl.google.com/go/go1.21.linux-.tar.gz | tar -xzf- -C /usr/local/` - `export PATH=$PATH:/usr/local/go/bin` (and modify your ~/.bashrc file with the same) - GOPATH cannot be set to the same path as GOROOT - `export GOPATH=` (typically $HOME/go) diff --git a/test/docker/Dockerfile b/test/docker/Dockerfile index f668f1601..85d8e4432 100755 --- a/test/docker/Dockerfile +++ b/test/docker/Dockerfile @@ -6,13 +6,14 @@ RUN apt-get update \ && apt-get -y install vim iptables build-essential wget git iputils-ping net-tools curl jq kafkacat apt-transport-https socat software-properties-common lsb-release gettext-base ARG DOCKER_VER=19.03.8 +ARG GO_VER=1.21.3 # install docker cli RUN curl -4fsSLO https://download.docker.com/linux/static/stable/x86_64/docker-${DOCKER_VER}.tgz \ && tar xzvf docker-${DOCKER_VER}.tgz --strip 1 -C /usr/bin docker/docker \ && rm docker-${DOCKER_VER}.tgz -RUN curl https://dl.google.com/go/go1.19.linux-amd64.tar.gz | tar -xzf- -C /usr/local/ +RUN curl https://dl.google.com/go/go${GO_VER}.linux-amd64.tar.gz | tar -xzf- -C /usr/local/ RUN curl -4fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - && \ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \