From 15b8594bba30c46dabb715947143d9b10f7c689c Mon Sep 17 00:00:00 2001 From: Laura Vuorenoja Date: Tue, 15 Aug 2023 13:42:25 +0300 Subject: [PATCH] Go version 1.21. --- .devcontainer/Dockerfile | 26 ++++++++++++++++---------- .golangci.yml | 2 +- go.mod | 2 +- go.sum | 14 ++++++++++++++ scripts/deploy/Dockerfile | 14 ++++++++++---- scripts/unit-tests/Dockerfile | 19 ++++++++++++------- 6 files changed, 54 insertions(+), 23 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index a4387084..6e512d41 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,24 +1,30 @@ -FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 AS indy-base +FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-22.04 AS indy-base -FROM golang:1.20-buster AS agent-builder +FROM golang:1.21-bookworm AS agent-builder # install indy deps and files from base -RUN apt-get update && apt-get install -y libsodium23 libssl1.1 libzmq5 +RUN apt-get update && apt-get install -y libsodium23 libzmq5 + COPY --from=indy-base /usr/include/indy /usr/include/indy COPY --from=indy-base /usr/lib/libindy.a /usr/lib/libindy.a COPY --from=indy-base /usr/lib/libindy.so /usr/lib/libindy.so +# manually copy libssl1.1 as it is no longer supported for newer ubuntu +COPY --from=indy-base /usr/lib/engines-1.1 /usr/lib/engines-1.1 +COPY --from=indy-base /usr/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1 +COPY --from=indy-base /usr/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1 + # linter RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2 ENV GO_TOOLS="\ - github.com/cweill/gotests/gotests@latest \ - github.com/fatih/gomodifytags@latest \ - github.com/josharian/impl@latest \ - github.com/haya14busa/goplay/cmd/goplay@latest \ - github.com/go-delve/delve/cmd/dlv@latest \ - honnef.co/go/tools/cmd/staticcheck@latest \ - golang.org/x/tools/gopls@latest" + github.com/cweill/gotests/gotests@latest \ + github.com/fatih/gomodifytags@latest \ + github.com/josharian/impl@latest \ + github.com/haya14busa/goplay/cmd/goplay@latest \ + github.com/go-delve/delve/cmd/dlv@latest \ + honnef.co/go/tools/cmd/staticcheck@latest \ + golang.org/x/tools/gopls@latest" RUN echo "${GO_TOOLS}" | xargs -n 1 go install -v diff --git a/.golangci.yml b/.golangci.yml index 8bc84bb9..1aec17af 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -138,6 +138,6 @@ issues: - typecheck run: service: - golangci-lint-version: 1.52.2 # use the fixed version to not introduce new linters unexpectedly + golangci-lint-version: 1.54.x # use the fixed version to not introduce new linters unexpectedly prepare: - echo "here I can run custom commands, but no preparation needed for this repo" diff --git a/go.mod b/go.mod index 20200959..a7a3dfdb 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/findy-network/findy-agent -go 1.20 +go 1.21 require ( github.com/findy-network/findy-common-go v0.2.32 diff --git a/go.sum b/go.sum index b7120a69..d59e0461 100644 --- a/go.sum +++ b/go.sum @@ -54,10 +54,13 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/PaesslerAG/gval v1.1.0 h1:k3RuxeZDO3eejD4cMPSt+74tUSvTnbGvLx0df4mdwFc= +github.com/PaesslerAG/gval v1.1.0/go.mod h1:y/nm5yEyTeX6av0OfKJNp9rBNj2XrGhAf5+v24IBN1I= github.com/PaesslerAG/jsonpath v0.1.1 h1:c1/AToHQMVsduPAa4Vh6xp2U0evy4t8SWp8imEsylIk= +github.com/PaesslerAG/jsonpath v0.1.1/go.mod h1:lVboNxFGal/VwW6d9JzIy56bUsYAP6tH/x80vjnCseY= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/VictoriaMetrics/fastcache v1.5.7 h1:4y6y0G8PRzszQUYIQHHssv/jgPHAb5qQuuDNdCbyAgw= +github.com/VictoriaMetrics/fastcache v1.5.7/go.mod h1:ptDBkNMQI4RtmVo8VS/XwRY6RoTu1dAWCbrk+6WsEM8= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY= github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA= @@ -112,6 +115,7 @@ github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.0.2 h1:JIufpQLbh4DkbQoii76ItQIUFzevQSqOLZca4eamEDs= +github.com/cenkalti/backoff/v4 v4.0.2/go.mod h1:eEew/i+1Q6OrCDZh3WiXYv3+nJwBASZ8Bog/87DQnVg= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= @@ -176,6 +180,7 @@ github.com/form3tech-oss/jwt-go v3.2.5+incompatible/go.mod h1:pbq4aXjuKjdthFRnoD github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4= github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= +github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= 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.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -259,6 +264,7 @@ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -343,6 +349,7 @@ github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmK github.com/hyperledger/aries-framework-go v0.1.8 h1:nKPGTqh+gYWrczJ7mf6clbnDegKPJg7TDis8SYNxcGo= github.com/hyperledger/aries-framework-go v0.1.8/go.mod h1:7ilurt17sjWruVIBxZSrwn8qUbROq8LXYYY+O7dNxIM= github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20220322085443-50e8f9bd208b h1:IoD7+sHQRLMouwHjhrOj5vhg+rPt/aKl4P+WiBZVHVk= +github.com/hyperledger/aries-framework-go/component/storageutil v0.0.0-20220322085443-50e8f9bd208b/go.mod h1:yLgRpVlZ2heeeOpTgvEnG/yHL9q1keUu5ILQ6s2qpLU= github.com/hyperledger/aries-framework-go/spi v0.0.0-20221025204933-b807371b6f1e h1:SxbXlF39661T9w/L9PhVdtbJfJ51Pm4JYEEW6XfZHEQ= github.com/hyperledger/aries-framework-go/spi v0.0.0-20221025204933-b807371b6f1e/go.mod h1:oryUyWb23l/a3tAP9KW+GBbfcfqp9tZD4y5hSkFrkqI= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= @@ -432,6 +439,7 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e h1:Eh/0JuXDdcBHc39j4tFXKTy/AKiK7IQkGJXQxyryXiU= +github.com/kawamuray/jsonpath v0.0.0-20201211160320-7483bafabd7e/go.mod h1:dz00yqWNWlKa9ff7RJzpnHPAPUazsid3yhVzXcsok94= github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69 h1:kMJlf8z8wUcpyI+FQJIdGjAhfTww1y0AbQEv86bpVQI= github.com/kilic/bls12-381 v0.1.1-0.20210503002446-7b7597926c69/go.mod h1:tlkavyke+Ac7h8R3gZIjI5LKBcvMlSWnXNMgT3vZXo8= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= @@ -448,6 +456,7 @@ github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfn github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -635,6 +644,7 @@ github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4 github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= +github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.3.0 h1:6NjYksEUlhurdVehpc7S7dk6DAmcKv8V9gG0FsVN2U4= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -709,9 +719,13 @@ github.com/takama/daemon v0.12.0/go.mod h1:PFDPquCi+3LI5PpAKS/8LvJBHTfkdsEXfGtAN github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8 h1:RBkacARv7qY5laaXGlF4wFB/tk5rnthhPb8oIBGoagY= github.com/teserakt-io/golang-ed25519 v0.0.0-20210104091850-3888c087a4c8/go.mod h1:9PdLyPiZIiW3UopXyRnPYyjUXSpiQNHRLu8fOsR3o8M= github.com/tidwall/gjson v1.6.7 h1:Mb1M9HZCRWEcXQ8ieJo7auYyyiSux6w9XN3AdTpxJrE= +github.com/tidwall/gjson v1.6.7/go.mod h1:zeFuBCIqD4sN/gmqBzZ4j7Jd6UcA2Fc56x7QFsv+8fI= github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE= +github.com/tidwall/match v1.0.3/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU= +github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= github.com/tidwall/sjson v1.1.4 h1:bTSsPLdAYF5QNLSwYsKfBKKTnlGbIuhqL3CpRsjzGhg= +github.com/tidwall/sjson v1.1.4/go.mod h1:wXpKXu8CtDjKAZ+3DrKY5ROCorDFahq8l0tey/Lx1fg= github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= diff --git a/scripts/deploy/Dockerfile b/scripts/deploy/Dockerfile index 3c5ecfb0..ed2b4480 100644 --- a/scripts/deploy/Dockerfile +++ b/scripts/deploy/Dockerfile @@ -1,17 +1,23 @@ -FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 AS indy-base +FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-22.04 AS indy-base -FROM golang:1.20-buster AS agent-builder +FROM golang:1.21-bookworm AS agent-builder ARG GOBUILD_ARGS="" ENV INDY_LIB_VERSION="1.16.0" # install indy deps and files from base -RUN apt-get update && apt-get install -y libsodium23 libssl1.1 libzmq5 +RUN apt-get update && apt-get install -y libsodium23 libzmq5 + COPY --from=indy-base /usr/include/indy /usr/include/indy COPY --from=indy-base /usr/lib/libindy.a /usr/lib/libindy.a COPY --from=indy-base /usr/lib/libindy.so /usr/lib/libindy.so +# manually copy libssl1.1 as it is no longer supported for newer ubuntu +COPY --from=indy-base /usr/lib/engines-1.1 /usr/lib/engines-1.1 +COPY --from=indy-base /usr/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1 +COPY --from=indy-base /usr/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1 + WORKDIR /work COPY go.* ./ @@ -21,7 +27,7 @@ COPY . ./ RUN make install GOBUILD_ARGS=${GOBUILD_ARGS} -FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 +FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-22.04 LABEL org.opencontainers.image.source https://github.com/findy-network/findy-agent diff --git a/scripts/unit-tests/Dockerfile b/scripts/unit-tests/Dockerfile index ce17680d..b6adfd52 100644 --- a/scripts/unit-tests/Dockerfile +++ b/scripts/unit-tests/Dockerfile @@ -1,6 +1,6 @@ -FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-18.04 AS indy-base +FROM ghcr.io/findy-network/findy-base:indy-1.16.ubuntu-22.04 AS indy-base -FROM golang:1.20-buster AS agent-builder +FROM golang:1.21-bookworm AS agent-builder ENV INDY_LIB_VERSION="1.16.0" ENV FCLI_LOGGING "-logtostderr -v=9 -vmodule=cmdHandles=10,agency*=15,agent*=15" @@ -11,21 +11,26 @@ ENV CI "true" ENV VON_WEB_SERVER_URL "http://host.docker.internal:9000" # install indy deps and files from base -RUN apt-get update && apt-get install -y libsodium23 libssl1.1 libzmq5 +RUN apt-get update && apt-get install -y libsodium23 libzmq5 COPY --from=indy-base /usr/include/indy /usr/include/indy COPY --from=indy-base /usr/lib/libindy.a /usr/lib/libindy.a COPY --from=indy-base /usr/lib/libindy.so /usr/lib/libindy.so +# manually copy libssl1.1 as it is no longer supported for newer ubuntu +COPY --from=indy-base /usr/lib/engines-1.1 /usr/lib/engines-1.1 +COPY --from=indy-base /usr/lib/libcrypto.so.1.1 /usr/lib/libcrypto.so.1.1 +COPY --from=indy-base /usr/lib/libssl.so.1.1 /usr/lib/libssl.so.1.1 + WORKDIR /work COPY go.* ./ RUN go mod download RUN echo '#!/bin/sh' > /test.sh && \ - echo "cd /work " >> /test.sh && \ - echo "curl http://host.docker.internal:9000/genesis > gen_txn_file" >> /test.sh && \ - echo "make test" >> /test.sh && \ - chmod a+x /test.sh + echo "cd /work " >> /test.sh && \ + echo "curl http://host.docker.internal:9000/genesis > gen_txn_file" >> /test.sh && \ + echo "make test" >> /test.sh && \ + chmod a+x /test.sh ENTRYPOINT ["/test.sh"]