From d07a7ac2620ef15f23562c29bf83a853a808be9f Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Thu, 4 Jul 2024 17:05:56 +0800 Subject: [PATCH 01/13] bump up version to 1.10.19 upgrade golang to 1.22.5 Signed-off-by: Shengwen Yu --- .github/workflows/CI.yml | 16 ++++++++-------- .github/workflows/build-package.yml | 2 +- CONTRIBUTING.md | 2 +- Makefile | 4 ++-- VERSION | 2 +- docs/compile_guide.md | 8 ++++---- docs/use_make.md | 4 ++-- make/photon/registry/Dockerfile.binary | 2 +- src/go.mod | 2 +- src/go.sum | 2 -- tests/ci/api_common_install.sh | 2 +- tests/ci/distro_installer.sh | 4 ++-- 12 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index edce7125ea6..1672eaac521 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,10 +29,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.22 uses: actions/setup-go@v1 with: - go-version: 1.20.7 + go-version: 1.22.5 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -95,10 +95,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.22 uses: actions/setup-go@v1 with: - go-version: 1.20.7 + go-version: 1.22.5 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -155,10 +155,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.22 uses: actions/setup-go@v1 with: - go-version: 1.20.7 + go-version: 1.22.5 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -213,10 +213,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.20 + - name: Set up Go 1.22 uses: actions/setup-go@v1 with: - go-version: 1.20.7 + go-version: 1.22.5 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index b5daa78fd6e..5050a01c9e5 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -28,7 +28,7 @@ jobs: - name: Set up Go 1.17 uses: actions/setup-go@v1 with: - go-version: 1.20.7 + go-version: 1.22.5 id: go - name: Setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0adf724f22d..31a3df9b98e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo | 1.7 | 1.9.2 | | 1.8 | 1.11.2 | | 1.9 | 1.12.12 | -| 1.10 | 1.20.7 | +| 1.10 | 1.22.5 | Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions. diff --git a/Makefile b/Makefile index 87b94838926..910ff85be0b 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ # compile_golangimage: # compile from golang image # for example: make compile_golangimage -e GOBUILDIMAGE= \ -# golang:1.20.7 +# golang:1.22.5 # compile_core, compile_jobservice: compile specific binary # # build: build Harbor docker images from photon baseimage @@ -137,7 +137,7 @@ GOINSTALL=$(GOCMD) install GOTEST=$(GOCMD) test GODEP=$(GOTEST) -i GOFMT=gofmt -w -GOVERSION=1.20.7 +GOVERSION=1.22.5 GOBUILDIMAGE=goharbor/golang:$(GOVERSION) PUSHGOIMAGE=false GOBUILDPATH=/harbor diff --git a/VERSION b/VERSION index b5c9315d3ec..63f269209ed 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v1.10.18 +v1.10.19 diff --git a/docs/compile_guide.md b/docs/compile_guide.md index d2e920a3f58..b217da0d51a 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -43,25 +43,25 @@ You can compile the code by one of the three approaches: - Get official Golang image from docker hub: ```sh - $ docker pull goharbor/golang:1.20.7 + $ docker pull goharbor/golang:1.22.5 ``` - Build, install and bring up Harbor without Notary: ```sh - $ make install GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage + $ make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage ``` - Build, install and bring up Harbor with Notary: ```sh - $ make install GOBUILDIMAGE=golang:1.17.9 COMPILETAG=compile_golangimage NOTARYFLAG=true + $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true ``` - Build, install and bring up Harbor with Clair: ```sh - $ make install GOBUILDIMAGE=golang:1.17.9 COMPILETAG=compile_golangimage CLAIRFLAG=true + $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage CLAIRFLAG=true ``` #### II. Compile code with your own Golang environment, then build Harbor diff --git a/docs/use_make.md b/docs/use_make.md index 55c30db4f9c..cdf8490f8ea 100644 --- a/docs/use_make.md +++ b/docs/use_make.md @@ -36,10 +36,10 @@ version | set harbor version #### EXAMPLE: #### Build and run harbor from source code. -make install GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true +make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Package offline installer -make package_offline GOBUILDIMAGE=golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true +make package_offline GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Start harbor with notary make -e NOTARYFLAG=true start diff --git a/make/photon/registry/Dockerfile.binary b/make/photon/registry/Dockerfile.binary index b3a05c1f8fb..3964adcaaeb 100644 --- a/make/photon/registry/Dockerfile.binary +++ b/make/photon/registry/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM goharbor/golang:1.20.7 +FROM goharbor/golang:1.22.5 ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV BUILDTAGS include_oss include_gcs diff --git a/src/go.mod b/src/go.mod index b4fe0ed325e..295ca22be75 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,6 +1,6 @@ module github.com/goharbor/harbor/src -go 1.17 +go 1.22 replace github.com/goharbor/harbor => ../ diff --git a/src/go.sum b/src/go.sum index f55adeb0f63..d9b384e7a9b 100644 --- a/src/go.sum +++ b/src/go.sum @@ -87,7 +87,6 @@ github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwt github.com/cenkalti/backoff v2.1.1+incompatible h1:tKJnvO2kl0zmb/jA5UKAt4VoEVw1qxKWjE/Bpp46npY= github.com/cenkalti/backoff v2.1.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= -github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= @@ -532,7 +531,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index 355fed84cd1..2baf56d4528 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -57,5 +57,5 @@ pip -V #sudo apt-get update && sudo apt-get install -y --no-install-recommends libssl-dev && sudo apt-get autoremove -y && sudo rm -rf /var/lib/apt/lists/* sudo wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py && sudo pip install --ignore-installed urllib3 chardet requests --upgrade sudo make build_base_images -e BASEIMAGETAG=dev -sudo make install GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false +sudo make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false sleep 10 diff --git a/tests/ci/distro_installer.sh b/tests/ci/distro_installer.sh index 3c9fa8b5d92..365b5f040ba 100755 --- a/tests/ci/distro_installer.sh +++ b/tests/ci/distro_installer.sh @@ -2,5 +2,5 @@ set -e -sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= -sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.20.7 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= From 965f4505a53642944a1088ec8bd5313ce0bb3779 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Thu, 4 Jul 2024 17:34:17 +0800 Subject: [PATCH 02/13] fix: add golang Dockerfile to build goharbor/golang image Signed-off-by: Shengwen Yu --- make/photon/golang/Dockerfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 make/photon/golang/Dockerfile diff --git a/make/photon/golang/Dockerfile b/make/photon/golang/Dockerfile new file mode 100644 index 00000000000..a009fddfce6 --- /dev/null +++ b/make/photon/golang/Dockerfile @@ -0,0 +1,35 @@ +FROM photon:4.0 + +ARG GOVERSION + +# install cgo-related dependencies && git +# official golang build from standard Debian, while photon os do not install git as default +RUN tdnf install build-essential git gpg -y + +ENV PATH /usr/local/go/bin:$PATH + +ENV GOLANG_VERSION ${GOVERSION} + +RUN set eux; \ + url="https://dl.google.com/go/go${GOLANG_VERSION}.linux-amd64.tar.gz"; \ + sha256="904b924d435eaea086515bc63235b192ea441bd8c9b198c507e85009e6e4c7f0"; \ + wget -O go.tgz.asc "$url.asc"; \ + wget -O go.tgz "$url"; \ + echo "$sha256 *go.tgz" | sha256sum -c -; \ + # https://github.com/golang/go/issues/14739#issuecomment-324767697 + GNUPGHOME="$(mktemp -d)"; export GNUPGHOME; \ + # https://www.google.com/linuxrepositories/ + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 'EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796'; \ + # let's also fetch the specific subkey of that key explicitly that we expect "go.tgz.asc" to be signed by, just to make sure we definitely have it + gpg --batch --keyserver keyserver.ubuntu.com --recv-keys '2F52 8D36 D67B 69ED F998 D857 78BD 6547 3CB3 BD13'; \ + gpg --batch --verify go.tgz.asc go.tgz; \ + gpgconf --kill all; \ + rm -rf "$GNUPGHOME" go.tgz.asc; \ + tar -C /usr/local -xzf go.tgz; \ + rm go.tgz; \ + go version + +ENV GOPATH /go +ENV PATH $GOPATH/bin:$PATH +RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH" +WORKDIR $GOPATH \ No newline at end of file From 0826ccac7b03aa20dfd6edb1520f0df74e8da8a2 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Thu, 4 Jul 2024 17:52:17 +0800 Subject: [PATCH 03/13] change "go get" to "go install" as it requires in golang:1.22 Signed-off-by: Shengwen Yu --- tests/ci/ut_install.sh | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/ci/ut_install.sh b/tests/ci/ut_install.sh index 79b4fe062af..bad29c61dff 100755 --- a/tests/ci/ut_install.sh +++ b/tests/ci/ut_install.sh @@ -4,16 +4,18 @@ set -ex sudo apt-get update && sudo apt-get install -y libldap2-dev sudo go env -w GO111MODULE=auto -go get -d github.com/docker/distribution -go get -d github.com/docker/libtrust -go get -d github.com/lib/pq -go get golang.org/x/lint/golint -go get github.com/GeertJohan/fgt -go get github.com/dghubble/sling -set +e -go get golang.org/x/tools/cmd/cover -go get github.com/mattn/goveralls -go get -u github.com/client9/misspell/cmd/misspell +pwd +go version +#go get -d github.com/docker/distribution +#go get -d github.com/docker/libtrust +#go get -d github.com/lib/pq +#go get golang.org/x/lint/golint +#go get github.com/GeertJohan/fgt +#go get github.com/dghubble/sling +#set +e +go install golang.org/x/tools/cmd/cover@latest +go install github.com/mattn/goveralls@latest +go install github.com/client9/misspell/cmd/misspell@latest set -e sudo service postgresql stop || echo no postgresql need to be stopped sleep 2 From ff442a7f46cc1b644bd10ce4d64e08ef8c721794 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Thu, 4 Jul 2024 18:03:17 +0800 Subject: [PATCH 04/13] fix: go install golint Signed-off-by: Shengwen Yu --- tests/ci/ut_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/ut_install.sh b/tests/ci/ut_install.sh index bad29c61dff..eceb62a873b 100755 --- a/tests/ci/ut_install.sh +++ b/tests/ci/ut_install.sh @@ -9,7 +9,7 @@ go version #go get -d github.com/docker/distribution #go get -d github.com/docker/libtrust #go get -d github.com/lib/pq -#go get golang.org/x/lint/golint +go install golang.org/x/lint/golint@latest #go get github.com/GeertJohan/fgt #go get github.com/dghubble/sling #set +e From 22ec281014979a98ed9a601340fd89db934c72fb Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Fri, 5 Jul 2024 12:40:12 +0800 Subject: [PATCH 05/13] fix: update go version in build-package.yml Signed-off-by: Shengwen Yu --- .github/workflows/build-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index 5050a01c9e5..de6b641cb12 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -25,8 +25,8 @@ jobs: with: version: '285.0.0' - run: gcloud info - - name: Set up Go 1.17 - uses: actions/setup-go@v1 + - name: Set up Go 1.22 + uses: actions/setup-go@v4 with: go-version: 1.22.5 id: go From 9056cd7e8f4c7011b476e8ed92c4e522db654d3f Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Fri, 5 Jul 2024 15:58:57 +0800 Subject: [PATCH 06/13] fix: upgrade golang to 1.22.5 to build clair and clair-adapter Signed-off-by: Shengwen Yu --- make/photon/clair-adapter/Dockerfile.binary | 2 +- make/photon/clair/Dockerfile.binary | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/make/photon/clair-adapter/Dockerfile.binary b/make/photon/clair-adapter/Dockerfile.binary index 05234954cf8..93cba569d62 100644 --- a/make/photon/clair-adapter/Dockerfile.binary +++ b/make/photon/clair-adapter/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM golang:1.17.9 +FROM golang:1.22.5 ADD . /go/src/github.com/goharbor/harbor-scanner-clair/ WORKDIR /go/src/github.com/goharbor/harbor-scanner-clair/ diff --git a/make/photon/clair/Dockerfile.binary b/make/photon/clair/Dockerfile.binary index 21e2571fb21..96986f235cb 100644 --- a/make/photon/clair/Dockerfile.binary +++ b/make/photon/clair/Dockerfile.binary @@ -1,7 +1,8 @@ -FROM golang:1.15.6 +FROM golang:1.22.5 ADD . /go/src/github.com/quay/clair/ WORKDIR /go/src/github.com/quay/clair/ RUN export CLAIR_VERSION=$(git describe --tag --always --dirty) GO111MODULE=on && \ + go get github.com/PuerkitoBio/goquery && \ go build -ldflags "-X github.com/quay/clair/pkg/version.Version=$CLAIR_VERSION" ./cmd/clair From f2a16cf55f5b2d7fc6580e7fb1208e1898ccb261 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 12:25:16 +0800 Subject: [PATCH 07/13] fix: resolve the permission denied issue Signed-off-by: Shengwen Yu --- tests/ci/api_common_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index 2baf56d4528..a4761dc27db 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -25,7 +25,7 @@ sudo ./tests/hostcfg.sh # LDAP prepare phase, since LDAP service is a docker service. # ip addr -dns_ip=$(netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}') +dns_ip=$(sudo netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}') dns_ip_list=$(echo $dns_ip | tr " " "\n") dns_cfg="" for ip in $dns_ip_list From a6c29bf6cbbc66bfeb41db4ce7c14eaa2fa4de38 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 13:55:12 +0800 Subject: [PATCH 08/13] debug: remove DNS setting for docker v20 Signed-off-by: Shengwen Yu --- tests/ci/api_common_install.sh | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index a4761dc27db..83404b7ab5b 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -24,25 +24,25 @@ sudo ./tests/hostcfg.sh # Note: In LDAP pipeline, this setting must be done before # # LDAP prepare phase, since LDAP service is a docker service. # -ip addr -dns_ip=$(sudo netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}') -dns_ip_list=$(echo $dns_ip | tr " " "\n") -dns_cfg="" -for ip in $dns_ip_list -do - dns_cfg="$dns_cfg,\"$ip\"" -done - -cat /etc/docker/daemon.json - -if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then - sudo sed "s/}/,\n \"dns\": [${dns_cfg:1}]\n}/" -i /etc/docker/daemon.json -fi - -cat /etc/docker/daemon.json -sudo systemctl daemon-reload -sudo systemctl restart docker -sudo systemctl status docker +# ip addr +# dns_ip=$(sudo netplan ip leases eth0 | grep -i dns | awk -F = '{print $2}') +# dns_ip_list=$(echo $dns_ip | tr " " "\n") +# dns_cfg="" +# for ip in $dns_ip_list +# do +# dns_cfg="$dns_cfg,\"$ip\"" +# done +# +# cat /etc/docker/daemon.json +# +# if [ $(cat /etc/docker/daemon.json |grep \"dns\" |wc -l) -eq 0 ];then +# sudo sed "s/}/,\n \"dns\": [${dns_cfg:1}]\n}/" -i /etc/docker/daemon.json +# fi +# +# cat /etc/docker/daemon.json +# sudo systemctl daemon-reload +# sudo systemctl restart docker +# sudo systemctl status docker # # #---------------------------------------------------------------# From a02a014e849583599a8e38286a33d598cbe680ed Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 15:48:12 +0800 Subject: [PATCH 09/13] fix "groupadd: group 'postgres' already exists" error when building db base Signed-off-by: Shengwen Yu --- make/photon/db/Dockerfile.base | 2 ++ 1 file changed, 2 insertions(+) diff --git a/make/photon/db/Dockerfile.base b/make/photon/db/Dockerfile.base index 6c5c93424cb..bbb11e20a79 100644 --- a/make/photon/db/Dockerfile.base +++ b/make/photon/db/Dockerfile.base @@ -8,6 +8,8 @@ COPY ./make/photon/db/postgresql96-9.6.21-1.ph4.x86_64.rpm /pg96/ RUN tdnf install -y /pg96/postgresql96-libs-9.6.21-1.ph4.x86_64.rpm /pg96/postgresql96-9.6.21-1.ph4.x86_64.rpm >> /dev/null \ && rm -rf /pg96 \ && tdnf install -y shadow gzip postgresql13 findutils bc >> /dev/null \ + && userdel postgres \ + && groupdel postgres \ && groupadd -r postgres --gid=999 \ && useradd -m -r -g postgres --uid=999 postgres \ && mkdir -p /docker-entrypoint-initdb.d \ From ac2ca439d6a5e8a991c2a8e7696fa3082fe0a5f6 Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 20:13:40 +0800 Subject: [PATCH 10/13] bump up to photon:5.0 mainly to resolve /lib/libc.so.6: version `GLIBC_2.34' not found use mariadb-18.2.6.tgz as the old one is 404 Signed-off-by: Shengwen Yu --- make/photon/chartserver/Dockerfile.base | 2 +- make/photon/clair-adapter/Dockerfile.base | 2 +- make/photon/clair/Dockerfile.base | 2 +- make/photon/core/Dockerfile.base | 2 +- make/photon/db/Dockerfile.base | 2 +- make/photon/jobservice/Dockerfile.base | 2 +- make/photon/log/Dockerfile.base | 2 +- make/photon/nginx/Dockerfile.base | 2 +- make/photon/notary-server/Dockerfile.base | 2 +- make/photon/notary-signer/Dockerfile.base | 2 +- make/photon/portal/Dockerfile.base | 2 +- make/photon/prepare/Dockerfile.base | 2 +- make/photon/redis/Dockerfile.base | 2 +- make/photon/registry/Dockerfile.base | 2 +- make/photon/registryctl/Dockerfile.base | 2 +- tests/apitests/python/test_list_helm_charts.py | 4 ++-- 16 files changed, 17 insertions(+), 17 deletions(-) diff --git a/make/photon/chartserver/Dockerfile.base b/make/photon/chartserver/Dockerfile.base index 54a15d5302d..d66f19627ac 100644 --- a/make/photon/chartserver/Dockerfile.base +++ b/make/photon/chartserver/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y shadow sudo >>/dev/null\ && tdnf clean all \ diff --git a/make/photon/clair-adapter/Dockerfile.base b/make/photon/clair-adapter/Dockerfile.base index 71c3165afde..3105b70f7d2 100644 --- a/make/photon/clair-adapter/Dockerfile.base +++ b/make/photon/clair-adapter/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y sudo >>/dev/null\ && tdnf clean all \ diff --git a/make/photon/clair/Dockerfile.base b/make/photon/clair/Dockerfile.base index 85104102cd5..0dddd188d5c 100644 --- a/make/photon/clair/Dockerfile.base +++ b/make/photon/clair/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y git shadow sudo rpm xz python3-xml >>/dev/null\ && tdnf clean all \ diff --git a/make/photon/core/Dockerfile.base b/make/photon/core/Dockerfile.base index 99360863996..28a55fa1ce2 100644 --- a/make/photon/core/Dockerfile.base +++ b/make/photon/core/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/db/Dockerfile.base b/make/photon/db/Dockerfile.base index bbb11e20a79..6a6711b60b2 100644 --- a/make/photon/db/Dockerfile.base +++ b/make/photon/db/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 ENV PGDATA /var/lib/postgresql/data diff --git a/make/photon/jobservice/Dockerfile.base b/make/photon/jobservice/Dockerfile.base index 54e48d4c8db..5721772ea98 100644 --- a/make/photon/jobservice/Dockerfile.base +++ b/make/photon/jobservice/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/log/Dockerfile.base b/make/photon/log/Dockerfile.base index 9ccedb16022..47e7f67fa31 100644 --- a/make/photon/log/Dockerfile.base +++ b/make/photon/log/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\ && mkdir /var/spool/rsyslog \ diff --git a/make/photon/nginx/Dockerfile.base b/make/photon/nginx/Dockerfile.base index 0c6ddeb1ad1..d6a18e543fc 100644 --- a/make/photon/nginx/Dockerfile.base +++ b/make/photon/nginx/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/notary-server/Dockerfile.base b/make/photon/notary-server/Dockerfile.base index f64810f7a11..a2f5a02a894 100644 --- a/make/photon/notary-server/Dockerfile.base +++ b/make/photon/notary-server/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/notary-signer/Dockerfile.base b/make/photon/notary-signer/Dockerfile.base index f64810f7a11..a2f5a02a894 100644 --- a/make/photon/notary-signer/Dockerfile.base +++ b/make/photon/notary-signer/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/portal/Dockerfile.base b/make/photon/portal/Dockerfile.base index cf9d5af892a..7d078696a6d 100644 --- a/make/photon/portal/Dockerfile.base +++ b/make/photon/portal/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/prepare/Dockerfile.base b/make/photon/prepare/Dockerfile.base index 46e24a2e5dc..284f6ef3294 100644 --- a/make/photon/prepare/Dockerfile.base +++ b/make/photon/prepare/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y python3 \ && tdnf install -y python3-pip python3-PyYAML python3-jinja2 diff --git a/make/photon/redis/Dockerfile.base b/make/photon/redis/Dockerfile.base index 8b9e2210b91..172f2db9917 100644 --- a/make/photon/redis/Dockerfile.base +++ b/make/photon/redis/Dockerfile.base @@ -1,3 +1,3 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install -y redis sudo diff --git a/make/photon/registry/Dockerfile.base b/make/photon/registry/Dockerfile.base index d946d648c12..853618578f2 100644 --- a/make/photon/registry/Dockerfile.base +++ b/make/photon/registry/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ diff --git a/make/photon/registryctl/Dockerfile.base b/make/photon/registryctl/Dockerfile.base index 74110ce7850..af79187f1be 100644 --- a/make/photon/registryctl/Dockerfile.base +++ b/make/photon/registryctl/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:4.0 +FROM photon:5.0 RUN tdnf install sudo -y >> /dev/null \ && tdnf clean all \ diff --git a/tests/apitests/python/test_list_helm_charts.py b/tests/apitests/python/test_list_helm_charts.py index 97535e9ab73..da10fc99ff5 100644 --- a/tests/apitests/python/test_list_helm_charts.py +++ b/tests/apitests/python/test_list_helm_charts.py @@ -49,8 +49,8 @@ def testListHelmCharts(self): user_chart_password = "Aa123456" TestProjects.CHART_NAME = 'mariadb' - TestProjects.VERSION = '4.3.1' - base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-4.3.1.tgz", "https://storage.googleapis.com/harbor-builds/bin/charts/mariadb-4.3.1.tgz"]) + TestProjects.VERSION = '18.2.6' + base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-18.2.6.tgz", "https://storage.googleapis.com/harbor-builds/bin/mariadb-18.2.6.tgz"]) #1. Create a new user(UA); TestProjects.user_chart_id, user_chart_name = self.user.create_user(user_password = user_chart_password, **ADMIN_CLIENT) From 13cfaa941ae69616f92bb75d094d67d2569eb4cc Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Mon, 8 Jul 2024 20:22:29 +0800 Subject: [PATCH 11/13] fix: use goharbor/golang 1.21.12 Signed-off-by: Shengwen Yu --- .github/workflows/CI.yml | 16 ++++++++-------- .github/workflows/build-package.yml | 4 ++-- CONTRIBUTING.md | 2 +- Makefile | 4 ++-- docs/compile_guide.md | 8 ++++---- docs/use_make.md | 4 ++-- make/photon/chartserver/Dockerfile.base | 2 +- make/photon/clair-adapter/Dockerfile.binary | 2 +- make/photon/clair/Dockerfile.binary | 2 +- make/photon/core/Dockerfile.base | 2 +- make/photon/db/Dockerfile.base | 2 +- make/photon/jobservice/Dockerfile.base | 2 +- make/photon/log/Dockerfile.base | 2 +- make/photon/nginx/Dockerfile.base | 2 +- make/photon/notary-server/Dockerfile.base | 2 +- make/photon/notary-signer/Dockerfile.base | 2 +- make/photon/portal/Dockerfile.base | 2 +- make/photon/prepare/Dockerfile.base | 2 +- make/photon/redis/Dockerfile.base | 2 +- make/photon/registry/Dockerfile.base | 2 +- make/photon/registry/Dockerfile.binary | 2 +- make/photon/registryctl/Dockerfile.base | 2 +- src/go.mod | 2 +- tests/ci/api_common_install.sh | 2 +- tests/ci/distro_installer.sh | 4 ++-- 25 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1672eaac521..66e46fe7301 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,10 +29,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -95,10 +95,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -155,10 +155,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master @@ -213,10 +213,10 @@ jobs: - ubuntu-latest timeout-minutes: 60 steps: - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v1 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/.github/workflows/build-package.yml b/.github/workflows/build-package.yml index de6b641cb12..a83e3a61984 100644 --- a/.github/workflows/build-package.yml +++ b/.github/workflows/build-package.yml @@ -25,10 +25,10 @@ jobs: with: version: '285.0.0' - run: gcloud info - - name: Set up Go 1.22 + - name: Set up Go 1.21 uses: actions/setup-go@v4 with: - go-version: 1.22.5 + go-version: 1.21.12 id: go - name: Setup Docker uses: docker-practice/actions-setup-docker@master diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 31a3df9b98e..47a994fb348 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -128,7 +128,7 @@ Harbor backend is written in [Go](http://golang.org/). If you don't have a Harbo | 1.7 | 1.9.2 | | 1.8 | 1.11.2 | | 1.9 | 1.12.12 | -| 1.10 | 1.22.5 | +| 1.10 | 1.21.12 | Ensure your GOPATH and PATH have been configured in accordance with the Go environment instructions. diff --git a/Makefile b/Makefile index 910ff85be0b..f5ff0ad7d63 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ # compile_golangimage: # compile from golang image # for example: make compile_golangimage -e GOBUILDIMAGE= \ -# golang:1.22.5 +# goharbor/golang:1.21.12 # compile_core, compile_jobservice: compile specific binary # # build: build Harbor docker images from photon baseimage @@ -137,7 +137,7 @@ GOINSTALL=$(GOCMD) install GOTEST=$(GOCMD) test GODEP=$(GOTEST) -i GOFMT=gofmt -w -GOVERSION=1.22.5 +GOVERSION=1.21.12 GOBUILDIMAGE=goharbor/golang:$(GOVERSION) PUSHGOIMAGE=false GOBUILDPATH=/harbor diff --git a/docs/compile_guide.md b/docs/compile_guide.md index b217da0d51a..02d1805adf4 100644 --- a/docs/compile_guide.md +++ b/docs/compile_guide.md @@ -43,25 +43,25 @@ You can compile the code by one of the three approaches: - Get official Golang image from docker hub: ```sh - $ docker pull goharbor/golang:1.22.5 + $ docker pull goharbor/golang:1.21.12 ``` - Build, install and bring up Harbor without Notary: ```sh - $ make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage ``` - Build, install and bring up Harbor with Notary: ```sh - $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ``` - Build, install and bring up Harbor with Clair: ```sh - $ make install GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage CLAIRFLAG=true + $ make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage CLAIRFLAG=true ``` #### II. Compile code with your own Golang environment, then build Harbor diff --git a/docs/use_make.md b/docs/use_make.md index cdf8490f8ea..3b3e3524774 100644 --- a/docs/use_make.md +++ b/docs/use_make.md @@ -36,10 +36,10 @@ version | set harbor version #### EXAMPLE: #### Build and run harbor from source code. -make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true +make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Package offline installer -make package_offline GOBUILDIMAGE=golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true +make package_offline GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true ### Start harbor with notary make -e NOTARYFLAG=true start diff --git a/make/photon/chartserver/Dockerfile.base b/make/photon/chartserver/Dockerfile.base index d66f19627ac..54a15d5302d 100644 --- a/make/photon/chartserver/Dockerfile.base +++ b/make/photon/chartserver/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo >>/dev/null\ && tdnf clean all \ diff --git a/make/photon/clair-adapter/Dockerfile.binary b/make/photon/clair-adapter/Dockerfile.binary index 93cba569d62..89964e560f3 100644 --- a/make/photon/clair-adapter/Dockerfile.binary +++ b/make/photon/clair-adapter/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM golang:1.22.5 +FROM goharbor/golang:1.21.12 ADD . /go/src/github.com/goharbor/harbor-scanner-clair/ WORKDIR /go/src/github.com/goharbor/harbor-scanner-clair/ diff --git a/make/photon/clair/Dockerfile.binary b/make/photon/clair/Dockerfile.binary index 96986f235cb..43fe74f974a 100644 --- a/make/photon/clair/Dockerfile.binary +++ b/make/photon/clair/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM golang:1.22.5 +FROM goharbor/golang:1.21.12 ADD . /go/src/github.com/quay/clair/ WORKDIR /go/src/github.com/quay/clair/ diff --git a/make/photon/core/Dockerfile.base b/make/photon/core/Dockerfile.base index 28a55fa1ce2..99360863996 100644 --- a/make/photon/core/Dockerfile.base +++ b/make/photon/core/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/db/Dockerfile.base b/make/photon/db/Dockerfile.base index 6a6711b60b2..bbb11e20a79 100644 --- a/make/photon/db/Dockerfile.base +++ b/make/photon/db/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 ENV PGDATA /var/lib/postgresql/data diff --git a/make/photon/jobservice/Dockerfile.base b/make/photon/jobservice/Dockerfile.base index 5721772ea98..54e48d4c8db 100644 --- a/make/photon/jobservice/Dockerfile.base +++ b/make/photon/jobservice/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo tzdata -y >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/log/Dockerfile.base b/make/photon/log/Dockerfile.base index 47e7f67fa31..9ccedb16022 100644 --- a/make/photon/log/Dockerfile.base +++ b/make/photon/log/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y cronie rsyslog logrotate shadow tar gzip sudo >> /dev/null\ && mkdir /var/spool/rsyslog \ diff --git a/make/photon/nginx/Dockerfile.base b/make/photon/nginx/Dockerfile.base index d6a18e543fc..0c6ddeb1ad1 100644 --- a/make/photon/nginx/Dockerfile.base +++ b/make/photon/nginx/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/notary-server/Dockerfile.base b/make/photon/notary-server/Dockerfile.base index a2f5a02a894..f64810f7a11 100644 --- a/make/photon/notary-server/Dockerfile.base +++ b/make/photon/notary-server/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/notary-signer/Dockerfile.base b/make/photon/notary-signer/Dockerfile.base index a2f5a02a894..f64810f7a11 100644 --- a/make/photon/notary-signer/Dockerfile.base +++ b/make/photon/notary-signer/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y shadow sudo \ && tdnf clean all \ diff --git a/make/photon/portal/Dockerfile.base b/make/photon/portal/Dockerfile.base index 7d078696a6d..cf9d5af892a 100644 --- a/make/photon/portal/Dockerfile.base +++ b/make/photon/portal/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y nginx shadow >> /dev/null \ && tdnf clean all \ diff --git a/make/photon/prepare/Dockerfile.base b/make/photon/prepare/Dockerfile.base index 284f6ef3294..46e24a2e5dc 100644 --- a/make/photon/prepare/Dockerfile.base +++ b/make/photon/prepare/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y python3 \ && tdnf install -y python3-pip python3-PyYAML python3-jinja2 diff --git a/make/photon/redis/Dockerfile.base b/make/photon/redis/Dockerfile.base index 172f2db9917..8b9e2210b91 100644 --- a/make/photon/redis/Dockerfile.base +++ b/make/photon/redis/Dockerfile.base @@ -1,3 +1,3 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install -y redis sudo diff --git a/make/photon/registry/Dockerfile.base b/make/photon/registry/Dockerfile.base index 853618578f2..d946d648c12 100644 --- a/make/photon/registry/Dockerfile.base +++ b/make/photon/registry/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo -y >> /dev/null\ && tdnf clean all \ diff --git a/make/photon/registry/Dockerfile.binary b/make/photon/registry/Dockerfile.binary index 3964adcaaeb..44997d0b08d 100644 --- a/make/photon/registry/Dockerfile.binary +++ b/make/photon/registry/Dockerfile.binary @@ -1,4 +1,4 @@ -FROM goharbor/golang:1.22.5 +FROM goharbor/golang:1.21.12 ENV DISTRIBUTION_DIR /go/src/github.com/docker/distribution ENV BUILDTAGS include_oss include_gcs diff --git a/make/photon/registryctl/Dockerfile.base b/make/photon/registryctl/Dockerfile.base index af79187f1be..74110ce7850 100644 --- a/make/photon/registryctl/Dockerfile.base +++ b/make/photon/registryctl/Dockerfile.base @@ -1,4 +1,4 @@ -FROM photon:5.0 +FROM photon:4.0 RUN tdnf install sudo -y >> /dev/null \ && tdnf clean all \ diff --git a/src/go.mod b/src/go.mod index 295ca22be75..b17794ec2a4 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,6 +1,6 @@ module github.com/goharbor/harbor/src -go 1.22 +go 1.21 replace github.com/goharbor/harbor => ../ diff --git a/tests/ci/api_common_install.sh b/tests/ci/api_common_install.sh index 83404b7ab5b..ed8d7f0fb6a 100755 --- a/tests/ci/api_common_install.sh +++ b/tests/ci/api_common_install.sh @@ -57,5 +57,5 @@ pip -V #sudo apt-get update && sudo apt-get install -y --no-install-recommends libssl-dev && sudo apt-get autoremove -y && sudo rm -rf /var/lib/apt/lists/* sudo wget https://bootstrap.pypa.io/get-pip.py && sudo python ./get-pip.py && sudo pip install --ignore-installed urllib3 chardet requests --upgrade sudo make build_base_images -e BASEIMAGETAG=dev -sudo make install GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false +sudo make install GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage CLARITYIMAGE=goharbor/harbor-clarity-ui-builder:1.6.0 NOTARYFLAG=true CLAIRFLAG=true CHARTFLAG=true BUILDBIN=true PULL_BASE_FROM_DOCKERHUB=false sleep 10 diff --git a/tests/ci/distro_installer.sh b/tests/ci/distro_installer.sh index 365b5f040ba..867fad8945f 100755 --- a/tests/ci/distro_installer.sh +++ b/tests/ci/distro_installer.sh @@ -2,5 +2,5 @@ set -e -sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= -sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.22.5 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_online VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= +sudo make package_offline VERSIONTAG=dev-travis PKGVERSIONTAG=dev-travis UIVERSIONTAG=dev-travis GOBUILDIMAGE=goharbor/golang:1.21.12 COMPILETAG=compile_golangimage NOTARYFLAG=true CLAIRFLAG=true MIGRATORFLAG=false CHARTFLAG=true BUILDBIN=true HTTPPROXY= From f2fbb3bdee4ce4e68f84489401b336c7178f8d9b Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Wed, 10 Jul 2024 11:27:57 +0800 Subject: [PATCH 12/13] fix: update golang version in echo log message when building clair binary and clair adapter Signed-off-by: Shengwen Yu --- make/photon/clair-adapter/builder | 2 +- make/photon/clair/builder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/make/photon/clair-adapter/builder b/make/photon/clair-adapter/builder index 483c05d9711..31930592b74 100755 --- a/make/photon/clair-adapter/builder +++ b/make/photon/clair-adapter/builder @@ -23,7 +23,7 @@ TEMP=`mktemp -d ${TMPDIR-/tmp}/clair-adapter.XXXXXX` git clone https://github.com/goharbor/harbor-scanner-clair.git $TEMP cd $TEMP; git checkout $VERSION; cd - -echo 'build the clair adapter binary bases on the golang:1.17.9' +echo 'build the clair adapter binary bases on the golang:1.21.12' cp Dockerfile.binary $TEMP docker build -f $TEMP/Dockerfile.binary -t clair-adapter-golang $TEMP diff --git a/make/photon/clair/builder b/make/photon/clair/builder index 01d6774fe79..254289d404e 100755 --- a/make/photon/clair/builder +++ b/make/photon/clair/builder @@ -22,7 +22,7 @@ cur=$PWD TEMP=`mktemp -d /$TMPDIR/clair.XXXXXX` git clone -b $VERSION --single-branch https://github.com/quay/clair.git $TEMP -echo 'build the clair binary bases on the golang:1.15.6' +echo 'build the clair binary bases on the golang:1.21.12' cp Dockerfile.binary $TEMP docker build -f $TEMP/Dockerfile.binary -t clair-golang $TEMP From a25161c94b50d1e95b33ee1493d847704e5a8dfe Mon Sep 17 00:00:00 2001 From: Shengwen Yu Date: Wed, 10 Jul 2024 19:02:29 +0800 Subject: [PATCH 13/13] fix: update chart files URL due to 404 Signed-off-by: Shengwen Yu --- tests/apitests/python/test_list_helm_charts.py | 2 +- .../Harbor-Pages/Project-Helmcharts_Elements.robot | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/apitests/python/test_list_helm_charts.py b/tests/apitests/python/test_list_helm_charts.py index da10fc99ff5..fae5528f351 100644 --- a/tests/apitests/python/test_list_helm_charts.py +++ b/tests/apitests/python/test_list_helm_charts.py @@ -50,7 +50,7 @@ def testListHelmCharts(self): user_chart_password = "Aa123456" TestProjects.CHART_NAME = 'mariadb' TestProjects.VERSION = '18.2.6' - base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-18.2.6.tgz", "https://storage.googleapis.com/harbor-builds/bin/mariadb-18.2.6.tgz"]) + base.run_command( ["curl", r"-o", "./tests/apitests/python/mariadb-18.2.6.tgz", "https://storage.googleapis.com/harbor-ci-pipeline-store/bin/mariadb-18.2.6.tgz"]) #1. Create a new user(UA); TestProjects.user_chart_id, user_chart_name = self.user.create_user(user_password = user_chart_password, **ADMIN_CLIENT) diff --git a/tests/resources/Harbor-Pages/Project-Helmcharts_Elements.robot b/tests/resources/Harbor-Pages/Project-Helmcharts_Elements.robot index 43cd0223964..36217626012 100644 --- a/tests/resources/Harbor-Pages/Project-Helmcharts_Elements.robot +++ b/tests/resources/Harbor-Pages/Project-Helmcharts_Elements.robot @@ -10,16 +10,16 @@ ${chart_prov_browse} //*[@id='prov'] ${upload_action_button} //*[@id='upload-chart'] ${harbor_chart_name} harbor -${harbor_chart_filename} harbor-0.2.0.tgz -${harbor_chart_version} 0.2.0 -${harbor_chart_prov_filename} harbor-0.2.0.tgz.prov -${harbor_chart_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz -${harbor_chart_prov_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/harbor-0.2.0.tgz.prov +${harbor_chart_filename} harbor-1.14.2.tgz +${harbor_chart_version} 1.14.2 +${harbor_chart_prov_filename} harbor-1.14.2.tgz.prov +${harbor_chart_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/harbor-1.14.2.tgz +${harbor_chart_prov_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/harbor-1.14.2.tgz.prov ${prometheus_chart_name} prometheus ${prometheus_chart_filename} prometheus-7.0.2.tgz ${prometheus_chart_version} 7.0.2 -${prometheus_chart_file_url} https://storage.googleapis.com/harbor-builds/helm-chart-test-files/prometheus-7.0.2.tgz +${prometheus_chart_file_url} https://storage.googleapis.com/harbor-ci-pipeline-store/bin/prometheus-7.0.2.tgz ${prometheus_version} //hbr-helm-chart//a[contains(.,'prometheus')] ${chart_detail} //hbr-chart-detail