From 2eaf2dde0ddc96f93c6c19672e52a8a2f61c4e22 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 13:05:23 +0200 Subject: [PATCH 001/179] vs test --- .../workflows/operator-early-adoption.yaml | 495 ++++++++++++++++++ 1 file changed, 495 insertions(+) create mode 100644 .github/workflows/operator-early-adoption.yaml diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml new file mode 100644 index 000000000..3bd642b97 --- /dev/null +++ b/.github/workflows/operator-early-adoption.yaml @@ -0,0 +1,495 @@ +--- +name: API CI +on: + push: + branches: + - EVEREST-1563-operator-early-adoption + +permissions: + contents: read + packages: write + checks: write + pull-requests: write + +jobs: + test: + name: Test + timeout-minutes: 10 + + strategy: + fail-fast: false + matrix: + go-version: [ 1.23.x ] + may-fail: [ false ] + + continue-on-error: ${{ matrix.may-fail }} + runs-on: ubuntu-20.04 + + steps: + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - create release branch + run: | + cd percona-version-service + + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Download Go modules + run: go mod download + +# - name: Install development tools +# run: make init +# +# - name: Generate code +# run: make gen +# +# - name: Install binaries +# run: make build +# +# - name: Run tests +# run: | +# go clean -testcache +# make test-crosscover +# +# - name: Check that there are no source code changes +# run: | +# # Break job if any files were changed during its run (code generation, etc), except go.sum. +# # `go mod tidy` could remove old checksums from that file, and that's okay on CI, +# # and actually expected for PRs made by @dependabot. +# # Checksums of actually used modules are checked by previous `go` subcommands. +# pushd tools && go mod tidy -v && git checkout go.sum +# popd && go mod tidy -v && git checkout go.sum +# git diff --exit-code +# +# - name: Run debug commands on failure +# if: ${{ failure() }} +# run: | +# env +# go version +# go env +# pwd +# git status +# check: +# name: Check +# timeout-minutes: 10 +# if: github.event_name == 'pull_request' +# +# strategy: +# fail-fast: false +# matrix: +# go-version: [1.23.x] +# may-fail: [false] +# +# continue-on-error: ${{ matrix.may-fail }} +# runs-on: ubuntu-latest +# +# steps: +# - name: Set up Go release +# if: matrix.go-version != 'tip' +# uses: actions/setup-go@v5 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set up Go tip +# if: matrix.go-version == 'tip' +# run: | +# git clone --depth=1 https://go.googlesource.com/go $HOME/gotip +# cd $HOME/gotip/src +# ./make.bash +# echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV +# echo "$HOME/gotip/bin" >> $GITHUB_PATH +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Check out code into the Go module directory +# uses: actions/checkout@v4 +# with: +# lfs: true +# ref: ${{ github.event.pull_request.head.sha }} +# +# - name: Enable Go modules cache +# uses: actions/cache@v4 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: actions/cache@v4 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Download Go modules +# run: go mod download +# +# - name: Install tools +# run: make init +# +# - name: Run linters +# run: | +# bin/golangci-lint run --new --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-on-error=true +# +# +# - name: Check that there are no source code changes +# run: | +# make format +# pushd tools && go mod tidy -v +# popd && go mod tidy -v +# git status +# git diff --exit-code +# +# - name: Check the Makefile references dev version +# run: | +# if ! grep -q "RELEASE_VERSION ?= v0.0.0" Makefile; then +# echo "default RELEASE_VERSION in Makefile should be 0.0.0" +# exit 1 +# fi +# +# - name: Check the quickstart script references dev version +# run: | +# if ! grep -q "perconalab/everest:0.0.0" deploy/quickstart-k8s.yaml; then +# echo "deploy/quickstart-k8s.yaml should reference 0.0.0 version" +# exit 1 +# fi +# +# - name: Run debug commands on failure +# if: ${{ failure() }} +# run: | +# env +# go version +# go env +# pwd +# git status +# +# integration_tests_api: +# strategy: +# fail-fast: false +# matrix: +# go-version: [ 1.23.x ] +# may-fail: [ false ] +# +# name: API Integration Tests +# runs-on: ubuntu-20.04 +# env: +# PERCONA_VERSION_SERVICE_URL: https://check-dev.percona.com/versions/v1 +# steps: +# +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Check out code into the Go module directory +# uses: actions/checkout@v4 +# with: +# lfs: true +# ref: ${{ github.event.pull_request.head.sha }} +# fetch-depth: 0 +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# addons: registry +# insecure-registry: 'localhost:5000' +# +# - name: Expose local registry +# run: | +# kubectl port-forward --namespace kube-system service/registry 5000:80 & +# +# - name: Build Everest API Server +# run: | +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make build-debug +# +# - name: Build Everest docker container +# uses: docker/metadata-action@v5 +# id: meta +# with: +# images: localhost:5000/perconalab/everest +# tags: +# 0.0.0 +# +# - name: Build and Push everest dev image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: ${{ steps.meta.outputs.tags }} +# +# # We need to have Everest CRDs available before running provisioning and everest API Server +# # to have an ability to create monitoring configs and use them during the provisioning as +# # a mock pmm server without running a real PMM. +# - name: Install everest operator without Everest +# run: | +# kubectl create ns everest-system +# kubectl create ns everest-monitoring +# curl https://raw.githubusercontent.com/percona/everest-operator/main/deploy/bundle.yaml -o bundle.yaml +# sed -i "s/namespace: everest-operator-system/namespace: everest-system/g" bundle.yaml +# kubectl -n everest-system apply -f bundle.yaml +# +# # We create a dummy monitoring instance so we can enable monitoring during provisioning +# # without having to install PMM. +# - name: Create a monitoring instance +# run: | +# cat <> $GITHUB_ENV +# +# - name: Add CI user to admin role +# run: | +# kubectl patch configmap everest-rbac -n everest-system --patch "$(kubectl get configmap everest-rbac -n everest-system -o json | jq '.data["policy.csv"] += "\ng, everest_ci, role:admin"' | jq '{data: { "policy.csv": .data["policy.csv"] } }')" +# kubectl get configmap everest-rbac -n everest-system -ojsonpath='{.data.policy\.csv}' +# +# - name: Run integration tests +# run: | +# cd api-tests +# make init +# make test +# +# - name: Run debug commands on failure +# if: ${{ failure() }} +# run: | +# kubectl -n everest-system describe pods +# kubectl -n everest-monitoring describe pods +# kubectl -n everest describe pods +# kubectl -n everest-system logs deploy/percona-everest +# +## commenting bc it's failing to download the image bc of too many requests too often +## - name: Everest - run Trivy vulnerability scanner +## uses: aquasecurity/trivy-action@0.24.0 +## with: +## image-ref: "localhost:5000/perconalab/everest:0.0.0" +## format: 'table' +## severity: 'CRITICAL,HIGH' +# +# +# +# integration_tests_cli: +# name: CLI Integration Tests +# strategy: +# fail-fast: false +# matrix: +# go-version: [ 1.23.x ] +# may-fail: [ false ] +# +# runs-on: ubuntu-20.04 +# env: +# PERCONA_VERSION_SERVICE_URL: https://check-dev.percona.com/versions/v1 +# steps: +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# - name: Check out code into the Go module directory +# uses: actions/checkout@v4 +# with: +# lfs: true +# ref: ${{ github.event.pull_request.head.sha }} +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# - name: Set up Go release for CLI +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Build CLI binary +# run: | +# make init +# make build-cli +# - name: Create KIND cluster +# uses: helm/kind-action@v1.10.0 +# +# - name: Run integration tests +# working-directory: cli-tests +# id: cli-tests +# run: | +# make init +# make install-operators +# kubectl patch sub everest-operator -n everest-system -p ' +# [{ +# "op": "add", +# "path": "/spec/config/env/-", +# "value": { +# "name": "PERCONA_VERSION_SERVICE_URL", +# "value": "https://check-dev.percona.com/versions/v1" +# } +# }]' --type=json +# make test-cli +# - name: Attach the report +# if: ${{ always() && steps.cli-tests.outcome != 'skipped' }} +# uses: actions/upload-artifact@v4 +# with: +# name: cli-tests-report +# path: cli-tests/test-report +# overwrite: true +# +# integration_tests_flows: +# strategy: +# fail-fast: false +# matrix: +# make_target: [ +# 'test-all-operators', +# 'test-mongo-operator', +# 'test-pg-operator', +# 'test-pxc-operator' +# ] +# name: CLI tests +# uses: ./.github/workflows/cli-tests.yml +# secrets: inherit +# with: +# make_target: ${{ matrix.make_target }} +# +# merge-gatekeeper: +# needs: [ test, check, integration_tests_api, integration_tests_flows, integration_tests_cli] +# name: Merge Gatekeeper +# if: ${{ always() }} +# runs-on: ubuntu-22.04 +# steps: +# - name: Run Merge Gatekeeper +# uses: upsidr/merge-gatekeeper@v1.2.1 +# with: +# self: Merge Gatekeeper +# token: ${{ secrets.GITHUB_TOKEN }} +# interval: 45 +# timeout: 300 +# ignored: "license/snyk (Percona Everest), security/snyk (Percona Everest)" +# ref: ${{ github.event.pull_request.head.sha || github.sha }} From bef6465bbceb716cefe131a6b6585dcc2ddf863a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 13:16:49 +0200 Subject: [PATCH 002/179] vs test --- .../workflows/operator-early-adoption.yaml | 58 ++++++++++++++----- 1 file changed, 44 insertions(+), 14 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 3bd642b97..a273925e4 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -36,18 +36,6 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - create release branch - run: | - cd percona-version-service - - - name: Enable Go modules cache uses: percona-platform/cache@v3 with: @@ -65,8 +53,50 @@ jobs: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - name: Download Go modules - run: go mod download + + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + - name: VS - build + run: | + cd percona-version-service + make init + make docker-build + + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: 'localhost:5000' + + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry 5000:80 & + + + - name: Build VS docker container + uses: docker/metadata-action@v5 + id: meta + with: + images: localhost:5000/Percona-Lab/percona-version-service + tags: + dev + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + # - name: Install development tools # run: make init From 8a731382d51c54ba639e154a382e478182126046 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 13:22:21 +0200 Subject: [PATCH 003/179] vs test --- .../workflows/operator-early-adoption.yaml | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a273925e4..690bafa98 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -53,7 +53,18 @@ jobs: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: 'localhost:5000' + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry 5000:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -66,20 +77,6 @@ jobs: run: | cd percona-version-service make init - make docker-build - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - addons: registry - insecure-registry: 'localhost:5000' - - - name: Expose local registry - run: | - kubectl port-forward --namespace kube-system service/registry 5000:80 & - name: Build VS docker container @@ -93,7 +90,7 @@ jobs: - name: Build and Push VS dev image uses: docker/build-push-action@v6 with: - context: . + context: percona-version-service push: true tags: ${{ steps.meta.outputs.tags }} From 021fd37c8632614d16f6ff22f35961050adb9f12 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:37:07 +0200 Subject: [PATCH 004/179] vs test --- .github/workflows/operator-early-adoption.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 690bafa98..0d91f3a10 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -83,7 +83,7 @@ jobs: uses: docker/metadata-action@v5 id: meta with: - images: localhost:5000/Percona-Lab/percona-version-service + images: localhost:5000/perconalab/version-service tags: dev @@ -94,6 +94,12 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} + - name: Apply VS manifest + run: | + cd percona-version-service + kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) + kubectl get deployments percona-version-service -o yaml + # - name: Install development tools # run: make init From eddaaa98b49a1d6a37b451237434328bb7523fd2 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:42:45 +0200 Subject: [PATCH 005/179] vs test --- .../workflows/operator-early-adoption.yaml | 123 +++++++++--------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 0d91f3a10..07be90c18 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -26,45 +26,45 @@ jobs: runs-on: ubuntu-20.04 steps: - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - addons: registry - insecure-registry: 'localhost:5000' - - - name: Expose local registry - run: | - kubectl port-forward --namespace kube-system service/registry 5000:80 & +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# addons: registry +# insecure-registry: 'localhost:5000' +# +# - name: Expose local registry +# run: | +# kubectl port-forward --namespace kube-system service/registry 5000:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -72,32 +72,33 @@ jobs: repository: Percona-Lab/percona-version-service path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} - - - name: VS - build - run: | - cd percona-version-service - make init - - - - name: Build VS docker container - uses: docker/metadata-action@v5 - id: meta - with: - images: localhost:5000/perconalab/version-service - tags: - dev - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: ${{ steps.meta.outputs.tags }} +# +# - name: VS - build +# run: | +# cd percona-version-service +# make init +# +# +# - name: Build VS docker container +# uses: docker/metadata-action@v5 +# id: meta +# with: +# images: localhost:5000/perconalab/version-service +# tags: +# dev +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: ${{ steps.meta.outputs.tags }} - name: Apply VS manifest run: | cd percona-version-service - kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) + kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' ./percona-version-service/deploy.yaml) + cat ./percona-version-service/deploy.yaml kubectl get deployments percona-version-service -o yaml From 14f2951b1df495db1da43178c92404e976d3662c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:44:31 +0200 Subject: [PATCH 006/179] vs test --- .github/workflows/operator-early-adoption.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 07be90c18..b77c7a0f1 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -96,7 +96,6 @@ jobs: - name: Apply VS manifest run: | - cd percona-version-service kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' ./percona-version-service/deploy.yaml) cat ./percona-version-service/deploy.yaml kubectl get deployments percona-version-service -o yaml From ffe536a2ee0c31ad2eb4cc85e3ddb6445d003d0d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:45:38 +0200 Subject: [PATCH 007/179] vs test --- .github/workflows/operator-early-adoption.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index b77c7a0f1..da190d30a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -96,8 +96,9 @@ jobs: - name: Apply VS manifest run: | - kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' ./percona-version-service/deploy.yaml) - cat ./percona-version-service/deploy.yaml +# kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) + sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml + cat percona-version-service/deploy.yaml kubectl get deployments percona-version-service -o yaml From 403ef7e1729918e6796f4e6bad566ee3b0c71e22 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:46:29 +0200 Subject: [PATCH 008/179] vs test --- .github/workflows/operator-early-adoption.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index da190d30a..76a3e9942 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -94,12 +94,14 @@ jobs: # push: true # tags: ${{ steps.meta.outputs.tags }} +# kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) +# kubectl get deployments percona-version-service -o yaml + - name: Apply VS manifest run: | -# kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml cat percona-version-service/deploy.yaml - kubectl get deployments percona-version-service -o yaml + # - name: Install development tools From 0e0d0ff85477753a520d64592a29cc05a111aedc Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:49:25 +0200 Subject: [PATCH 009/179] vs test --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 76a3e9942..c5796f6f8 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -98,8 +98,8 @@ jobs: # kubectl get deployments percona-version-service -o yaml - name: Apply VS manifest - run: | - sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml + run: | + sed 's/perconalab\/version-service:*/perconalab\/version-service:dev/g' percona-version-service/deploy.yaml cat percona-version-service/deploy.yaml From e8c153a37628bd49446e4a979526f06f49cb684a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 16:58:09 +0200 Subject: [PATCH 010/179] vs test --- .../workflows/operator-early-adoption.yaml | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index c5796f6f8..3beb81061 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -26,45 +26,45 @@ jobs: runs-on: ubuntu-20.04 steps: -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# addons: registry -# insecure-registry: 'localhost:5000' -# -# - name: Expose local registry -# run: | -# kubectl port-forward --namespace kube-system service/registry 5000:80 & + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: 'localhost:5000' + + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry 5000:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -72,35 +72,35 @@ jobs: repository: Percona-Lab/percona-version-service path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: VS - build -# run: | -# cd percona-version-service -# make init -# -# -# - name: Build VS docker container -# uses: docker/metadata-action@v5 -# id: meta -# with: -# images: localhost:5000/perconalab/version-service -# tags: -# dev -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# kubectl apply -f <(sed 's/percona\/test:*/percona\/test:dev/g' percona-version-service/deploy.yaml) -# kubectl get deployments percona-version-service -o yaml + - name: VS - build + run: | + cd percona-version-service + make init + + + - name: Build VS docker container + uses: docker/metadata-action@v5 + id: meta + with: + images: localhost:5000/perconalab/version-service + tags: + dev + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: ${{ steps.meta.outputs.tags }} + - name: Apply VS manifest run: | - sed 's/perconalab\/version-service:*/perconalab\/version-service:dev/g' percona-version-service/deploy.yaml + kubectl apply -f <(sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml) cat percona-version-service/deploy.yaml + kubectl get deployments percona-version-service -o yaml + curl http://percona-version-service:80 From b07b1d5b7202e254435b8488b6d1086a027309e7 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 17:15:42 +0200 Subject: [PATCH 011/179] vs test --- .../workflows/operator-early-adoption.yaml | 85 ++++++++++++++++++- 1 file changed, 81 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 3beb81061..946d8a8ee 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -97,12 +97,89 @@ jobs: - name: Apply VS manifest run: | - kubectl apply -f <(sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml) - cat percona-version-service/deploy.yaml - kubectl get deployments percona-version-service -o yaml - curl http://percona-version-service:80 + kubectl create ns everest-system + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + kubectl apply -f deploy.yaml -n everest-system + kubectl wait --for=condition=Ready service/percona-version-service --timeout=300s + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Provision Everest using CLI + shell: bash + run: | + make init + make build-cli + ./bin/everestctl install -v \ + --version 0.0.0 \ + --version-metadata-url http://percona-version-service:80 \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest + +# # We need to have Everest CRDs available before running provisioning and everest API Server +# # to have an ability to create monitoring configs and use them during the provisioning as +# # a mock pmm server without running a real PMM. +# - name: Install everest operator without Everest +# run: | +# kubectl create ns everest-system +# kubectl create ns everest-monitoring +# curl https://raw.githubusercontent.com/percona/everest-operator/main/deploy/bundle.yaml -o bundle.yaml +# sed -i "s/namespace: everest-operator-system/namespace: everest-system/g" bundle.yaml +# kubectl -n everest-system apply -f bundle.yaml +# +# # We create a dummy monitoring instance so we can enable monitoring during provisioning +# # without having to install PMM. +# - name: Create a monitoring instance +# run: | +# cat < Date: Fri, 8 Nov 2024 17:18:59 +0200 Subject: [PATCH 012/179] vs test --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 946d8a8ee..f275af499 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -99,11 +99,11 @@ jobs: run: | kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml - kubectl apply -f deploy.yaml -n everest-system + kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=condition=Ready service/percona-version-service --timeout=300s - - name: Everest - check out + - name: Everest - check out uses: actions/checkout@v4 with: token: ${{ secrets.ROBOT_TOKEN }} From ba8b7042a764660531e506775ef5121952c23f15 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 17:27:44 +0200 Subject: [PATCH 013/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index f275af499..2f36ed4bb 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -100,7 +100,7 @@ jobs: kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=condition=Ready service/percona-version-service --timeout=300s + kubectl wait --for=condition=Ready service/percona-version-service -n everest-system --timeout=300s - name: Everest - check out From 801e58b4c1fbe1f7274346b53b428528624d1b40 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 17:39:14 +0200 Subject: [PATCH 014/179] vs test --- .github/workflows/operator-early-adoption.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 2f36ed4bb..adc15ad7e 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -95,13 +95,13 @@ jobs: tags: ${{ steps.meta.outputs.tags }} - - name: Apply VS manifest + - name: Apply VS manifest # kubectl wait --for=condition=Ready service/percona-version-service -n everest-system --timeout=300s run: | kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=condition=Ready service/percona-version-service -n everest-system --timeout=300s - + + - name: Everest - check out uses: actions/checkout@v4 From e0e64fa831b93536ad23c63214e55c5e348aeae3 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 17:50:48 +0200 Subject: [PATCH 015/179] vs test --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index adc15ad7e..8a1623652 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -100,7 +100,7 @@ jobs: kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - + kubectl port-forward svc/percona-version-service 8081:80 -n everest-system - name: Everest - check out @@ -120,7 +120,7 @@ jobs: make build-cli ./bin/everestctl install -v \ --version 0.0.0 \ - --version-metadata-url http://percona-version-service:80 \ + --version-metadata-url http://percona-version-service:8081 \ --operator.mongodb \ --operator.postgresql \ --operator.xtradb-cluster \ From 5ffaa73b48df3393b4404575202fd1c1254272b7 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 17:56:40 +0200 Subject: [PATCH 016/179] vs test --- .../workflows/operator-early-adoption.yaml | 483 +----------------- 1 file changed, 2 insertions(+), 481 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8a1623652..2ff900f7a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -95,11 +95,12 @@ jobs: tags: ${{ steps.meta.outputs.tags }} - - name: Apply VS manifest # kubectl wait --for=condition=Ready service/percona-version-service -n everest-system --timeout=300s + - name: Apply VS manifest run: | kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl wait --for=condition=Ready pod/percona-version-service -n everest-system --timeout=300s kubectl port-forward svc/percona-version-service 8081:80 -n everest-system @@ -126,483 +127,3 @@ jobs: --operator.xtradb-cluster \ --skip-wizard \ --namespaces everest - -# # We need to have Everest CRDs available before running provisioning and everest API Server -# # to have an ability to create monitoring configs and use them during the provisioning as -# # a mock pmm server without running a real PMM. -# - name: Install everest operator without Everest -# run: | -# kubectl create ns everest-system -# kubectl create ns everest-monitoring -# curl https://raw.githubusercontent.com/percona/everest-operator/main/deploy/bundle.yaml -o bundle.yaml -# sed -i "s/namespace: everest-operator-system/namespace: everest-system/g" bundle.yaml -# kubectl -n everest-system apply -f bundle.yaml -# -# # We create a dummy monitoring instance so we can enable monitoring during provisioning -# # without having to install PMM. -# - name: Create a monitoring instance -# run: | -# cat <> $GITHUB_ENV -# echo "$HOME/gotip/bin" >> $GITHUB_PATH -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Check out code into the Go module directory -# uses: actions/checkout@v4 -# with: -# lfs: true -# ref: ${{ github.event.pull_request.head.sha }} -# -# - name: Enable Go modules cache -# uses: actions/cache@v4 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: actions/cache@v4 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Download Go modules -# run: go mod download -# -# - name: Install tools -# run: make init -# -# - name: Run linters -# run: | -# bin/golangci-lint run --new --out-format=line-number | env REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }} bin/reviewdog -f=golangci-lint -reporter=github-pr-review -filter-mode=nofilter -fail-on-error=true -# -# -# - name: Check that there are no source code changes -# run: | -# make format -# pushd tools && go mod tidy -v -# popd && go mod tidy -v -# git status -# git diff --exit-code -# -# - name: Check the Makefile references dev version -# run: | -# if ! grep -q "RELEASE_VERSION ?= v0.0.0" Makefile; then -# echo "default RELEASE_VERSION in Makefile should be 0.0.0" -# exit 1 -# fi -# -# - name: Check the quickstart script references dev version -# run: | -# if ! grep -q "perconalab/everest:0.0.0" deploy/quickstart-k8s.yaml; then -# echo "deploy/quickstart-k8s.yaml should reference 0.0.0 version" -# exit 1 -# fi -# -# - name: Run debug commands on failure -# if: ${{ failure() }} -# run: | -# env -# go version -# go env -# pwd -# git status -# -# integration_tests_api: -# strategy: -# fail-fast: false -# matrix: -# go-version: [ 1.23.x ] -# may-fail: [ false ] -# -# name: API Integration Tests -# runs-on: ubuntu-20.04 -# env: -# PERCONA_VERSION_SERVICE_URL: https://check-dev.percona.com/versions/v1 -# steps: -# -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Check out code into the Go module directory -# uses: actions/checkout@v4 -# with: -# lfs: true -# ref: ${{ github.event.pull_request.head.sha }} -# fetch-depth: 0 -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# addons: registry -# insecure-registry: 'localhost:5000' -# -# - name: Expose local registry -# run: | -# kubectl port-forward --namespace kube-system service/registry 5000:80 & -# -# - name: Build Everest API Server -# run: | -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make build-debug -# -# - name: Build Everest docker container -# uses: docker/metadata-action@v5 -# id: meta -# with: -# images: localhost:5000/perconalab/everest -# tags: -# 0.0.0 -# -# - name: Build and Push everest dev image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: ${{ steps.meta.outputs.tags }} -# -# # We need to have Everest CRDs available before running provisioning and everest API Server -# # to have an ability to create monitoring configs and use them during the provisioning as -# # a mock pmm server without running a real PMM. -# - name: Install everest operator without Everest -# run: | -# kubectl create ns everest-system -# kubectl create ns everest-monitoring -# curl https://raw.githubusercontent.com/percona/everest-operator/main/deploy/bundle.yaml -o bundle.yaml -# sed -i "s/namespace: everest-operator-system/namespace: everest-system/g" bundle.yaml -# kubectl -n everest-system apply -f bundle.yaml -# -# # We create a dummy monitoring instance so we can enable monitoring during provisioning -# # without having to install PMM. -# - name: Create a monitoring instance -# run: | -# cat <> $GITHUB_ENV -# -# - name: Add CI user to admin role -# run: | -# kubectl patch configmap everest-rbac -n everest-system --patch "$(kubectl get configmap everest-rbac -n everest-system -o json | jq '.data["policy.csv"] += "\ng, everest_ci, role:admin"' | jq '{data: { "policy.csv": .data["policy.csv"] } }')" -# kubectl get configmap everest-rbac -n everest-system -ojsonpath='{.data.policy\.csv}' -# -# - name: Run integration tests -# run: | -# cd api-tests -# make init -# make test -# -# - name: Run debug commands on failure -# if: ${{ failure() }} -# run: | -# kubectl -n everest-system describe pods -# kubectl -n everest-monitoring describe pods -# kubectl -n everest describe pods -# kubectl -n everest-system logs deploy/percona-everest -# -## commenting bc it's failing to download the image bc of too many requests too often -## - name: Everest - run Trivy vulnerability scanner -## uses: aquasecurity/trivy-action@0.24.0 -## with: -## image-ref: "localhost:5000/perconalab/everest:0.0.0" -## format: 'table' -## severity: 'CRITICAL,HIGH' -# -# -# -# integration_tests_cli: -# name: CLI Integration Tests -# strategy: -# fail-fast: false -# matrix: -# go-version: [ 1.23.x ] -# may-fail: [ false ] -# -# runs-on: ubuntu-20.04 -# env: -# PERCONA_VERSION_SERVICE_URL: https://check-dev.percona.com/versions/v1 -# steps: -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# - name: Check out code into the Go module directory -# uses: actions/checkout@v4 -# with: -# lfs: true -# ref: ${{ github.event.pull_request.head.sha }} -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# - name: Set up Go release for CLI -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Build CLI binary -# run: | -# make init -# make build-cli -# - name: Create KIND cluster -# uses: helm/kind-action@v1.10.0 -# -# - name: Run integration tests -# working-directory: cli-tests -# id: cli-tests -# run: | -# make init -# make install-operators -# kubectl patch sub everest-operator -n everest-system -p ' -# [{ -# "op": "add", -# "path": "/spec/config/env/-", -# "value": { -# "name": "PERCONA_VERSION_SERVICE_URL", -# "value": "https://check-dev.percona.com/versions/v1" -# } -# }]' --type=json -# make test-cli -# - name: Attach the report -# if: ${{ always() && steps.cli-tests.outcome != 'skipped' }} -# uses: actions/upload-artifact@v4 -# with: -# name: cli-tests-report -# path: cli-tests/test-report -# overwrite: true -# -# integration_tests_flows: -# strategy: -# fail-fast: false -# matrix: -# make_target: [ -# 'test-all-operators', -# 'test-mongo-operator', -# 'test-pg-operator', -# 'test-pxc-operator' -# ] -# name: CLI tests -# uses: ./.github/workflows/cli-tests.yml -# secrets: inherit -# with: -# make_target: ${{ matrix.make_target }} -# -# merge-gatekeeper: -# needs: [ test, check, integration_tests_api, integration_tests_flows, integration_tests_cli] -# name: Merge Gatekeeper -# if: ${{ always() }} -# runs-on: ubuntu-22.04 -# steps: -# - name: Run Merge Gatekeeper -# uses: upsidr/merge-gatekeeper@v1.2.1 -# with: -# self: Merge Gatekeeper -# token: ${{ secrets.GITHUB_TOKEN }} -# interval: 45 -# timeout: 300 -# ignored: "license/snyk (Percona Everest), security/snyk (Percona Everest)" -# ref: ${{ github.event.pull_request.head.sha || github.sha }} From 011c2782d826a7dafdc9a327a03498938901b482 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 18:20:35 +0200 Subject: [PATCH 017/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 2ff900f7a..1c7690c84 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -100,7 +100,7 @@ jobs: kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=condition=Ready pod/percona-version-service -n everest-system --timeout=300s + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service 8081:80 -n everest-system From b770588bc63472a58c80d0678d80bfbfdd459143 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 18:27:56 +0200 Subject: [PATCH 018/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 1c7690c84..1218bae92 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -98,7 +98,7 @@ jobs: - name: Apply VS manifest run: | kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service 8081:80 -n everest-system From af946346209a66f62f08a2b3cab8d2d1eb59a3ff Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 18:34:12 +0200 Subject: [PATCH 019/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 1218bae92..c441ab1d6 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -101,7 +101,7 @@ jobs: sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service 8081:80 -n everest-system + kubectl port-forward svc/percona-version-service 8081:80 -n everest-system & - name: Everest - check out From 50a33e9e44184b3356706ea1f74f3db620444de0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 18:40:06 +0200 Subject: [PATCH 020/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index c441ab1d6..dab22cb4c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -121,7 +121,7 @@ jobs: make build-cli ./bin/everestctl install -v \ --version 0.0.0 \ - --version-metadata-url http://percona-version-service:8081 \ + --version-metadata-url localhost:8081 \ --operator.mongodb \ --operator.postgresql \ --operator.xtradb-cluster \ From 791040fd963034a5ef1928aed9a6f9ed6553c53a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 8 Nov 2024 18:45:01 +0200 Subject: [PATCH 021/179] vs test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index dab22cb4c..37bcabfff 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -121,7 +121,7 @@ jobs: make build-cli ./bin/everestctl install -v \ --version 0.0.0 \ - --version-metadata-url localhost:8081 \ + --version-metadata-url http://localhost:8081 \ --operator.mongodb \ --operator.postgresql \ --operator.xtradb-cluster \ From 65f3f05d080cd810168bd0317c0a7451ec805e1f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 11:13:15 +0200 Subject: [PATCH 022/179] vs with new version --- .github/workflows/operator-early-adoption.yaml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 37bcabfff..03de31bd7 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -25,6 +25,12 @@ jobs: continue-on-error: ${{ matrix.may-fail }} runs-on: ubuntu-20.04 + env: + # VERSION ridiculously higher than any potentially existing + VERSION: 0.10000.0 + CLI_PREREQUISITES: ">= 1.2.0" + K8S_PREREQUISITES: ">= 1.27" + steps: - name: Set up Go release uses: percona-platform/setup-go@v4 @@ -73,11 +79,14 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} - - name: VS - build + - name: VS - update run: | cd percona-version-service make init - + # create an entry for the new Everest version + echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + - name: Build VS docker container uses: docker/metadata-action@v5 From e44a95b09143c1d1af54581570aa9d527d60b73b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 12:06:26 +0200 Subject: [PATCH 023/179] increase timeout --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 03de31bd7..2dbe58199 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -109,7 +109,7 @@ jobs: kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system --timeout=180s kubectl port-forward svc/percona-version-service 8081:80 -n everest-system & From be85a1e5c134c27543ff7dbcb094ea8765cfc8d5 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 14:58:36 +0200 Subject: [PATCH 024/179] vs --- .github/workflows/operator-early-adoption.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 2dbe58199..f9e13b7b1 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -109,7 +109,8 @@ jobs: kubectl create ns everest-system sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system --timeout=180s + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system --timeout=30s + kubectl get deployment/percona-version-service -n everest-system -o yaml kubectl port-forward svc/percona-version-service 8081:80 -n everest-system & From 11b69409bfc897dd5ed55ef657089cb3d8a806d9 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 15:06:42 +0200 Subject: [PATCH 025/179] vs --- .github/workflows/operator-early-adoption.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index f9e13b7b1..e8bfcddec 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -110,9 +110,13 @@ jobs: sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system --timeout=30s - kubectl get deployment/percona-version-service -n everest-system -o yaml + kubectl port-forward svc/percona-version-service 8081:80 -n everest-system & - + + - name: Debug on failure + if: always() + run: | + kubectl get deployment/percona-version-service -n everest-system -o yaml - name: Everest - check out uses: actions/checkout@v4 From a29efe479fb4738ff03992deb3ce8a8ff704a0d9 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 15:11:57 +0200 Subject: [PATCH 026/179] vs --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index e8bfcddec..3e5c73738 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -84,7 +84,7 @@ jobs: cd percona-version-service make init # create an entry for the new Everest version - echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + # echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" From db1793cad88dfcb93d06644de60d3194f1c30114 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 15:18:02 +0200 Subject: [PATCH 027/179] vs --- .github/workflows/operator-early-adoption.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 3e5c73738..410871781 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -84,7 +84,9 @@ jobs: cd percona-version-service make init # create an entry for the new Everest version - # echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + touch "sources/metadata/everest/$VERSION.yaml" + echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + git status From 6ae99de8766f1d5204032c91af7584fed77c7571 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 15:24:47 +0200 Subject: [PATCH 028/179] vs --- .github/workflows/operator-early-adoption.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 410871781..29d9c4390 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -84,9 +84,8 @@ jobs: cd percona-version-service make init # create an entry for the new Everest version - touch "sources/metadata/everest/$VERSION.yaml" echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - git status + cat sources/metadata/everest/$VERSION.yaml From 57535fe3277fe50d8c68aa6065b2546b2d7c0c70 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 15:34:53 +0200 Subject: [PATCH 029/179] vs --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 29d9c4390..69f7f8a1f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -84,7 +84,7 @@ jobs: cd percona-version-service make init # create an entry for the new Everest version - echo "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" cat sources/metadata/everest/$VERSION.yaml From 5264cce914e911abd44049fc5c7577caed108daf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:15:24 +0200 Subject: [PATCH 030/179] catalog --- .../workflows/operator-early-adoption.yaml | 134 ++++++++++++++++-- 1 file changed, 121 insertions(+), 13 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 69f7f8a1f..8b4cb858a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -30,8 +30,21 @@ jobs: VERSION: 0.10000.0 CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" + VS_PORT: 8081 + VS_URL: "" + LOCAL_REGISTRY_PORT: 5000 + LOCAL_REGISTRY: "" + ARCH: "" + OS: "" steps: + - name: Set environment variables + run: | + echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV + echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV + echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV + echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV + - name: Set up Go release uses: percona-platform/setup-go@v4 with: @@ -66,11 +79,11 @@ jobs: cpus: 2 memory: 2000m addons: registry - insecure-registry: 'localhost:5000' + insecure-registry: $LOCAL_REGISTRY - name: Expose local registry run: | - kubectl port-forward --namespace kube-system service/registry 5000:80 & + kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -85,7 +98,6 @@ jobs: make init # create an entry for the new Everest version printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - cat sources/metadata/everest/$VERSION.yaml @@ -93,7 +105,7 @@ jobs: uses: docker/metadata-action@v5 id: meta with: - images: localhost:5000/perconalab/version-service + images: $LOCAL_REGISTRY/perconalab/version-service tags: dev @@ -108,16 +120,53 @@ jobs: - name: Apply VS manifest run: | kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system --timeout=30s - - kubectl port-forward svc/percona-version-service 8081:80 -n everest-system & + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} - - name: Debug on failure - if: always() + - name: Catalog - update veneer file run: | - kubectl get deployment/percona-version-service -n everest-system -o yaml + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if veneer has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + - name: Catalog - docker meta + uses: docker/metadata-action@v5 + id: meta + with: + images: $LOCAL_REGISTRY/perconalab/everest-catalog + tags: + type=raw,value=${{ env.VERSION }} + + - name: Catalog - Build and Push image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.meta.outputs.tags }} + + - name: Everest - check out uses: actions/checkout@v4 @@ -129,14 +178,73 @@ jobs: with: go-version-file: "./go.mod" + + - name: Everest - update sources + run: | + # Update deploy manifest + sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + + # Change version in Makefile + sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile + + # Change release manifest link: use local url + sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go + + # Change release catalog image link: use LOCAL_REGISTRY + sed -i '' "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go + + git status + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - setup docker build metadata + uses: docker/metadata-action@v5 + id: everest_meta + with: + images: | + $LOCAL_REGISTRY/perconalab/everest + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.everest_meta.outputs.tags }} + - name: Provision Everest using CLI shell: bash run: | make init make build-cli ./bin/everestctl install -v \ - --version 0.0.0 \ - --version-metadata-url http://localhost:8081 \ + --version $VERSION \ + --version-metadata-url $VS_URL \ --operator.mongodb \ --operator.postgresql \ --operator.xtradb-cluster \ From 883e252264245ebf8ea8e3f5599b4ac880662b7b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:16:37 +0200 Subject: [PATCH 031/179] catalog --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8b4cb858a..d4a809131 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -153,7 +153,7 @@ jobs: - name: Catalog - docker meta uses: docker/metadata-action@v5 - id: meta + id: catalog-meta with: images: $LOCAL_REGISTRY/perconalab/everest-catalog tags: @@ -164,7 +164,7 @@ jobs: with: context: everest-catalog push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.catalog-meta.outputs.tags }} From 4b984efd3155b1624a046c337e876eed81ae111b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:21:28 +0200 Subject: [PATCH 032/179] catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index d4a809131..037ea0e5a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -79,7 +79,7 @@ jobs: cpus: 2 memory: 2000m addons: registry - insecure-registry: $LOCAL_REGISTRY + insecure-registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | From 3db4c2b51ed9961e6607462b54cf38d481b579b1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:25:34 +0200 Subject: [PATCH 033/179] catalog --- .github/workflows/operator-early-adoption.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 037ea0e5a..ad815feb6 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -103,9 +103,9 @@ jobs: - name: Build VS docker container uses: docker/metadata-action@v5 - id: meta + id: vs-meta with: - images: $LOCAL_REGISTRY/perconalab/version-service + images: {{ env.$LOCAL_REGISTRY }}/perconalab/version-service tags: dev @@ -114,7 +114,7 @@ jobs: with: context: percona-version-service push: true - tags: ${{ steps.meta.outputs.tags }} + tags: ${{ steps.vs-meta.outputs.tags }} - name: Apply VS manifest From 4b8cf6de31623b98d4cf612b4ea8bd1888f6ad6e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:26:50 +0200 Subject: [PATCH 034/179] catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index ad815feb6..af29adc03 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -226,7 +226,7 @@ jobs: id: everest_meta with: images: | - $LOCAL_REGISTRY/perconalab/everest + {{ env.$LOCAL_REGISTRY }}/perconalab/everest tags: | type=raw,value=${{ env.VERSION }} From 0a01dc6fd24f218fdd39364dfb69bd1170203721 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:31:12 +0200 Subject: [PATCH 035/179] catalog --- .github/workflows/operator-early-adoption.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index af29adc03..17e9846bb 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -99,22 +99,13 @@ jobs: # create an entry for the new Everest version printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build VS docker container - uses: docker/metadata-action@v5 - id: vs-meta - with: - images: {{ env.$LOCAL_REGISTRY }}/perconalab/version-service - tags: - dev - name: Build and Push VS dev image uses: docker/build-push-action@v6 with: context: percona-version-service push: true - tags: ${{ steps.vs-meta.outputs.tags }} + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev - name: Apply VS manifest From aa5929bf2b77ed210c8673331975f5ccd3e833a9 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 15 Nov 2024 17:46:50 +0200 Subject: [PATCH 036/179] catalog --- .github/workflows/operator-early-adoption.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 17e9846bb..da7090cd8 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -132,6 +132,9 @@ jobs: --new-version ${{ env.VERSION }} cd .. + # replace docker.io to local registry + sed -i "s/docker.io/$LOCAL_REGISTRY/g" veneer/everest-operator.yaml + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml @@ -183,7 +186,7 @@ jobs: sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go # Change release catalog image link: use LOCAL_REGISTRY - sed -i '' "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go + sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go git status - name: Everest UI - setup pnpm From 1906fa476b2cddeb1e3570de429dc343fecb72a5 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 10:20:03 +0200 Subject: [PATCH 037/179] build operator --- .../workflows/operator-early-adoption.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index da7090cd8..96b17e376 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -116,6 +116,76 @@ jobs: kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - create release branch + run: | + cd everest-operator + + # update version in the Makefile + sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: {{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + {{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + - name: Catalog - checkout uses: actions/checkout@v4 with: From 5f7aa2fd0d1ea2ce7eedb0557197be6202d9d447 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 10:21:19 +0200 Subject: [PATCH 038/179] build operator --- .github/workflows/operator-early-adoption.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 96b17e376..95354642f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -158,7 +158,8 @@ jobs: id: operator_meta uses: docker/metadata-action@v5 with: - images: {{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator tags: | type=raw,value=${{ env.VERSION }} @@ -167,7 +168,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - {{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle tags: | type=raw,value=${{ env.VERSION }} From 67cea3781b7b6118f31d680facd3e959e6be728e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 11:15:52 +0200 Subject: [PATCH 039/179] tools path --- .github/workflows/operator-early-adoption.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 95354642f..9c3438550 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -36,6 +36,7 @@ jobs: LOCAL_REGISTRY: "" ARCH: "" OS: "" + TOOLS_PATH: "/opt/tools/bin" steps: - name: Set environment variables @@ -190,6 +191,7 @@ jobs: - name: Catalog - checkout uses: actions/checkout@v4 with: + ref: EVEREST-1563-variable-registry # !!! remove this line once merged repository: percona/everest-catalog path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} @@ -201,10 +203,7 @@ jobs: --veneer-file ../veneer/everest-operator.yaml \ --channel fast-v0 \ --new-version ${{ env.VERSION }} - - cd .. - # replace docker.io to local registry - sed -i "s/docker.io/$LOCAL_REGISTRY/g" veneer/everest-operator.yaml + --registry ${{ env.LOCAL_REGISTRY }} curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm From 5bf94660402d45332eb23d97f62021deb4a83b24 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 11:26:59 +0200 Subject: [PATCH 040/179] fix catalog update --- .github/workflows/operator-early-adoption.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 9c3438550..1ebc54bc5 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -124,7 +124,7 @@ jobs: path: everest-operator token: ${{ secrets.ROBOT_TOKEN }} - - name: Operator - create release branch + - name: Operator - update version run: | cd everest-operator @@ -202,7 +202,7 @@ jobs: go run . \ --veneer-file ../veneer/everest-operator.yaml \ --channel fast-v0 \ - --new-version ${{ env.VERSION }} + --new-version ${{ env.VERSION }} \ --registry ${{ env.LOCAL_REGISTRY }} curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm @@ -252,7 +252,7 @@ jobs: # Change version in Makefile sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - # Change release manifest link: use local url + # Change release manifest link: use local path to file sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go # Change release catalog image link: use LOCAL_REGISTRY From 74b8f9ec3d381b1d2f6a413d535ecc60286efbec Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 11:48:04 +0200 Subject: [PATCH 041/179] fix catalog update --- .github/workflows/operator-early-adoption.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 1ebc54bc5..e18f538c8 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -201,10 +201,11 @@ jobs: cd everest-catalog/tools go run . \ --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ + --channel stable-v0 \ --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} + --registry ${{ env.LOCAL_REGISTRY }} \ + cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml From 1dba76c104620eb9b3723863d4b23181eed5095e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 12:09:36 +0200 Subject: [PATCH 042/179] upd registry --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index e18f538c8..0e6a51232 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -80,7 +80,7 @@ jobs: cpus: 2 memory: 2000m addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} + registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | From 7e707bf2d035ab18589d267c3a92272a0a6decc3 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 12:38:21 +0200 Subject: [PATCH 043/179] self-registry --- .github/registry.yaml | 59 +++++++++++++++++++ .../workflows/operator-early-adoption.yaml | 22 +++++-- 2 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 .github/registry.yaml diff --git a/.github/registry.yaml b/.github/registry.yaml new file mode 100644 index 000000000..dafab817b --- /dev/null +++ b/.github/registry.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: registry +spec: + replicas: 1 + selector: + matchLabels: + app: registry + template: + metadata: + labels: + app: registry + spec: + containers: + - name: registry + image: registry:2 + ports: + - containerPort: 5000 + volumeMounts: + - name: registry-certs + mountPath: /certs + volumes: + - name: registry-certs + emptyDir: {} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: selfsigned-issuer +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: letsencrypt-staging +spec: + acme: + server: https://acme-staging-v02.api.letsencrypt.org/directory + email: oksana.grishchenko@percona.com + privateKeySecretRef: + name: letsencrypt-staging-private-key + solvers: + - http01: + ingress: + class: nginx # or your ingress controller's class +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: registry-cert +spec: + dnsNames: + - localhost # Or a different DNS name if you're using an Ingress + issuerRef: + name: selfsigned-issuer # Or letsencrypt-staging + kind: Issuer + secretName: registry-certs #Must match the volumeMount name in the deployment diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 0e6a51232..e4e97c550 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -1,5 +1,5 @@ --- -name: API CI +name: Custom build on: push: branches: @@ -43,7 +43,7 @@ jobs: run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV - echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV + echo "LOCAL_REGISTRY=https://localhost:$LOCAL_REGISTRY_PORT/v2" >> $GITHUB_ENV echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV - name: Set up Go release @@ -79,13 +79,27 @@ jobs: with: cpus: 2 memory: 2000m - addons: registry - registry: ${{ env.LOCAL_REGISTRY }} + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + + + - name: Deploy registry + run: | + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml + # install the tool to check the availability + go install github.com/cert-manager/cmctl/v2@latest + #check availability + cmctl check api --wait=2m + kubectl apply -f ./.github/registry.yaml --namespace kube-system - name: Expose local registry run: | kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + - name: VS - checkout uses: actions/checkout@v4 with: From 6eb194c67a804701badebae18c8504940b02c8cb Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 18 Nov 2024 17:41:47 +0200 Subject: [PATCH 044/179] Revert "self-registry" This reverts commit 7e707bf2d035ab18589d267c3a92272a0a6decc3. --- .github/registry.yaml | 59 ------------------- .../workflows/operator-early-adoption.yaml | 22 ++----- 2 files changed, 4 insertions(+), 77 deletions(-) delete mode 100644 .github/registry.yaml diff --git a/.github/registry.yaml b/.github/registry.yaml deleted file mode 100644 index dafab817b..000000000 --- a/.github/registry.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: registry -spec: - replicas: 1 - selector: - matchLabels: - app: registry - template: - metadata: - labels: - app: registry - spec: - containers: - - name: registry - image: registry:2 - ports: - - containerPort: 5000 - volumeMounts: - - name: registry-certs - mountPath: /certs - volumes: - - name: registry-certs - emptyDir: {} ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: selfsigned-issuer -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: letsencrypt-staging -spec: - acme: - server: https://acme-staging-v02.api.letsencrypt.org/directory - email: oksana.grishchenko@percona.com - privateKeySecretRef: - name: letsencrypt-staging-private-key - solvers: - - http01: - ingress: - class: nginx # or your ingress controller's class ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: registry-cert -spec: - dnsNames: - - localhost # Or a different DNS name if you're using an Ingress - issuerRef: - name: selfsigned-issuer # Or letsencrypt-staging - kind: Issuer - secretName: registry-certs #Must match the volumeMount name in the deployment diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index e4e97c550..0e6a51232 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -1,5 +1,5 @@ --- -name: Custom build +name: API CI on: push: branches: @@ -43,7 +43,7 @@ jobs: run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV - echo "LOCAL_REGISTRY=https://localhost:$LOCAL_REGISTRY_PORT/v2" >> $GITHUB_ENV + echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV - name: Set up Go release @@ -79,27 +79,13 @@ jobs: with: cpus: 2 memory: 2000m - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - - - - name: Deploy registry - run: | - kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml - # install the tool to check the availability - go install github.com/cert-manager/cmctl/v2@latest - #check availability - cmctl check api --wait=2m - kubectl apply -f ./.github/registry.yaml --namespace kube-system + addons: registry + registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - - name: VS - checkout uses: actions/checkout@v4 with: From 3329da2b4edbe5e570cce2a4063a13482ae6d604 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 11:03:05 +0200 Subject: [PATCH 045/179] test --- .github/workflows/operator-early-adoption.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 0e6a51232..5d59a867a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -128,8 +128,9 @@ jobs: run: | cd everest-operator - # update version in the Makefile - sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile + # !!!! (delete this) update version in the Makefile + # sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile + # sed -i "s/docker.io\/perconalab/$LOCAL_REGISTRY\/perconalab/g" Makefile - name: Operator - install operator-sdk run: | @@ -208,7 +209,7 @@ jobs: cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm - /tmp/opm alpha render-template basic -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + /tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml # Check if veneer has the new version listed if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then From edb976e09b0e92aed37428f093a35e51f20c0adf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 11:09:07 +0200 Subject: [PATCH 046/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5d59a867a..655412f8a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -80,7 +80,7 @@ jobs: cpus: 2 memory: 2000m addons: registry - registry: ${{ env.LOCAL_REGISTRY }} + insecure-registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | From 86f129b8de6ffaf44457d71bcba5c4271d57ee4f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 11:13:37 +0200 Subject: [PATCH 047/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 655412f8a..30f8f6729 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -209,7 +209,7 @@ jobs: cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml # Check if veneer has the new version listed if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then From cd8496e079e2262a148bd6202c4fb928d4f9c61d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 11:25:30 +0200 Subject: [PATCH 048/179] test --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 30f8f6729..6d9862d13 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -27,7 +27,7 @@ jobs: env: # VERSION ridiculously higher than any potentially existing - VERSION: 0.10000.0 + VERSION: 1.10000.0 CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 @@ -202,7 +202,7 @@ jobs: cd everest-catalog/tools go run . \ --veneer-file ../veneer/everest-operator.yaml \ - --channel stable-v0 \ + --channel fast-v0 \ --new-version ${{ env.VERSION }} \ --registry ${{ env.LOCAL_REGISTRY }} \ From fc1e8104abd3101feae1f9813e1214c3a6306598 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:04:28 +0200 Subject: [PATCH 049/179] test --- .github/workflows/operator-early-adoption.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 6d9862d13..5d1adf4ed 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -205,6 +205,7 @@ jobs: --channel fast-v0 \ --new-version ${{ env.VERSION }} \ --registry ${{ env.LOCAL_REGISTRY }} \ + --test-repo \ cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm From f4658355f862a9e1d7f998e24275d38b270d53ba Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:14:28 +0200 Subject: [PATCH 050/179] test --- .github/workflows/operator-early-adoption.yaml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5d1adf4ed..6bd0369b4 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -124,14 +124,6 @@ jobs: path: everest-operator token: ${{ secrets.ROBOT_TOKEN }} - - name: Operator - update version - run: | - cd everest-operator - - # !!!! (delete this) update version in the Makefile - # sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile - # sed -i "s/docker.io\/perconalab/$LOCAL_REGISTRY\/perconalab/g" Makefile - - name: Operator - install operator-sdk run: | mkdir -p $TOOLS_PATH @@ -222,7 +214,7 @@ jobs: uses: docker/metadata-action@v5 id: catalog-meta with: - images: $LOCAL_REGISTRY/perconalab/everest-catalog + images: ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog tags: type=raw,value=${{ env.VERSION }} From 16d06911c271378eb9b6777432482899c5d5cbdf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:23:54 +0200 Subject: [PATCH 051/179] build catalog --- .github/workflows/operator-early-adoption.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 6bd0369b4..ef662dfb2 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -224,6 +224,7 @@ jobs: context: everest-catalog push: true tags: ${{ steps.catalog-meta.outputs.tags }} + file: everest-catalog.Dockerfile From 59da37d770d494600e7859f97ce343d50d708d83 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:36:00 +0200 Subject: [PATCH 052/179] push catalog --- .github/workflows/operator-early-adoption.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index ef662dfb2..eb9cd600c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -210,24 +210,15 @@ jobs: exit 1 fi - - name: Catalog - docker meta - uses: docker/metadata-action@v5 - id: catalog-meta - with: - images: ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog - tags: - type=raw,value=${{ env.VERSION }} - - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: context: everest-catalog push: true - tags: ${{ steps.catalog-meta.outputs.tags }} + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} file: everest-catalog.Dockerfile - - name: Everest - check out uses: actions/checkout@v4 with: From 218760121746127ea6c752f7e61b55efa378de82 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:50:52 +0200 Subject: [PATCH 053/179] test --- .../workflows/operator-early-adoption.yaml | 314 +++++++++--------- 1 file changed, 157 insertions(+), 157 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index eb9cd600c..b93d77d27 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -46,141 +46,141 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} - - - name: Expose local registry - run: | - kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev - - - - name: Apply VS manifest - run: | - kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# addons: registry +# insecure-registry: ${{ env.LOCAL_REGISTRY }} +# +# - name: Expose local registry +# run: | +# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & +# +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev +# +# +# - name: Apply VS manifest +# run: | +# kubectl create ns everest-system +# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml -n everest-system +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system +# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# - name: Catalog - checkout uses: actions/checkout@v4 with: @@ -188,32 +188,32 @@ jobs: repository: percona/everest-catalog path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} \ - --test-repo \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if veneer has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# --registry ${{ env.LOCAL_REGISTRY }} \ +# --test-repo \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if veneer has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: - context: everest-catalog + context: . push: true tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} file: everest-catalog.Dockerfile From f2296b331fabfb09fb0e2b5cd9696e7fae2665af Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:52:27 +0200 Subject: [PATCH 054/179] test --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index b93d77d27..acc6261d4 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -213,9 +213,9 @@ jobs: - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: - context: . + context: everest-catalog push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} + tags: perconalab/everest-catalog:0.0.0 file: everest-catalog.Dockerfile From efdab721875b431dab48ad47b5c557396f2f8125 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:53:40 +0200 Subject: [PATCH 055/179] test --- .github/workflows/operator-early-adoption.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index acc6261d4..2c8bec475 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -210,12 +210,17 @@ jobs: # exit 1 # fi + - name: Catalog - Build and Push image + run: | + cd everest-catalog + cat everest-catalog.Dockerfile + - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: context: everest-catalog push: true - tags: perconalab/everest-catalog:0.0.0 + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} file: everest-catalog.Dockerfile From 2d5c9cbe72688420b250e6eed220771ad5d14eae Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 12:55:54 +0200 Subject: [PATCH 056/179] push catalog --- .../workflows/operator-early-adoption.yaml | 315 +++++++++--------- 1 file changed, 155 insertions(+), 160 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 2c8bec475..92b14ff44 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -46,141 +46,141 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# addons: registry -# insecure-registry: ${{ env.LOCAL_REGISTRY }} -# -# - name: Expose local registry -# run: | -# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & -# -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev -# -# -# - name: Apply VS manifest -# run: | -# kubectl create ns everest-system -# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -n everest-system -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system -# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: ${{ env.LOCAL_REGISTRY }} + + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev + + + - name: Apply VS manifest + run: | + kubectl create ns everest-system + sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + - name: Catalog - checkout uses: actions/checkout@v4 with: @@ -188,32 +188,27 @@ jobs: repository: percona/everest-catalog path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# --registry ${{ env.LOCAL_REGISTRY }} \ -# --test-repo \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if veneer has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi - - name: Catalog - Build and Push image + - name: Catalog - update veneer file run: | - cd everest-catalog - cat everest-catalog.Dockerfile + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + --registry ${{ env.LOCAL_REGISTRY }} \ + --test-repo \ + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if veneer has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi - name: Catalog - Build and Push image uses: docker/build-push-action@v6 @@ -221,7 +216,7 @@ jobs: context: everest-catalog push: true tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} - file: everest-catalog.Dockerfile + file: everest-catalog/everest-catalog.Dockerfile - name: Everest - check out From 4381fc8e3aa4590f1555b1b4540afaef63ec2808 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 13:29:24 +0200 Subject: [PATCH 057/179] push everest --- .github/workflows/operator-early-adoption.yaml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 92b14ff44..8f97d168c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -272,21 +272,12 @@ jobs: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release fi - - name: Everest - setup docker build metadata - uses: docker/metadata-action@v5 - id: everest_meta - with: - images: | - {{ env.$LOCAL_REGISTRY }}/perconalab/everest - tags: | - type=raw,value=${{ env.VERSION }} - - name: Everest - push Everest image uses: docker/build-push-action@v6 with: context: . push: true - tags: ${{ steps.everest_meta.outputs.tags }} + tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} - name: Provision Everest using CLI shell: bash From 9b5ef06c3ee507f002e29ecfb788548c3d5315ce Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 14:59:32 +0200 Subject: [PATCH 058/179] provision everest --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8f97d168c..30db7dee2 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -44,7 +44,7 @@ jobs: echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV - echo "VS_URL=localhost:$VS_PORT" >> $GITHUB_ENV + echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - name: Set up Go release uses: percona-platform/setup-go@v4 From b5a7cc9594eeed5c6bdd223417c7cf8aa8fee79b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:48:19 +0200 Subject: [PATCH 059/179] update upstream catalog --- .../workflows/operator-early-adoption.yaml | 473 +++++++++--------- 1 file changed, 250 insertions(+), 223 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 30db7dee2..1ed861223 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -1,7 +1,20 @@ --- name: API CI on: - push: + workflow_dispatch: + inputs: + image: + required: true + description: "Full name of the upstream image to test" + upstream: + type: choice + description: "The upstream operator" + required: true + options: + - percona-xtradb-cluster-operator + - percona-server-mongodb-operator + - percona-postgresql-operator + push: # !!! remove before merge branches: - EVEREST-1563-operator-early-adoption @@ -37,6 +50,8 @@ jobs: ARCH: "" OS: "" TOOLS_PATH: "/opt/tools/bin" + UPSTREAM_REPO: ${{ github.event.inputs.upstream }} + IMAGE: ${{ github.event.inputs.image }} steps: - name: Set environment variables @@ -46,140 +61,140 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} - - - name: Expose local registry - run: | - kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev - - - - name: Apply VS manifest - run: | - kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# addons: registry +# insecure-registry: ${{ env.LOCAL_REGISTRY }} +# +# - name: Expose local registry +# run: | +# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & +# +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev +# +# +# - name: Apply VS manifest +# run: | +# kubectl create ns everest-system +# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml -n everest-system +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system +# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile - name: Catalog - checkout uses: actions/checkout@v4 @@ -191,22 +206,34 @@ jobs: - name: Catalog - update veneer file run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} \ - --test-repo \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + #cd everest-catalog/tools + #go run . \ + # --veneer-file ../veneer/everest-operator.yaml \ + # --channel fast-v0 \ + # --new-version ${{ env.VERSION }} \ + # --registry ${{ env.LOCAL_REGISTRY }} \ + # --test-repo \ + + #cd .. + #curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + #chmod +x /tmp/opm + #/tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + #if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + # echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + # exit 1 + #fi + + # Add a new record to the upstream veneer + yq e '.Stable.Bundles += {"Image": "${IMAGE}"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify - # Check if veneer has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi @@ -219,76 +246,76 @@ jobs: file: everest-catalog/everest-catalog.Dockerfile - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Everest - setup golang - uses: actions/setup-go@v5 - with: - go-version-file: "./go.mod" - - - - name: Everest - update sources - run: | - # Update deploy manifest - sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - - # Change version in Makefile - sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - - # Change release manifest link: use local path to file - sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - - # Change release catalog image link: use LOCAL_REGISTRY - sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go - - git status - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - if [[ $IS_RC == 1 ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} - - - name: Provision Everest using CLI - shell: bash - run: | - make init - make build-cli - ./bin/everestctl install -v \ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Everest - setup golang +# uses: actions/setup-go@v5 +# with: +# go-version-file: "./go.mod" +# +# +# - name: Everest - update sources +# run: | +# # Update deploy manifest +# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# +# # Change version in Makefile +# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile +# +# # Change release manifest link: use local path to file +# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go +# +# # Change release catalog image link: use LOCAL_REGISTRY +# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go +# +# git status +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# if [[ $IS_RC == 1 ]]; then +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# else +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release +# fi +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} +# +# - name: Provision Everest using CLI +# shell: bash +# run: | +# make init +# make build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest From ee4412bbdcd49cbc2fb84a521958c66cf839815c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:49:32 +0200 Subject: [PATCH 060/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 1ed861223..cf13d9dde 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -1,5 +1,5 @@ --- -name: API CI +name: Custom build on: workflow_dispatch: inputs: From aa5e2e2252cf488383afba190295302b25437d96 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:51:14 +0200 Subject: [PATCH 061/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index cf13d9dde..27a7ee69d 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -50,8 +50,9 @@ jobs: ARCH: "" OS: "" TOOLS_PATH: "/opt/tools/bin" - UPSTREAM_REPO: ${{ github.event.inputs.upstream }} - IMAGE: ${{ github.event.inputs.image }} + # UPSTREAM_REPO: ${{ github.event.inputs.upstream }} + UPSTREAM_REPO: "percona-xtradb-cluster-operator" + IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" steps: - name: Set environment variables From c631b5af3624bf6ab1aa2dea61d95786f194f7ee Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:52:11 +0200 Subject: [PATCH 062/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 27a7ee69d..de87ee54b 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -207,7 +207,7 @@ jobs: - name: Catalog - update veneer file run: | - #cd everest-catalog/tools + cd everest-catalog/tools #go run . \ # --veneer-file ../veneer/everest-operator.yaml \ # --channel fast-v0 \ @@ -215,7 +215,7 @@ jobs: # --registry ${{ env.LOCAL_REGISTRY }} \ # --test-repo \ - #cd .. + cd .. #curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm #chmod +x /tmp/opm #/tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml From 951eb41de3426a731d3631f7d65ab815d5bffa7b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:52:54 +0200 Subject: [PATCH 063/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index de87ee54b..282c7dbc8 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -216,8 +216,8 @@ jobs: # --test-repo \ cd .. - #curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - #chmod +x /tmp/opm + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm #/tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml # Check if catalog has the new version listed From 465f94e265f78f9ae45c5688f82b9b6936fdbd53 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:54:07 +0200 Subject: [PATCH 064/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 282c7dbc8..a9f632dcc 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -227,7 +227,7 @@ jobs: #fi # Add a new record to the upstream veneer - yq e '.Stable.Bundles += {"Image": "${IMAGE}"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + yq e '.Stable.Bundles += {"Image": "$IMAGE"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify From 23007a0d7a847f287f29564d01542a2057bbc2ad Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 15:54:59 +0200 Subject: [PATCH 065/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a9f632dcc..eb8fe93b6 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -227,7 +227,7 @@ jobs: #fi # Add a new record to the upstream veneer - yq e '.Stable.Bundles += {"Image": "$IMAGE"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + yq e '.Stable.Bundles += {"Image": "${{ IMAGE }}"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify From 94aeee2e76984794602bbe3442c18d4ec6989db1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 16:09:26 +0200 Subject: [PATCH 066/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index eb8fe93b6..495dbd54f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -227,7 +227,7 @@ jobs: #fi # Add a new record to the upstream veneer - yq e '.Stable.Bundles += {"Image": "${{ IMAGE }}"}' veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify From 389e415fd461c96ae398824d41f2a80cb3dc58f5 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 16:10:13 +0200 Subject: [PATCH 067/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 495dbd54f..f585f466e 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -237,7 +237,7 @@ jobs: echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi - + git status - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: From 721e005ce59f51a621e84015c69af522386a3e0d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 16:11:11 +0200 Subject: [PATCH 068/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index f585f466e..6ca8aaf0d 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -237,6 +237,7 @@ jobs: echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi + git add . git status - name: Catalog - Build and Push image uses: docker/build-push-action@v6 From ab3e89570c8fbe517244c16a126c11ac68e8c39d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 16:12:37 +0200 Subject: [PATCH 069/179] update upstream catalog --- .github/workflows/operator-early-adoption.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 6ca8aaf0d..a189da926 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -237,8 +237,7 @@ jobs: echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi - git add . - git status + git diff - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: From 2a8d9de947c27b02be70638a5cc27b1ba7aede02 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 16:15:43 +0200 Subject: [PATCH 070/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a189da926..043f4e12c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -227,7 +227,7 @@ jobs: #fi # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + # yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify From a7a7c6e3682c7f21475348c767f1e36c2c12f4bf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:05:29 +0200 Subject: [PATCH 071/179] test --- .../workflows/operator-early-adoption.yaml | 453 +++++++++--------- 1 file changed, 230 insertions(+), 223 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 043f4e12c..e5b6b995f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -3,6 +3,9 @@ name: Custom build on: workflow_dispatch: inputs: + vs_branch: + required: true + description: "Version Service branch with the new build to checkout" image: required: true description: "Full name of the upstream image to test" @@ -39,7 +42,7 @@ jobs: runs-on: ubuntu-20.04 env: - # VERSION ridiculously higher than any potentially existing + # VERSION constant higher than any potentially existing VERSION: 1.10000.0 CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" @@ -50,9 +53,13 @@ jobs: ARCH: "" OS: "" TOOLS_PATH: "/opt/tools/bin" + # !!! revert to using inputs # UPSTREAM_REPO: ${{ github.event.inputs.upstream }} UPSTREAM_REPO: "percona-xtradb-cluster-operator" + # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" + # VS_BRANCH: ${{ github.event.inputs.vs_branch }} + VS_BRANCH: "main" steps: - name: Set environment variables @@ -62,140 +69,140 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# addons: registry -# insecure-registry: ${{ env.LOCAL_REGISTRY }} -# -# - name: Expose local registry -# run: | -# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & -# -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev -# -# -# - name: Apply VS manifest -# run: | -# kubectl create ns everest-system -# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -n everest-system -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system -# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: ${{ env.LOCAL_REGISTRY }} + + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev + + + - name: Apply VS manifest + run: | + kubectl create ns everest-system + sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile - name: Catalog - checkout uses: actions/checkout@v4 @@ -208,27 +215,27 @@ jobs: - name: Catalog - update veneer file run: | cd everest-catalog/tools - #go run . \ - # --veneer-file ../veneer/everest-operator.yaml \ - # --channel fast-v0 \ - # --new-version ${{ env.VERSION }} \ - # --registry ${{ env.LOCAL_REGISTRY }} \ - # --test-repo \ + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + --registry ${{ env.LOCAL_REGISTRY }} \ + --test-repo \ cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm - #/tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + /tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml # Check if catalog has the new version listed - #if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - # echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - # exit 1 - #fi - + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + # Add a new record to the upstream veneer - # yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + # Generate upstream catalog /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify @@ -237,7 +244,7 @@ jobs: echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi - git diff + - name: Catalog - Build and Push image uses: docker/build-push-action@v6 with: @@ -247,76 +254,76 @@ jobs: file: everest-catalog/everest-catalog.Dockerfile -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Everest - setup golang -# uses: actions/setup-go@v5 -# with: -# go-version-file: "./go.mod" -# -# -# - name: Everest - update sources -# run: | -# # Update deploy manifest -# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# -# # Change version in Makefile -# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile -# -# # Change release manifest link: use local path to file -# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go -# -# # Change release catalog image link: use LOCAL_REGISTRY -# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go -# -# git status -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# if [[ $IS_RC == 1 ]]; then -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# else -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release -# fi -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} -# -# - name: Provision Everest using CLI -# shell: bash -# run: | -# make init -# make build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + + - name: Everest - update sources + run: | + # Update deploy manifest + sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + + # Change version in Makefile + sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile + + # Change release manifest link: use local path to file + sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go + + # Change release catalog image link: use LOCAL_REGISTRY + sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go + + git status + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} + + - name: Provision Everest using CLI + shell: bash + run: | + make init + make build-cli + ./bin/everestctl install -v \ + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest From f0aa14d3597977416edda4a70ea3fb7bdf21ccfd Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:06:38 +0200 Subject: [PATCH 072/179] test --- .github/workflows/operator-early-adoption.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index e5b6b995f..8e0dc22c2 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -113,6 +113,7 @@ jobs: uses: actions/checkout@v4 with: repository: Percona-Lab/percona-version-service + ref: $ {{ env.VS_BRANCH }} path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} From c9c589a491f1061905dfd194e0592267f56a9d5e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:11:16 +0200 Subject: [PATCH 073/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8e0dc22c2..14079993e 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -113,7 +113,7 @@ jobs: uses: actions/checkout@v4 with: repository: Percona-Lab/percona-version-service - ref: $ {{ env.VS_BRANCH }} + ref: ${{ env.VS_BRANCH }} path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} From 83719a9fb3706c1164b3d538b18765c044063864 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:21:46 +0200 Subject: [PATCH 074/179] test --- .github/workflows/operator-early-adoption.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 14079993e..9fd1b7631 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -5,6 +5,7 @@ on: inputs: vs_branch: required: true + default: main description: "Version Service branch with the new build to checkout" image: required: true @@ -58,8 +59,7 @@ jobs: UPSTREAM_REPO: "percona-xtradb-cluster-operator" # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - # VS_BRANCH: ${{ github.event.inputs.vs_branch }} - VS_BRANCH: "main" + VS_BRANCH: ${{ github.event.inputs.vs_branch }} steps: - name: Set environment variables @@ -226,7 +226,7 @@ jobs: cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls-verify -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml # Check if catalog has the new version listed if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then @@ -238,7 +238,7 @@ jobs: yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml # Generate upstream catalog - /tmp/opm alpha render-template semver -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml --skip-tls-verify + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml # Check if upstream catalog has the new image listed if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then From cbebfee595d0c170359382a1604d8be653b58804 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:29:35 +0200 Subject: [PATCH 075/179] test --- .../workflows/operator-early-adoption.yaml | 503 +++++++++--------- 1 file changed, 252 insertions(+), 251 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 9fd1b7631..4b12b9c30 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -59,7 +59,8 @@ jobs: UPSTREAM_REPO: "percona-xtradb-cluster-operator" # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - VS_BRANCH: ${{ github.event.inputs.vs_branch }} + # VS_BRANCH: ${{ github.event.inputs.vs_branch }} + VS_BRANCH: test-everest steps: - name: Set environment variables @@ -69,45 +70,45 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} - - - name: Expose local registry - run: | - kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# addons: registry +# insecure-registry: ${{ env.LOCAL_REGISTRY }} +# +# - name: Expose local registry +# run: | +# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -117,214 +118,214 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev - - - - name: Apply VS manifest - run: | - kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Catalog - checkout - uses: actions/checkout@v4 - with: - ref: EVEREST-1563-variable-registry # !!! remove this line once merged - repository: percona/everest-catalog - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} \ - --test-repo \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if catalog has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi - - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 - fi - - - name: Catalog - Build and Push image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} - file: everest-catalog/everest-catalog.Dockerfile - - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Everest - setup golang - uses: actions/setup-go@v5 - with: - go-version-file: "./go.mod" - - - - name: Everest - update sources - run: | - # Update deploy manifest - sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - - # Change version in Makefile - sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - - # Change release manifest link: use local path to file - sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - - # Change release catalog image link: use LOCAL_REGISTRY - sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go - - git status - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - if [[ $IS_RC == 1 ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} - - - name: Provision Everest using CLI - shell: bash - run: | - make init - make build-cli - ./bin/everestctl install -v \ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev +# +# +# - name: Apply VS manifest +# run: | +# kubectl create ns everest-system +# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml -n everest-system +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system +# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: Catalog - checkout +# uses: actions/checkout@v4 +# with: +# ref: EVEREST-1563-variable-registry # !!! remove this line once merged +# repository: percona/everest-catalog +# path: everest-catalog +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# --registry ${{ env.LOCAL_REGISTRY }} \ +# --test-repo \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if catalog has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi +# +# # Add a new record to the upstream veneer +# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml +# +# # Generate upstream catalog +# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml +# +# # Check if upstream catalog has the new image listed +# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then +# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" +# exit 1 +# fi +# +# - name: Catalog - Build and Push image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} +# file: everest-catalog/everest-catalog.Dockerfile +# +# +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Everest - setup golang +# uses: actions/setup-go@v5 +# with: +# go-version-file: "./go.mod" +# +# +# - name: Everest - update sources +# run: | +# # Update deploy manifest +# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# +# # Change version in Makefile +# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile +# +# # Change release manifest link: use local path to file +# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go +# +# # Change release catalog image link: use LOCAL_REGISTRY +# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go +# +# git status +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# if [[ $IS_RC == 1 ]]; then +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# else +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release +# fi +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} +# +# - name: Provision Everest using CLI +# shell: bash +# run: | +# make init +# make build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest From 75ec56a4ea7f959a743452fb1436bcc888243400 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:30:39 +0200 Subject: [PATCH 076/179] revert --- .../workflows/operator-early-adoption.yaml | 503 +++++++++--------- 1 file changed, 251 insertions(+), 252 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 4b12b9c30..9fd1b7631 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -59,8 +59,7 @@ jobs: UPSTREAM_REPO: "percona-xtradb-cluster-operator" # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - # VS_BRANCH: ${{ github.event.inputs.vs_branch }} - VS_BRANCH: test-everest + VS_BRANCH: ${{ github.event.inputs.vs_branch }} steps: - name: Set environment variables @@ -70,45 +69,45 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# addons: registry -# insecure-registry: ${{ env.LOCAL_REGISTRY }} -# -# - name: Expose local registry -# run: | -# kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + addons: registry + insecure-registry: ${{ env.LOCAL_REGISTRY }} + + - name: Expose local registry + run: | + kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -118,214 +117,214 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev -# -# -# - name: Apply VS manifest -# run: | -# kubectl create ns everest-system -# sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -n everest-system -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system -# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: Catalog - checkout -# uses: actions/checkout@v4 -# with: -# ref: EVEREST-1563-variable-registry # !!! remove this line once merged -# repository: percona/everest-catalog -# path: everest-catalog -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# --registry ${{ env.LOCAL_REGISTRY }} \ -# --test-repo \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if catalog has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi -# -# # Add a new record to the upstream veneer -# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml -# -# # Generate upstream catalog -# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml -# -# # Check if upstream catalog has the new image listed -# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then -# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" -# exit 1 -# fi -# -# - name: Catalog - Build and Push image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} -# file: everest-catalog/everest-catalog.Dockerfile -# -# -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Everest - setup golang -# uses: actions/setup-go@v5 -# with: -# go-version-file: "./go.mod" -# -# -# - name: Everest - update sources -# run: | -# # Update deploy manifest -# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# -# # Change version in Makefile -# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile -# -# # Change release manifest link: use local path to file -# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go -# -# # Change release catalog image link: use LOCAL_REGISTRY -# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go -# -# git status -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# if [[ $IS_RC == 1 ]]; then -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# else -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release -# fi -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} -# -# - name: Provision Everest using CLI -# shell: bash -# run: | -# make init -# make build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev + + + - name: Apply VS manifest + run: | + kubectl create ns everest-system + sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + ref: EVEREST-1563-variable-registry # !!! remove this line once merged + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - update veneer file + run: | + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + --registry ${{ env.LOCAL_REGISTRY }} \ + --test-repo \ + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi + + - name: Catalog - Build and Push image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + + - name: Everest - update sources + run: | + # Update deploy manifest + sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + + # Change version in Makefile + sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile + + # Change release manifest link: use local path to file + sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go + + # Change release catalog image link: use LOCAL_REGISTRY + sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go + + git status + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} + + - name: Provision Everest using CLI + shell: bash + run: | + make init + make build-cli + ./bin/everestctl install -v \ + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest From bb3bf4594992ef6d7995392d6d8688e8d13bc340 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:41:56 +0200 Subject: [PATCH 077/179] build catalog latest --- .github/workflows/operator-early-adoption.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 9fd1b7631..8c5d1ad0c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -246,12 +246,22 @@ jobs: exit 1 fi - - name: Catalog - Build and Push image + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + type=raw,value=latest + + - name: Catalog - push everest-catalog image uses: docker/build-push-action@v6 with: context: everest-catalog push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/everest-catalog:${{ env.VERSION }} + tags: ${{ steps.catalog_meta.outputs.tags }} file: everest-catalog/everest-catalog.Dockerfile From 56e2d5815b20657bdfead945e5d00abae344d191 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 17:53:33 +0200 Subject: [PATCH 078/179] build catalog latest --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8c5d1ad0c..1d76218d8 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -251,7 +251,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog tags: | type=raw,value=${{ env.VERSION }} type=raw,value=latest From 1982f1bf0c094271e24cb101a69ee2ce8d964ca1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 18:19:57 +0200 Subject: [PATCH 079/179] test --- .github/workflows/operator-early-adoption.yaml | 1 + pkg/kubernetes/kubernetes.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 1d76218d8..a764b1ef3 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -269,6 +269,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.ROBOT_TOKEN }} + ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - name: Everest - setup golang uses: actions/setup-go@v5 diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 323dd5369..302373e8a 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -409,19 +409,29 @@ func (k *Kubernetes) InstallPerconaCatalog(ctx context.Context, version *goversi k.l.Debugf("Using catalog image %s", everestVersion.CatalogImage(version)) if err := unstructured.SetNestedField(o, everestVersion.CatalogImage(version), "spec", "image"); err != nil { + k.l.Debugf("!!! 1") return err } + k.l.Debugf("!!! 2") + data, err = yamlv3.Marshal(o) if err != nil { + k.l.Debugf("!!! 4") + return err } + k.l.Debugf("!!! 5 %s", string(data)) if err := k.client.ApplyManifestFile(data, namespace); err != nil { + k.l.Debugf("!!! 6") return errors.Join(err, errors.New("cannot apply percona catalog file")) } + k.l.Debugf("!!! 7") if err := k.client.DoPackageWait(ctx, namespace, "everest-operator"); err != nil { + k.l.Debugf("!!! 8") return errors.Join(err, errors.New("timeout waiting for package")) } + k.l.Debugf("!!! 9") return nil } From 9682e112e57c050e7d64464694114ac416f88af0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 22:14:16 +0200 Subject: [PATCH 080/179] test --- .github/workflows/operator-early-adoption.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a764b1ef3..04d307bde 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -245,6 +245,8 @@ jobs: echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" exit 1 fi + + git diff - name: Catalog - setup Docker meta for everest-catalog id: catalog_meta From e6a7033159a5bd10fbbf7a66d8734c143d9cf356 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 19 Nov 2024 22:17:08 +0200 Subject: [PATCH 081/179] test --- pkg/kubernetes/client/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 766b975da..300032552 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -1309,7 +1309,7 @@ func (c *Client) DoPackageWait(ctx context.Context, namespace, name string) erro } return true, nil } - return wait.PollUntilContextCancel(ctx, time.Second, true, packageInstalled) + return wait.PollUntilContextCancel(ctx, time.Minute, true, packageInstalled) } // GetPackageManifest returns a package manifest by given name. From 72390f0253ab9ddf5c9863873da686bb5d907625 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 09:33:51 +0200 Subject: [PATCH 082/179] internal host --- .github/workflows/operator-early-adoption.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 04d307bde..4a1609a8e 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -49,7 +49,6 @@ jobs: K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 VS_URL: "" - LOCAL_REGISTRY_PORT: 5000 LOCAL_REGISTRY: "" ARCH: "" OS: "" @@ -66,7 +65,6 @@ jobs: run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV - echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - name: Set up Go release @@ -103,11 +101,11 @@ jobs: cpus: 2 memory: 2000m addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | - kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + echo "LOCAL_REGISTRY=$(minikube ip):5000">> $GITHUB_ENV + kubectl port-forward --namespace kube-system service/registry 5000:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -130,13 +128,13 @@ jobs: with: context: percona-version-service push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev + tags: localhost:5000/perconalab/version-service:dev - name: Apply VS manifest run: | kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & From 6a62424ac3322e36a2a5e758d9a04b65649bbf7e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 10:21:33 +0200 Subject: [PATCH 083/179] test insecure --- pkg/kubernetes/client/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 300032552..4849c9906 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -231,6 +231,7 @@ func (c *Client) setup() error { // NewInCluster creates a client using incluster authentication. func NewInCluster() (*Client, error) { config, err := rest.InClusterConfig() + config.TLSClientConfig.Insecure = true if err != nil { return nil, err } From b396c60e5fb7b8aac9c4faec5521afc8114b6199 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 10:21:57 +0200 Subject: [PATCH 084/179] Revert "internal host" This reverts commit 72390f0253ab9ddf5c9863873da686bb5d907625. --- .github/workflows/operator-early-adoption.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 4a1609a8e..04d307bde 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -49,6 +49,7 @@ jobs: K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 VS_URL: "" + LOCAL_REGISTRY_PORT: 5000 LOCAL_REGISTRY: "" ARCH: "" OS: "" @@ -65,6 +66,7 @@ jobs: run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV + echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - name: Set up Go release @@ -101,11 +103,11 @@ jobs: cpus: 2 memory: 2000m addons: registry + insecure-registry: ${{ env.LOCAL_REGISTRY }} - name: Expose local registry run: | - echo "LOCAL_REGISTRY=$(minikube ip):5000">> $GITHUB_ENV - kubectl port-forward --namespace kube-system service/registry 5000:80 & + kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & - name: VS - checkout uses: actions/checkout@v4 @@ -128,13 +130,13 @@ jobs: with: context: percona-version-service push: true - tags: localhost:5000/perconalab/version-service:dev + tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev - name: Apply VS manifest run: | kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/localhost:5000\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & From 5b906f005b93f15a4184470b0212142e7e3140d4 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 11:53:53 +0200 Subject: [PATCH 085/179] test insecure --- pkg/kubernetes/client/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 4849c9906..532c2bc62 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -188,6 +188,7 @@ func NewFromKubeConfig(kubeconfig string, l *zap.SugaredLogger) (*Client, error) config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit + config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err From 3a21548d529c2e9412893bf280de59f481a3ae7f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:26:31 +0200 Subject: [PATCH 086/179] revert insecure --- pkg/kubernetes/client/client.go | 2 -- pkg/kubernetes/kubernetes.go | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 532c2bc62..300032552 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -188,7 +188,6 @@ func NewFromKubeConfig(kubeconfig string, l *zap.SugaredLogger) (*Client, error) config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit - config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err @@ -232,7 +231,6 @@ func (c *Client) setup() error { // NewInCluster creates a client using incluster authentication. func NewInCluster() (*Client, error) { config, err := rest.InClusterConfig() - config.TLSClientConfig.Insecure = true if err != nil { return nil, err } diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 302373e8a..323dd5369 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -409,29 +409,19 @@ func (k *Kubernetes) InstallPerconaCatalog(ctx context.Context, version *goversi k.l.Debugf("Using catalog image %s", everestVersion.CatalogImage(version)) if err := unstructured.SetNestedField(o, everestVersion.CatalogImage(version), "spec", "image"); err != nil { - k.l.Debugf("!!! 1") return err } - k.l.Debugf("!!! 2") - data, err = yamlv3.Marshal(o) if err != nil { - k.l.Debugf("!!! 4") - return err } - k.l.Debugf("!!! 5 %s", string(data)) if err := k.client.ApplyManifestFile(data, namespace); err != nil { - k.l.Debugf("!!! 6") return errors.Join(err, errors.New("cannot apply percona catalog file")) } - k.l.Debugf("!!! 7") if err := k.client.DoPackageWait(ctx, namespace, "everest-operator"); err != nil { - k.l.Debugf("!!! 8") return errors.Join(err, errors.New("timeout waiting for package")) } - k.l.Debugf("!!! 9") return nil } From 2f4d3fa825e096936c9ee91262816ffa7b033e0c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:31:36 +0200 Subject: [PATCH 087/179] test secure storage --- .github/secure-registry.yaml | 59 +++ .../workflows/operator-early-adoption.yaml | 445 +++++++++--------- 2 files changed, 285 insertions(+), 219 deletions(-) create mode 100644 .github/secure-registry.yaml diff --git a/.github/secure-registry.yaml b/.github/secure-registry.yaml new file mode 100644 index 000000000..dafab817b --- /dev/null +++ b/.github/secure-registry.yaml @@ -0,0 +1,59 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: registry +spec: + replicas: 1 + selector: + matchLabels: + app: registry + template: + metadata: + labels: + app: registry + spec: + containers: + - name: registry + image: registry:2 + ports: + - containerPort: 5000 + volumeMounts: + - name: registry-certs + mountPath: /certs + volumes: + - name: registry-certs + emptyDir: {} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: selfsigned-issuer +spec: + selfSigned: {} +--- +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: letsencrypt-staging +spec: + acme: + server: https://acme-staging-v02.api.letsencrypt.org/directory + email: oksana.grishchenko@percona.com + privateKeySecretRef: + name: letsencrypt-staging-private-key + solvers: + - http01: + ingress: + class: nginx # or your ingress controller's class +--- +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: registry-cert +spec: + dnsNames: + - localhost # Or a different DNS name if you're using an Ingress + issuerRef: + name: selfsigned-issuer # Or letsencrypt-staging + kind: Issuer + secretName: registry-certs #Must match the volumeMount name in the deployment diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 04d307bde..84e772805 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -78,23 +78,23 @@ jobs: run: | go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - name: Start local Kubernetes cluster with the local registry uses: medyagh/setup-minikube@latest @@ -102,8 +102,15 @@ jobs: with: cpus: 2 memory: 2000m - addons: registry - insecure-registry: ${{ env.LOCAL_REGISTRY }} + + - name: Deploy registry + run: | + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml + # install the tool to check the availability + go install github.com/cert-manager/cmctl/v2@latest + #check availability + cmctl check api --wait=2m + kubectl apply -f ./.github/registry.yaml --namespace kube-system - name: Expose local registry run: | @@ -141,203 +148,203 @@ jobs: kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Catalog - checkout - uses: actions/checkout@v4 - with: - ref: EVEREST-1563-variable-registry # !!! remove this line once merged - repository: percona/everest-catalog - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} \ - --test-repo \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if catalog has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi - - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 - fi - - git diff - - - name: Catalog - setup Docker meta for everest-catalog - id: catalog_meta - uses: docker/metadata-action@v5 - with: - images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog - tags: | - type=raw,value=${{ env.VERSION }} - type=raw,value=latest - - - name: Catalog - push everest-catalog image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ steps.catalog_meta.outputs.tags }} - file: everest-catalog/everest-catalog.Dockerfile - - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - - - name: Everest - setup golang - uses: actions/setup-go@v5 - with: - go-version-file: "./go.mod" - - - - name: Everest - update sources - run: | - # Update deploy manifest - sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - - # Change version in Makefile - sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - - # Change release manifest link: use local path to file - sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - - # Change release catalog image link: use LOCAL_REGISTRY - sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go - - git status - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - if [[ $IS_RC == 1 ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} - - - name: Provision Everest using CLI - shell: bash - run: | - make init - make build-cli - ./bin/everestctl install -v \ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: Catalog - checkout +# uses: actions/checkout@v4 +# with: +# ref: EVEREST-1563-variable-registry # !!! remove this line once merged +# repository: percona/everest-catalog +# path: everest-catalog +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# --registry ${{ env.LOCAL_REGISTRY }} \ +# --test-repo \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if catalog has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi +# +# # Add a new record to the upstream veneer +# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml +# +# # Generate upstream catalog +# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml +# +# # Check if upstream catalog has the new image listed +# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then +# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" +# exit 1 +# fi +# +# git diff +# +# - name: Catalog - setup Docker meta for everest-catalog +# id: catalog_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog +# tags: | +# type=raw,value=${{ env.VERSION }} +# type=raw,value=latest +# +# - name: Catalog - push everest-catalog image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ steps.catalog_meta.outputs.tags }} +# file: everest-catalog/everest-catalog.Dockerfile +# +# +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# ref: EVEREST-1563-operator-early-adoption # !!! delete before merge +# +# - name: Everest - setup golang +# uses: actions/setup-go@v5 +# with: +# go-version-file: "./go.mod" +# +# +# - name: Everest - update sources +# run: | +# # Update deploy manifest +# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# +# # Change version in Makefile +# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile +# +# # Change release manifest link: use local path to file +# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go +# +# # Change release catalog image link: use LOCAL_REGISTRY +# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go +# +# git status +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# if [[ $IS_RC == 1 ]]; then +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# else +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release +# fi +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} +# +# - name: Provision Everest using CLI +# shell: bash +# run: | +# make init +# make build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest From 63a42fee51885971ab7f20ba89cacff062a1eae6 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:37:34 +0200 Subject: [PATCH 088/179] test --- .../workflows/operator-early-adoption.yaml | 46 +++++++++++-------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 84e772805..580c50bd7 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -69,15 +69,15 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV # # - name: Enable Go modules cache # uses: percona-platform/cache@v3 @@ -96,21 +96,27 @@ jobs: # ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- # ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m + + - name: Everest - check out + uses: actions/checkout@v4 with: - cpus: 2 - memory: 2000m + token: ${{ secrets.ROBOT_TOKEN }} + ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - name: Deploy registry run: | - kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml - # install the tool to check the availability - go install github.com/cert-manager/cmctl/v2@latest - #check availability - cmctl check api --wait=2m - kubectl apply -f ./.github/registry.yaml --namespace kube-system +# kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml +# # install the tool to check the availability +# go install github.com/cert-manager/cmctl/v2@latest +# #check availability +# cmctl check api --wait=2m + kubectl apply -f .github/registry.yaml --namespace kube-system - name: Expose local registry run: | From b55f9855dfd75eb1d309f0bef7fe712f3cc3dc8e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:38:09 +0200 Subject: [PATCH 089/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 580c50bd7..05a085927 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -108,7 +108,7 @@ jobs: with: token: ${{ secrets.ROBOT_TOKEN }} ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - + - name: Deploy registry run: | # kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml From 67dc1313576d06b9ab78f6f69489952034134f5a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:39:59 +0200 Subject: [PATCH 090/179] test --- .github/workflows/operator-early-adoption.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 05a085927..58546d93e 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -108,14 +108,14 @@ jobs: with: token: ${{ secrets.ROBOT_TOKEN }} ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - + - name: Deploy registry run: | -# kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml -# # install the tool to check the availability -# go install github.com/cert-manager/cmctl/v2@latest -# #check availability -# cmctl check api --wait=2m + #kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml + # install the tool to check the availability + #go install github.com/cert-manager/cmctl/v2@latest + #check availability + #cmctl check api --wait=2m kubectl apply -f .github/registry.yaml --namespace kube-system - name: Expose local registry From 7e78a491194d2cbba87a82dfa230f024b99c57f2 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:40:57 +0200 Subject: [PATCH 091/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 58546d93e..5116ce74d 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -116,7 +116,7 @@ jobs: #go install github.com/cert-manager/cmctl/v2@latest #check availability #cmctl check api --wait=2m - kubectl apply -f .github/registry.yaml --namespace kube-system + kubectl apply -f .github/secure-registry.yaml --namespace kube-system - name: Expose local registry run: | From 339e1e5fbe0cd489f49ad153f35ff2b47346e266 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:42:15 +0200 Subject: [PATCH 092/179] test --- .../workflows/operator-early-adoption.yaml | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5116ce74d..89e6b4629 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -69,16 +69,16 @@ jobs: echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + # - name: Enable Go modules cache # uses: percona-platform/cache@v3 # with: @@ -96,12 +96,12 @@ jobs: # ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- # ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m + - name: Start local Kubernetes cluster with the local registry + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m - name: Everest - check out uses: actions/checkout@v4 @@ -111,11 +111,11 @@ jobs: - name: Deploy registry run: | - #kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml + kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml # install the tool to check the availability - #go install github.com/cert-manager/cmctl/v2@latest - #check availability - #cmctl check api --wait=2m + go install github.com/cert-manager/cmctl/v2@latest + check availability + cmctl check api --wait=2m kubectl apply -f .github/secure-registry.yaml --namespace kube-system - name: Expose local registry From a7ddc30a49cfe8a30004eb5c7356c4650709d0ef Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 17:52:30 +0200 Subject: [PATCH 093/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 89e6b4629..5b6ffcb9c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -114,7 +114,7 @@ jobs: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml # install the tool to check the availability go install github.com/cert-manager/cmctl/v2@latest - check availability + # check availability cmctl check api --wait=2m kubectl apply -f .github/secure-registry.yaml --namespace kube-system From edd4e4d7536e3012e713bed4034ad53e755a6b04 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 19:14:04 +0200 Subject: [PATCH 094/179] minikube registry & insecure tls --- .../workflows/operator-early-adoption.yaml | 449 +++++++++--------- pkg/kubernetes/client/client.go | 2 + 2 files changed, 220 insertions(+), 231 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5b6ffcb9c..4527d919f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -79,22 +79,22 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - name: Start local Kubernetes cluster with the local registry uses: medyagh/setup-minikube@latest @@ -102,21 +102,8 @@ jobs: with: cpus: 2 memory: 2000m - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - - - name: Deploy registry - run: | - kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml - # install the tool to check the availability - go install github.com/cert-manager/cmctl/v2@latest - # check availability - cmctl check api --wait=2m - kubectl apply -f .github/secure-registry.yaml --namespace kube-system + addons: registry + insecure-registry: "localhost:5000" - name: Expose local registry run: | @@ -154,203 +141,203 @@ jobs: kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: Catalog - checkout -# uses: actions/checkout@v4 -# with: -# ref: EVEREST-1563-variable-registry # !!! remove this line once merged -# repository: percona/everest-catalog -# path: everest-catalog -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# --registry ${{ env.LOCAL_REGISTRY }} \ -# --test-repo \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if catalog has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi -# -# # Add a new record to the upstream veneer -# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml -# -# # Generate upstream catalog -# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml -# -# # Check if upstream catalog has the new image listed -# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then -# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" -# exit 1 -# fi -# -# git diff -# -# - name: Catalog - setup Docker meta for everest-catalog -# id: catalog_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog -# tags: | -# type=raw,value=${{ env.VERSION }} -# type=raw,value=latest -# -# - name: Catalog - push everest-catalog image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ steps.catalog_meta.outputs.tags }} -# file: everest-catalog/everest-catalog.Dockerfile -# -# -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# ref: EVEREST-1563-operator-early-adoption # !!! delete before merge -# -# - name: Everest - setup golang -# uses: actions/setup-go@v5 -# with: -# go-version-file: "./go.mod" -# -# -# - name: Everest - update sources -# run: | -# # Update deploy manifest -# sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# -# # Change version in Makefile -# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile -# -# # Change release manifest link: use local path to file -# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go -# -# # Change release catalog image link: use LOCAL_REGISTRY -# sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go -# -# git status -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# if [[ $IS_RC == 1 ]]; then -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# else -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release -# fi -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} -# -# - name: Provision Everest using CLI -# shell: bash -# run: | -# make init -# make build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + ref: EVEREST-1563-variable-registry # !!! remove this line once merged + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - update veneer file + run: | + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + --registry ${{ env.LOCAL_REGISTRY }} \ + --test-repo \ + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi + + git diff + + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog + tags: | + type=raw,value=${{ env.VERSION }} + type=raw,value=latest + + - name: Catalog - push everest-catalog image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.catalog_meta.outputs.tags }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + ref: EVEREST-1563-operator-early-adoption # !!! delete before merge + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + + - name: Everest - update sources + run: | + # Update deploy manifest + sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + + # Change version in Makefile + sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile + + # Change release manifest link: use local path to file + sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go + + # Change release catalog image link: use LOCAL_REGISTRY + sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go + + git status + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} + + - name: Provision Everest using CLI + shell: bash + run: | + make init + make build-cli + ./bin/everestctl install -v \ + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 300032552..d27ba612b 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -188,6 +188,7 @@ func NewFromKubeConfig(kubeconfig string, l *zap.SugaredLogger) (*Client, error) config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit + config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err @@ -237,6 +238,7 @@ func NewInCluster() (*Client, error) { config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit config.Timeout = requestTimeout + config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err From cd6e76560e3ffebee9f146bf8eecdcc5ce3aef27 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 20 Nov 2024 22:25:24 +0200 Subject: [PATCH 095/179] remove insecure incluster --- pkg/kubernetes/client/client.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index d27ba612b..8568ff4fe 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -238,7 +238,6 @@ func NewInCluster() (*Client, error) { config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit config.Timeout = requestTimeout - config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err From 49565d926e12c43062083610bac19e86ff47183d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 11:15:03 +0200 Subject: [PATCH 096/179] test RC with timestamp --- .../workflows/operator-early-adoption.yaml | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 4527d919f..8acb4c55d 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -44,7 +44,7 @@ jobs: env: # VERSION constant higher than any potentially existing - VERSION: 1.10000.0 + VERSION: 1.10000.0-rc20241121101830 CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 @@ -105,7 +105,7 @@ jobs: addons: registry insecure-registry: "localhost:5000" - - name: Expose local registry + - name: Expose local registry # !!! remove local registry, keeping it for now to push VS images run: | kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & @@ -141,6 +141,12 @@ jobs: kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + - name: Login to GitHub Container Registry # !!! move above, prior VS chagnes + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Operator - check out uses: actions/checkout@v4 with: @@ -177,7 +183,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator + perconalab/everest-operator tags: | type=raw,value=${{ env.VERSION }} @@ -186,7 +192,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-operator-bundle + perconalab/everest-operator-bundle tags: | type=raw,value=${{ env.VERSION }} @@ -208,7 +214,6 @@ jobs: - name: Catalog - checkout uses: actions/checkout@v4 with: - ref: EVEREST-1563-variable-registry # !!! remove this line once merged repository: percona/everest-catalog path: everest-catalog token: ${{ secrets.ROBOT_TOKEN }} @@ -220,7 +225,6 @@ jobs: --veneer-file ../veneer/everest-operator.yaml \ --channel fast-v0 \ --new-version ${{ env.VERSION }} \ - --registry ${{ env.LOCAL_REGISTRY }} \ --test-repo \ cd .. @@ -253,7 +257,7 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ env.LOCAL_REGISTRY }}/perconalab/everest-catalog + perconalab/everest-catalog tags: | type=raw,value=${{ env.VERSION }} type=raw,value=latest @@ -282,18 +286,15 @@ jobs: - name: Everest - update sources run: | # Update deploy manifest - sed -i "s/perconalab\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/$LOCAL_REGISTRY\/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml # Change version in Makefile sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - # Change release manifest link: use local path to file + # Change release manifest link: use local path to the manifest file in version.go sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - # Change release catalog image link: use LOCAL_REGISTRY - sed -i "s/docker.io/$LOCAL_REGISTRY/g" pkg/version/version.go - git status - name: Everest UI - setup pnpm uses: pnpm/action-setup@v4 @@ -326,7 +327,7 @@ jobs: with: context: . push: true - tags: ${{ env.LOCAL_REGISTRY }}/perconalab/everest:${{ env.VERSION }} + tags: perconalab/everest:${{ env.VERSION }} - name: Provision Everest using CLI shell: bash From e80981d1c1d8b442dc03317f24a9bf690d6b77ec Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 11:27:33 +0200 Subject: [PATCH 097/179] test RC with timestamp --- .github/workflows/operator-early-adoption.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 8acb4c55d..2d13000a2 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -225,7 +225,6 @@ jobs: --veneer-file ../veneer/everest-operator.yaml \ --channel fast-v0 \ --new-version ${{ env.VERSION }} \ - --test-repo \ cd .. curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm From 7d7ae49a969d5db72425618d20a5195546d080c0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 11:52:19 +0200 Subject: [PATCH 098/179] revert insecure --- pkg/kubernetes/client/client.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/kubernetes/client/client.go b/pkg/kubernetes/client/client.go index 8568ff4fe..766b975da 100644 --- a/pkg/kubernetes/client/client.go +++ b/pkg/kubernetes/client/client.go @@ -188,7 +188,6 @@ func NewFromKubeConfig(kubeconfig string, l *zap.SugaredLogger) (*Client, error) config.QPS = defaultQPSLimit config.Burst = defaultBurstLimit - config.TLSClientConfig.Insecure = true clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err @@ -1310,7 +1309,7 @@ func (c *Client) DoPackageWait(ctx context.Context, namespace, name string) erro } return true, nil } - return wait.PollUntilContextCancel(ctx, time.Minute, true, packageInstalled) + return wait.PollUntilContextCancel(ctx, time.Second, true, packageInstalled) } // GetPackageManifest returns a package manifest by given name. From f60cc67ad1a188fa2b471294d7f2f54e41036b27 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 11:52:55 +0200 Subject: [PATCH 099/179] delete secure registry config --- .github/secure-registry.yaml | 59 ------------------------------------ 1 file changed, 59 deletions(-) delete mode 100644 .github/secure-registry.yaml diff --git a/.github/secure-registry.yaml b/.github/secure-registry.yaml deleted file mode 100644 index dafab817b..000000000 --- a/.github/secure-registry.yaml +++ /dev/null @@ -1,59 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: registry -spec: - replicas: 1 - selector: - matchLabels: - app: registry - template: - metadata: - labels: - app: registry - spec: - containers: - - name: registry - image: registry:2 - ports: - - containerPort: 5000 - volumeMounts: - - name: registry-certs - mountPath: /certs - volumes: - - name: registry-certs - emptyDir: {} ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: selfsigned-issuer -spec: - selfSigned: {} ---- -apiVersion: cert-manager.io/v1 -kind: Issuer -metadata: - name: letsencrypt-staging -spec: - acme: - server: https://acme-staging-v02.api.letsencrypt.org/directory - email: oksana.grishchenko@percona.com - privateKeySecretRef: - name: letsencrypt-staging-private-key - solvers: - - http01: - ingress: - class: nginx # or your ingress controller's class ---- -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: registry-cert -spec: - dnsNames: - - localhost # Or a different DNS name if you're using an Ingress - issuerRef: - name: selfsigned-issuer # Or letsencrypt-staging - kind: Issuer - secretName: registry-certs #Must match the volumeMount name in the deployment From dcb4df74cf366d60f6dce5b72ab843f639fbcb1e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 12:08:21 +0200 Subject: [PATCH 100/179] do not use cache --- .github/workflows/operator-early-adoption.yaml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 2d13000a2..b759bdae9 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -79,23 +79,6 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - name: Start local Kubernetes cluster with the local registry uses: medyagh/setup-minikube@latest id: minikube From 89f2853c93e076977d578674dc592634699f7516 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 12:34:29 +0200 Subject: [PATCH 101/179] remove init --- .github/workflows/operator-early-adoption.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index b759bdae9..c6d473c0a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -314,7 +314,6 @@ jobs: - name: Provision Everest using CLI shell: bash run: | - make init make build-cli ./bin/everestctl install -v \ --version $VERSION \ From a9e2309a292c00a54ce2bef1d585593cd4bfebce Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 12:56:25 +0200 Subject: [PATCH 102/179] version --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index c6d473c0a..a7957b753 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -44,7 +44,7 @@ jobs: env: # VERSION constant higher than any potentially existing - VERSION: 1.10000.0-rc20241121101830 + VERSION: 1.10000.0-rc20241121125600 CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 From 89ca283c34b2acc93849895da1709172b372da46 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 13:06:44 +0200 Subject: [PATCH 103/179] remove latest catalog image --- .github/workflows/operator-early-adoption.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a7957b753..049e728ca 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -242,7 +242,6 @@ jobs: perconalab/everest-catalog tags: | type=raw,value=${{ env.VERSION }} - type=raw,value=latest - name: Catalog - push everest-catalog image uses: docker/build-push-action@v6 From 391b767d8912a549b54a969f5f01cb43b184aeaf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 13:23:45 +0200 Subject: [PATCH 104/179] use remote VS image --- .../workflows/operator-early-adoption.yaml | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 049e728ca..5988cf89f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -85,12 +85,12 @@ jobs: with: cpus: 2 memory: 2000m - addons: registry - insecure-registry: "localhost:5000" - - name: Expose local registry # !!! remove local registry, keeping it for now to push VS images - run: | - kubectl port-forward --namespace kube-system service/registry $LOCAL_REGISTRY_PORT:80 & + - name: Login to GitHub Container Registry # !!! move above, prior VS chagnes + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: VS - checkout uses: actions/checkout@v4 @@ -113,23 +113,18 @@ jobs: with: context: percona-version-service push: true - tags: ${{ env.LOCAL_REGISTRY}}/perconalab/version-service:dev + tags: perconalab/everest-catalog:test # !!! change tag and repo - name: Apply VS manifest run: | kubectl create ns everest-system - sed -i "s/perconalab\/version-service:.*/$LOCAL_REGISTRY\/perconalab\/version-service:dev/g" percona-version-service/deploy.yaml + # !!! change tag and repo + sed -i "s/perconalab\/version-service:.*/perconalab\/everest-catalog:test/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml -n everest-system kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - name: Login to GitHub Container Registry # !!! move above, prior VS chagnes - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Operator - check out uses: actions/checkout@v4 with: From 392306978ce44a6e8e7b1f384e512f1e2ef6bc9d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 14:19:08 +0200 Subject: [PATCH 105/179] increase timeout --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5988cf89f..fb65f7b28 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -31,7 +31,7 @@ permissions: jobs: test: name: Test - timeout-minutes: 10 + timeout-minutes: 20 strategy: fail-fast: false From 60aa55ca96a7bd39fb978940a5fd54e3f7858cf1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 14:48:37 +0200 Subject: [PATCH 106/179] Revert "do not use cache" This reverts commit dcb4df74cf366d60f6dce5b72ab843f639fbcb1e. --- .github/workflows/operator-early-adoption.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index fb65f7b28..047e0473c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -79,6 +79,23 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + - name: Start local Kubernetes cluster with the local registry uses: medyagh/setup-minikube@latest id: minikube From e21c4aba51f7839c14e5d40ebb1c2c09b0bf30bf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 14:53:58 +0200 Subject: [PATCH 107/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- pkg/install/install.go | 2 +- pkg/kubernetes/kubernetes.go | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 047e0473c..cc7573b1d 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -31,7 +31,7 @@ permissions: jobs: test: name: Test - timeout-minutes: 20 + timeout-minutes: 30 strategy: fail-fast: false diff --git a/pkg/install/install.go b/pkg/install/install.go index 1ad68a8cd..3c60e2386 100644 --- a/pkg/install/install.go +++ b/pkg/install/install.go @@ -725,7 +725,6 @@ func (o *Install) provisionOLM() []common.Step { return err } o.l.Info("OLM has been installed") - o.l.Info("Installing Percona OLM Catalog") return nil }, }) @@ -738,6 +737,7 @@ func (o *Install) installCatalog(v *goversion.Version) []common.Step { result = append(result, common.Step{ Desc: "Install Percona OLM Catalog", F: func(ctx context.Context) error { + o.l.Info("Installing Percona OLM Catalog") if err := o.kubeClient.InstallPerconaCatalog(ctx, v, o.config.CatalogNamespace); err != nil { o.l.Errorf("failed installing OLM catalog: %v", err) return err diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 323dd5369..2c880d691 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -407,6 +407,8 @@ func (k *Kubernetes) InstallPerconaCatalog(ctx context.Context, version *goversi return err } + k.l.Debugf("Initial version %s", version.String()) + k.l.Debugf("Initial version %s", everestVersion.EverestChannelOverride) k.l.Debugf("Using catalog image %s", everestVersion.CatalogImage(version)) if err := unstructured.SetNestedField(o, everestVersion.CatalogImage(version), "spec", "image"); err != nil { return err From 667f032943712cf2c9b51bd19f53f71c05307b65 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 15:29:29 +0200 Subject: [PATCH 108/179] build CLI directly --- .github/workflows/operator-early-adoption.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index cc7573b1d..4a8b5dec4 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -288,7 +288,6 @@ jobs: # Change release manifest link: use local path to the manifest file in version.go sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - git status - name: Everest UI - setup pnpm uses: pnpm/action-setup@v4 with: @@ -325,7 +324,7 @@ jobs: - name: Provision Everest using CLI shell: bash run: | - make build-cli + go build -o bin/everestctl ./cmd/cli ./bin/everestctl install -v \ --version $VERSION \ --version-metadata-url $VS_URL \ From 8e23a32581ccb907ca112737737c8b62d3a63984 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 16:01:00 +0200 Subject: [PATCH 109/179] add make target for feature builds --- .github/workflows/operator-early-adoption.yaml | 2 +- Makefile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 4a8b5dec4..a9597062f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -324,7 +324,7 @@ jobs: - name: Provision Everest using CLI shell: bash run: | - go build -o bin/everestctl ./cmd/cli + make feature-build-cli ./bin/everestctl install -v \ --version $VERSION \ --version-metadata-url $VS_URL \ diff --git a/Makefile b/Makefile index 5d9ec8a46..a343a33eb 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,9 @@ build: ## Build binaries build-cli: ## Build binaries go build -tags debug -v $(LD_FLAGS_CLI_TEST) -o bin/everestctl ./cmd/cli +feature-build-cli: ## Build binaries for feature build + go build -tags debug -v $(LD_FLAGS_CLI) -o bin/everestctl ./cmd/cli + release: FLAGS += -X 'github.com/percona/everest/cmd/config.TelemetryURL=https://check.percona.com' -X 'github.com/percona/everest/cmd/config.TelemetryInterval=24h' release: build ## Build release version From e9010d353a053d23de1dd6c3982633809f9047bc Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 16:24:09 +0200 Subject: [PATCH 110/179] cleanup debug logs --- pkg/kubernetes/kubernetes.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/kubernetes/kubernetes.go b/pkg/kubernetes/kubernetes.go index 2c880d691..323dd5369 100644 --- a/pkg/kubernetes/kubernetes.go +++ b/pkg/kubernetes/kubernetes.go @@ -407,8 +407,6 @@ func (k *Kubernetes) InstallPerconaCatalog(ctx context.Context, version *goversi return err } - k.l.Debugf("Initial version %s", version.String()) - k.l.Debugf("Initial version %s", everestVersion.EverestChannelOverride) k.l.Debugf("Using catalog image %s", everestVersion.CatalogImage(version)) if err := unstructured.SetNestedField(o, everestVersion.CatalogImage(version), "spec", "image"); err != nil { return err From e5c30d6a4ed8e19473ee51da1891cd5c40a8aeee Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 16:44:17 +0200 Subject: [PATCH 111/179] test ts --- .../workflows/operator-early-adoption.yaml | 528 +++++++++--------- 1 file changed, 268 insertions(+), 260 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index a9597062f..26314de6c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -60,276 +60,284 @@ jobs: # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" VS_BRANCH: ${{ github.event.inputs.vs_branch }} + TIMESTAMP: "" steps: + - name: Get current date + id: date + run: | + echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" + - name: Set environment variables run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV + echo "TIMESTAMP=${{ steps.date.outputs.date }}" >> $GITHUB_ENV + - name: Set up Go release uses: percona-platform/setup-go@v4 with: go-version: ${{ matrix.go-version }} - - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Start local Kubernetes cluster with the local registry - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - - - name: Login to GitHub Container Registry # !!! move above, prior VS chagnes - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - ref: ${{ env.VS_BRANCH }} - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: perconalab/everest-catalog:test # !!! change tag and repo - - - - name: Apply VS manifest - run: | - kubectl create ns everest-system - # !!! change tag and repo - sed -i "s/perconalab\/version-service:.*/perconalab\/everest-catalog:test/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml -n everest-system - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Catalog - checkout - uses: actions/checkout@v4 - with: - repository: percona/everest-catalog - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if catalog has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi - - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 - fi - - git diff - - - name: Catalog - setup Docker meta for everest-catalog - id: catalog_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-catalog - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Catalog - push everest-catalog image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ steps.catalog_meta.outputs.tags }} - file: everest-catalog/everest-catalog.Dockerfile - - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - ref: EVEREST-1563-operator-early-adoption # !!! delete before merge - - - name: Everest - setup golang - uses: actions/setup-go@v5 - with: - go-version-file: "./go.mod" - - - - name: Everest - update sources - run: | - # Update deploy manifest - sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - - # Change version in Makefile - sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - - # Change release manifest link: use local path to the manifest file in version.go - sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - if [[ $IS_RC == 1 ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: perconalab/everest:${{ env.VERSION }} - - - name: Provision Everest using CLI - shell: bash - run: | - make feature-build-cli - ./bin/everestctl install -v \ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest +# +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Start local Kubernetes cluster with the local registry +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# ref: ${{ env.VS_BRANCH }} +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: perconalab/version-service:${{ env.VERSION }} +# +# +# - name: Apply VS manifest +# run: | +# kubectl create ns everest-system +# # !!! change tag and repo +# sed -i "s/perconalab\/version-service:.*/perconalab\/everest-catalog:test/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml -n everest-system +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system +# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: Catalog - checkout +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-catalog +# path: everest-catalog +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if catalog has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi +# +# # Add a new record to the upstream veneer +# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml +# +# # Generate upstream catalog +# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml +# +# # Check if upstream catalog has the new image listed +# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then +# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" +# exit 1 +# fi +# +# git diff +# +# - name: Catalog - setup Docker meta for everest-catalog +# id: catalog_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-catalog +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Catalog - push everest-catalog image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ steps.catalog_meta.outputs.tags }} +# file: everest-catalog/everest-catalog.Dockerfile +# +# +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# ref: EVEREST-1563-operator-early-adoption # !!! delete before merge +# +# - name: Everest - setup golang +# uses: actions/setup-go@v5 +# with: +# go-version-file: "./go.mod" +# +# +# - name: Everest - update sources +# run: | +# # Update deploy manifest +# sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml +# +# # Change version in Makefile +# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile +# +# # Change release manifest link: use local path to the manifest file in version.go +# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go +# +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# if [[ $IS_RC == 1 ]]; then +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# else +# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release +# fi +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: perconalab/everest:${{ env.VERSION }} +# +# - name: Provision Everest using CLI +# shell: bash +# run: | +# make feature-build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest From 1a05a8fba846cc14abb0d48cac620fbf503f05fd Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 17:11:57 +0200 Subject: [PATCH 112/179] version & ts --- .github/workflows/operator-early-adoption.yaml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 26314de6c..b614b8a39 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -43,14 +43,11 @@ jobs: runs-on: ubuntu-20.04 env: - # VERSION constant higher than any potentially existing - VERSION: 1.10000.0-rc20241121125600 + VERSION: "" CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 VS_URL: "" - LOCAL_REGISTRY_PORT: 5000 - LOCAL_REGISTRY: "" ARCH: "" OS: "" TOOLS_PATH: "/opt/tools/bin" @@ -72,10 +69,9 @@ jobs: run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV - echo "LOCAL_REGISTRY=localhost:$LOCAL_REGISTRY_PORT" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV echo "TIMESTAMP=${{ steps.date.outputs.date }}" >> $GITHUB_ENV - + echo "VERSION=1.10000.0-rc${{ steps.date.outputs.date }}" >> $GITHUB_ENV - name: Set up Go release uses: percona-platform/setup-go@v4 From 001bceb214c80d80bb0d95adff251bbe6cd14e4b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 17:16:55 +0200 Subject: [PATCH 113/179] notification --- .github/workflows/operator-early-adoption.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index b614b8a39..0c6d6e24f 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -77,6 +77,11 @@ jobs: uses: percona-platform/setup-go@v4 with: go-version: ${{ matrix.go-version }} + + - name: Print message + run: | + echo "::notice title=Feature Build Created::The $VERSION feature build has been created." + # # - name: Set GO_VERSION environment variable # run: | From 144432d8cdd514999b3b778a352a1c970db0f90b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 17:23:00 +0200 Subject: [PATCH 114/179] use GITHUB_OUTPUT --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 0c6d6e24f..131da4446 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -63,7 +63,7 @@ jobs: - name: Get current date id: date run: | - echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" + echo "date=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" - name: Set environment variables run: | From c43536088c69efbd394055339e115e40cf574195 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 17:50:15 +0200 Subject: [PATCH 115/179] test --- .../workflows/operator-early-adoption.yaml | 69 ++++++++++--------- 1 file changed, 36 insertions(+), 33 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 131da4446..9252b2a0b 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -57,7 +57,10 @@ jobs: # IMAGE: ${{ github.event.inputs.image }} IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" VS_BRANCH: ${{ github.event.inputs.vs_branch }} - TIMESTAMP: "" + VS_TAG: "" + TIMESTAMP: "$(date +'%Y%m%d%H%M%S')" + AAA: "1.10000.0-rc${{ env.TIMESTAMP }}" + BBB: "everest-test${{ env.TIMESTAMP }}" steps: - name: Get current date @@ -67,21 +70,20 @@ jobs: - name: Set environment variables run: | + TIMESTAMP=$(date +'%Y%m%d%H%M%S') echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - echo "TIMESTAMP=${{ steps.date.outputs.date }}" >> $GITHUB_ENV - echo "VERSION=1.10000.0-rc${{ steps.date.outputs.date }}" >> $GITHUB_ENV - - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Print message - run: | - echo "::notice title=Feature Build Created::The $VERSION feature build has been created." + echo "VERSION=1.10000.0-rc$TIMESTAMP" >> $GITHUB_ENV + echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV + + +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# # # - name: Set GO_VERSION environment variable # run: | @@ -105,13 +107,6 @@ jobs: # ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- # ${{ matrix.os }}-go-${{ matrix.go-version }}-build- # -# - name: Start local Kubernetes cluster with the local registry -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# # - name: Login to GitHub Container Registry # uses: docker/login-action@v3 # with: @@ -145,8 +140,7 @@ jobs: # - name: Apply VS manifest # run: | # kubectl create ns everest-system -# # !!! change tag and repo -# sed -i "s/perconalab\/version-service:.*/perconalab\/everest-catalog:test/g" percona-version-service/deploy.yaml +# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:everest-test$TIMESTAMP/g" percona-version-service/deploy.yaml # kubectl apply -f percona-version-service/deploy.yaml -n everest-system # kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system # kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & @@ -330,15 +324,24 @@ jobs: # push: true # tags: perconalab/everest:${{ env.VERSION }} # -# - name: Provision Everest using CLI -# shell: bash -# run: | -# make feature-build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest +# - name: Start local Kubernetes cluster +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m + + - name: Check the Feature build can be installed successfully + shell: bash + run: | + #make feature-build-cli + #./bin/everestctl install -v \ + # --version $VERSION \ + # --version-metadata-url $VS_URL \ + # --operator.mongodb \ + # --operator.postgresql \ + # --operator.xtradb-cluster \ + # --skip-wizard \ + # --namespaces everest + + echo "::notice title=Feature Build Created::The $VERSION feature build has been created." From 59a7f71f436be7c8d0a5c2b8e3d9bf845dace094 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 17:51:54 +0200 Subject: [PATCH 116/179] test --- .github/workflows/operator-early-adoption.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 9252b2a0b..e233f951c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -59,15 +59,10 @@ jobs: VS_BRANCH: ${{ github.event.inputs.vs_branch }} VS_TAG: "" TIMESTAMP: "$(date +'%Y%m%d%H%M%S')" - AAA: "1.10000.0-rc${{ env.TIMESTAMP }}" - BBB: "everest-test${{ env.TIMESTAMP }}" + AAA: "1.10000.0-rc${TIMESTAMP}" + BBB: "everest-test${env.TIMESTAMP}" steps: - - name: Get current date - id: date - run: | - echo "date=$(date +'%Y%m%d%H%M%S')" >> "$GITHUB_OUTPUT" - - name: Set environment variables run: | TIMESTAMP=$(date +'%Y%m%d%H%M%S') From 21ee092049f4f1e697e2b177e5afa7e6dfff4654 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 18:12:46 +0200 Subject: [PATCH 117/179] test --- .../workflows/operator-early-adoption.yaml | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index e233f951c..5bfc5477a 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -43,37 +43,38 @@ jobs: runs-on: ubuntu-20.04 env: - VERSION: "" + TOOLS_PATH: "/opt/tools/bin" + # IMAGE: ${{ github.event.inputs.image }} + IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" + # !!! revert to using inputs + # UPSTREAM_REPO: ${{ github.event.inputs.upstream }} + VS_BRANCH: ${{ github.event.inputs.vs_branch }} + UPSTREAM_REPO: "percona-xtradb-cluster-operator" CLI_PREREQUISITES: ">= 1.2.0" K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 - VS_URL: "" ARCH: "" OS: "" - TOOLS_PATH: "/opt/tools/bin" - # !!! revert to using inputs - # UPSTREAM_REPO: ${{ github.event.inputs.upstream }} - UPSTREAM_REPO: "percona-xtradb-cluster-operator" - # IMAGE: ${{ github.event.inputs.image }} - IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - VS_BRANCH: ${{ github.event.inputs.vs_branch }} + VERSION: "" + VS_URL: "" VS_TAG: "" - TIMESTAMP: "$(date +'%Y%m%d%H%M%S')" - AAA: "1.10000.0-rc${TIMESTAMP}" - BBB: "everest-test${env.TIMESTAMP}" steps: - name: Set environment variables run: | - TIMESTAMP=$(date +'%Y%m%d%H%M%S') echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV + + TIMESTAMP=$(date +'%Y%m%d%H%M%S') echo "VERSION=1.10000.0-rc$TIMESTAMP" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV - - + - name: output + run: | + echo "::notice title=Feature Build Created::The $VERSION feature build has been created.\n Version Service Image $VS_TAG" + +# # - name: Set up Go release # uses: percona-platform/setup-go@v4 # with: @@ -131,15 +132,6 @@ jobs: # push: true # tags: perconalab/version-service:${{ env.VERSION }} # -# -# - name: Apply VS manifest -# run: | -# kubectl create ns everest-system -# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:everest-test$TIMESTAMP/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -n everest-system -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system -# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# # - name: Operator - check out # uses: actions/checkout@v4 # with: @@ -319,24 +311,32 @@ jobs: # push: true # tags: perconalab/everest:${{ env.VERSION }} # -# - name: Start local Kubernetes cluster +# - name: Everest checks - Start local Kubernetes cluster # uses: medyagh/setup-minikube@latest # id: minikube # with: # cpus: 2 # memory: 2000m - - - name: Check the Feature build can be installed successfully - shell: bash - run: | - #make feature-build-cli - #./bin/everestctl install -v \ - # --version $VERSION \ - # --version-metadata-url $VS_URL \ - # --operator.mongodb \ - # --operator.postgresql \ - # --operator.xtradb-cluster \ - # --skip-wizard \ - # --namespaces everest - - echo "::notice title=Feature Build Created::The $VERSION feature build has been created." +# +# - name: Everest checks - run VS locally +# run: | +# kubectl create ns everest-system +# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml -n everest-system +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system +# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & +# +# - name: Everest checks - install feature build +# shell: bash +# run: | +# make feature-build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest +# +# echo "::notice title=Feature Build Created::The $VERSION feature build has been created." From 3fc540e5d5480c760b161c36949e67c40bc95b99 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 18:14:06 +0200 Subject: [PATCH 118/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 5bfc5477a..608e53ed0 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -72,7 +72,7 @@ jobs: - name: output run: | - echo "::notice title=Feature Build Created::The $VERSION feature build has been created.\n Version Service Image $VS_TAG" + echo "::notice title=Feature Build $VERSION is Created::Version Service Image is $VS_TAG" # # - name: Set up Go release From 6b3019a84b2fc56a3cc5cc913cb15453bab0d42b Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 18:22:34 +0200 Subject: [PATCH 119/179] test --- .github/workflows/operator-early-adoption.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 608e53ed0..0bf11a45c 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -72,7 +72,7 @@ jobs: - name: output run: | - echo "::notice title=Feature Build $VERSION is Created::Version Service Image is $VS_TAG" + echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" # # - name: Set up Go release From d39781281d2cd5e855fa6dfff9558223e7891ac6 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 22 Nov 2024 18:26:07 +0200 Subject: [PATCH 120/179] uncomment --- .../workflows/operator-early-adoption.yaml | 538 +++++++++--------- 1 file changed, 267 insertions(+), 271 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index 0bf11a45c..f08465129 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -18,9 +18,9 @@ on: - percona-xtradb-cluster-operator - percona-server-mongodb-operator - percona-postgresql-operator - push: # !!! remove before merge - branches: - - EVEREST-1563-operator-early-adoption +# push: # !!! remove before merge +# branches: +# - EVEREST-1563-operator-early-adoption permissions: contents: read @@ -70,273 +70,269 @@ jobs: echo "VERSION=1.10000.0-rc$TIMESTAMP" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV - - name: output + + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + + - name: Set GO_VERSION environment variable run: | - echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + ref: ${{ env.VS_BRANCH }} + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: perconalab/version-service:${{ env.VERSION }} + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - update veneer file + run: | + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ -# -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# ref: ${{ env.VS_BRANCH }} -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: perconalab/version-service:${{ env.VERSION }} -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: Catalog - checkout -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-catalog -# path: everest-catalog -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if catalog has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi -# -# # Add a new record to the upstream veneer -# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml -# -# # Generate upstream catalog -# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml -# -# # Check if upstream catalog has the new image listed -# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then -# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" -# exit 1 -# fi -# -# git diff -# -# - name: Catalog - setup Docker meta for everest-catalog -# id: catalog_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-catalog -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Catalog - push everest-catalog image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ steps.catalog_meta.outputs.tags }} -# file: everest-catalog/everest-catalog.Dockerfile -# -# -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# ref: EVEREST-1563-operator-early-adoption # !!! delete before merge -# -# - name: Everest - setup golang -# uses: actions/setup-go@v5 -# with: -# go-version-file: "./go.mod" -# -# -# - name: Everest - update sources -# run: | -# # Update deploy manifest -# sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml -# -# # Change version in Makefile -# sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile -# -# # Change release manifest link: use local path to the manifest file in version.go -# sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go -# -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# if [[ $IS_RC == 1 ]]; then -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# else -# CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release -# fi -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: perconalab/everest:${{ env.VERSION }} -# -# - name: Everest checks - Start local Kubernetes cluster -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# -# - name: Everest checks - run VS locally -# run: | -# kubectl create ns everest-system -# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -n everest-system -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system -# kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & -# -# - name: Everest checks - install feature build -# shell: bash -# run: | -# make feature-build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest -# -# echo "::notice title=Feature Build Created::The $VERSION feature build has been created." + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi + + git diff + + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-catalog + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Catalog - push everest-catalog image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.catalog_meta.outputs.tags }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + ref: EVEREST-1563-operator-early-adoption # !!! delete before merge + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + + - name: Everest - update sources + run: | + # Update deploy manifest + sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml + + # Change version in Makefile + sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile + + # Change release manifest link: use local path to the manifest file in version.go + sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go + + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: perconalab/everest:${{ env.VERSION }} + + - name: Everest checks - Start local Kubernetes cluster + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + + - name: Everest checks - run VS locally + run: | + kubectl create ns everest-system + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + + - name: Everest checks - install feature build + shell: bash + run: | + make feature-build-cli + ./bin/everestctl install -v \ + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest + + echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" From 5de531daebd9ca3eaf681f5cade51635a0decc4c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 25 Nov 2024 12:06:53 +0200 Subject: [PATCH 121/179] align input parameters with doc --- .../workflows/operator-early-adoption.yaml | 93 +++++++++++++------ 1 file changed, 65 insertions(+), 28 deletions(-) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index f08465129..c414301b1 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -3,24 +3,41 @@ name: Custom build on: workflow_dispatch: inputs: + everest_branch: + required: false + default: main + description: "Everest branch with the new build to checkout" + everest_operator_branch: + required: false + default: main + description: "Everest operator branch with the new build to checkout" vs_branch: - required: true + required: false default: main description: "Version Service branch with the new build to checkout" - image: - required: true - description: "Full name of the upstream image to test" - upstream: + upstream_operator: type: choice - description: "The upstream operator" - required: true + description: "The upstream operator to upgrade" + required: false options: + - "" - percona-xtradb-cluster-operator - percona-server-mongodb-operator - percona-postgresql-operator -# push: # !!! remove before merge -# branches: -# - EVEREST-1563-operator-early-adoption + upstream_operator_bundle_image: + required: false + description: "Full name of the upstream bundle image to test" + cli_prerequisites: + required: false + description: "Prerequisites for CLI to add to the VS" + default: ">= 1.2.0" + k8s_prerequisites: + required: false + description: "Prerequisites for k8s version to add to the VS" + default: ">= 1.27" + push: # !!! remove before merge + branches: + - EVEREST-1563-operator-early-adoption permissions: contents: read @@ -44,13 +61,27 @@ jobs: env: TOOLS_PATH: "/opt/tools/bin" - # IMAGE: ${{ github.event.inputs.image }} - IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - # !!! revert to using inputs - # UPSTREAM_REPO: ${{ github.event.inputs.upstream }} + VS_BRANCH: ${{ github.event.inputs.vs_branch }} + + # !!! revert before merge to using inputs + #EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} + EVEREST_BRANCH: "EVEREST-1563-operator-early-adoption" + + EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} + + # !!! revert before merge to using inputs + # IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} + IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" + + # !!! revert before merge to using inputs + # UPSTREAM_REPO: ${{ github.event.inputs.upstream-operator }} UPSTREAM_REPO: "percona-xtradb-cluster-operator" + + # !!! revert before merge to using inputs CLI_PREREQUISITES: ">= 1.2.0" + # CLI_PREREQUISITES: ${{ github.event.inputs.cli_prerequisites }} + K8S_PREREQUISITES: ">= 1.27" VS_PORT: 8081 ARCH: "" @@ -66,7 +97,9 @@ jobs: echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - TIMESTAMP=$(date +'%Y%m%d%H%M%S') + # !!! revert before merge + # TIMESTAMP=$(date +'%Y%m%d%H%M%S') + TIMESTAMP="20241125120500" echo "VERSION=1.10000.0-rc$TIMESTAMP" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV @@ -132,6 +165,7 @@ jobs: uses: actions/checkout@v4 with: repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} path: everest-operator token: ${{ secrets.ROBOT_TOKEN }} @@ -217,19 +251,22 @@ jobs: echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" exit 1 fi - - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 + + # If the feature build contains upstream upgrades + if [ -n "$UPSTREAM_REPO" ]; then + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi fi - + git diff - name: Catalog - setup Docker meta for everest-catalog @@ -254,7 +291,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.ROBOT_TOKEN }} - ref: EVEREST-1563-operator-early-adoption # !!! delete before merge + ref: ${{ env.EVEREST_BRANCH }} - name: Everest - setup golang uses: actions/setup-go@v5 From ce9e8151c343704db66b5dde1495b0a0035a5176 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 25 Nov 2024 12:11:07 +0200 Subject: [PATCH 122/179] use k8s prerequisites input --- .github/workflows/operator-early-adoption.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/operator-early-adoption.yaml index c414301b1..a17a02d8b 100644 --- a/.github/workflows/operator-early-adoption.yaml +++ b/.github/workflows/operator-early-adoption.yaml @@ -82,7 +82,10 @@ jobs: CLI_PREREQUISITES: ">= 1.2.0" # CLI_PREREQUISITES: ${{ github.event.inputs.cli_prerequisites }} + # !!! revert before merge to using inputs K8S_PREREQUISITES: ">= 1.27" + # K8S_PREREQUISITES: ${{ github.event.inputs.k8s_prerequisites }} + VS_PORT: 8081 ARCH: "" OS: "" From d2d5462aa7a926eff752fc5cf10428068b42f3f7 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 25 Nov 2024 15:54:38 +0200 Subject: [PATCH 123/179] rename workflow file --- .../{operator-early-adoption.yaml => feature-build.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{operator-early-adoption.yaml => feature-build.yaml} (100%) diff --git a/.github/workflows/operator-early-adoption.yaml b/.github/workflows/feature-build.yaml similarity index 100% rename from .github/workflows/operator-early-adoption.yaml rename to .github/workflows/feature-build.yaml From bed2ef3d30c9f8b322fc1437b63e30db688d000e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 15:16:49 +0200 Subject: [PATCH 124/179] cleanup changes of deleted code --- .github/workflows/feature-build.yaml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a17a02d8b..b17f8fe5e 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -301,19 +301,6 @@ jobs: with: go-version-file: "./go.mod" - - - name: Everest - update sources - run: | - # Update deploy manifest - sed -i "s/perconalab\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - sed -i "s/percona\/everest.*/perconalab\/everest:$VERSION/g" deploy/quickstart-k8s.yaml - - # Change version in Makefile - sed -i "s/RELEASE_VERSION ?=.*/RELEASE_VERSION ?= v$VERSION/g" Makefile - - # Change release manifest link: use local path to the manifest file in version.go - sed -i "s/https:\/\/raw.githubusercontent.com\/percona\/everest\/v%s\///g" pkg/version/version.go - - name: Everest UI - setup pnpm uses: pnpm/action-setup@v4 with: @@ -335,9 +322,9 @@ jobs: - name: Everest - build binary run: | if [[ $IS_RC == 1 ]]; then - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc else - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release fi - name: Everest - push Everest image From e1851d9828325da4815b26b510cb2f6a68597354 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:09:49 +0200 Subject: [PATCH 125/179] test --- .github/workflows/feature-build.yaml | 377 ++++++++++++++------------- 1 file changed, 189 insertions(+), 188 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index b17f8fe5e..00f394368 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -149,203 +149,204 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: perconalab/version-service:${{ env.VERSION }} - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Catalog - checkout - uses: actions/checkout@v4 - with: - repository: percona/everest-catalog - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if catalog has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi - - # If the feature build contains upstream upgrades - if [ -n "$UPSTREAM_REPO" ]; then - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 - fi - fi - - git diff - - - name: Catalog - setup Docker meta for everest-catalog - id: catalog_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-catalog - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Catalog - push everest-catalog image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ steps.catalog_meta.outputs.tags }} - file: everest-catalog/everest-catalog.Dockerfile - - +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: perconalab/version-service:${{ env.VERSION }} +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: Catalog - checkout +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-catalog +# path: everest-catalog +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if catalog has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi +# +# # If the feature build contains upstream upgrades +# if [ -n "$UPSTREAM_REPO" ]; then +# # Add a new record to the upstream veneer +# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml +# +# # Generate upstream catalog +# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml +# +# # Check if upstream catalog has the new image listed +# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then +# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" +# exit 1 +# fi +# fi +# +# git diff +# +# - name: Catalog - setup Docker meta for everest-catalog +# id: catalog_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-catalog +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Catalog - push everest-catalog image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ steps.catalog_meta.outputs.tags }} +# file: everest-catalog/everest-catalog.Dockerfile +# +# - name: Everest - check out uses: actions/checkout@v4 with: token: ${{ secrets.ROBOT_TOKEN }} ref: ${{ env.EVEREST_BRANCH }} - - - name: Everest - setup golang - uses: actions/setup-go@v5 - with: - go-version-file: "./go.mod" - - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - if [[ $IS_RC == 1 ]]; then - RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: perconalab/everest:${{ env.VERSION }} - - - name: Everest checks - Start local Kubernetes cluster - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m +# +# - name: Everest - setup golang +# uses: actions/setup-go@v5 +# with: +# go-version-file: "./go.mod" +# +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# if [[ $IS_RC == 1 ]]; then +# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# else +# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release +# fi +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: perconalab/everest:${{ env.VERSION }} +# +# - name: Everest checks - Start local Kubernetes cluster +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m - name: Everest checks - run VS locally run: | - kubectl create ns everest-system + ls + pwd sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml -n everest-system + kubectl apply -f percona-version-service/deploy.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & From a2ebbfb5a65bfbac550be15816911312624185ef Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:13:33 +0200 Subject: [PATCH 126/179] test --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 00f394368..8245b3b80 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -345,7 +345,7 @@ jobs: run: | ls pwd - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" ../percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & From 69d62ffd6954610d9f37f938e0552a05ebf331e4 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:19:23 +0200 Subject: [PATCH 127/179] test --- .github/workflows/feature-build.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 8245b3b80..5cc162cdb 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -345,6 +345,12 @@ jobs: run: | ls pwd + echo "---" + cd .. + ls + echo "---" + cd .. + ls sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" ../percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system From b10e0fba026cbb1d98f70d504a6a091dafac3123 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:21:26 +0200 Subject: [PATCH 128/179] test --- .github/workflows/feature-build.yaml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 5cc162cdb..b228be710 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -163,6 +163,13 @@ jobs: # context: percona-version-service # push: true # tags: perconalab/version-service:${{ env.VERSION }} + + - name: Everest checks - run VS locally + run: | + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system + kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & # # - name: Operator - check out # uses: actions/checkout@v4 @@ -341,20 +348,6 @@ jobs: # cpus: 2 # memory: 2000m - - name: Everest checks - run VS locally - run: | - ls - pwd - echo "---" - cd .. - ls - echo "---" - cd .. - ls - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" ../percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & - name: Everest checks - install feature build shell: bash From 0191885c0305925f9dc7b8d507b11b19a8588a4d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:26:00 +0200 Subject: [PATCH 129/179] test --- .github/workflows/feature-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index b228be710..24e9fc6cf 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -168,8 +168,8 @@ jobs: run: | sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml kubectl apply -f percona-version-service/deploy.yaml - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -n everest-system - kubectl port-forward svc/percona-version-service $VS_PORT:80 -n everest-system & + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service + kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - check out # uses: actions/checkout@v4 From 87d0852d9309778be3bc180d4b8d3bffc9ad48fd Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 17:53:16 +0200 Subject: [PATCH 130/179] test --- .github/workflows/feature-build.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 24e9fc6cf..ffcfae840 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -164,12 +164,18 @@ jobs: # push: true # tags: perconalab/version-service:${{ env.VERSION }} - - name: Everest checks - run VS locally + - name: Run VS locally run: | sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + echo "--- 1" kubectl apply -f percona-version-service/deploy.yaml + echo "--- 2" kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service + echo "--- 3" + kubectl get svc/percona-version-service -o yaml + kubectl get po -A -o yaml kubectl port-forward svc/percona-version-service $VS_PORT:80 & + echo "--- 4" # # - name: Operator - check out # uses: actions/checkout@v4 From 81adb5ce0d86db0ada917e7e5f260f51864a928e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 18:09:31 +0200 Subject: [PATCH 131/179] vstag --- .github/workflows/feature-build.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index ffcfae840..cf47648be 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -149,20 +149,20 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: perconalab/version-service:${{ env.VERSION }} + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: perconalab/version-service:${{ env.VS_TAG }} - name: Run VS locally run: | From 4241c2a8e7d59686040a865cdb28b053162cece0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 18:15:23 +0200 Subject: [PATCH 132/179] test --- .github/workflows/feature-build.yaml | 29 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index cf47648be..008120fd7 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -149,24 +149,25 @@ jobs: path: percona-version-service token: ${{ secrets.ROBOT_TOKEN }} - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: perconalab/version-service:${{ env.VS_TAG }} +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: perconalab/version-service:${{ env.VS_TAG }} - name: Run VS locally run: | sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + cat percona-version-service/deploy.yaml echo "--- 1" kubectl apply -f percona-version-service/deploy.yaml echo "--- 2" From 4e30e7170e4664ab1de68cea319ad916b0cda850 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 18:30:39 +0200 Subject: [PATCH 133/179] test --- .github/workflows/feature-build.yaml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 008120fd7..7a677e533 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -164,19 +164,22 @@ jobs: # push: true # tags: perconalab/version-service:${{ env.VS_TAG }} + - name: Everest checks - Start local Kubernetes cluster + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + - name: Run VS locally run: | sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml - cat percona-version-service/deploy.yaml - echo "--- 1" kubectl apply -f percona-version-service/deploy.yaml - echo "--- 2" kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service - echo "--- 3" kubectl get svc/percona-version-service -o yaml kubectl get po -A -o yaml kubectl port-forward svc/percona-version-service $VS_PORT:80 & - echo "--- 4" + # # - name: Operator - check out # uses: actions/checkout@v4 @@ -348,12 +351,7 @@ jobs: # push: true # tags: perconalab/everest:${{ env.VERSION }} # -# - name: Everest checks - Start local Kubernetes cluster -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m + - name: Everest checks - install feature build From a6829ac9eec29abb9ef8ae83512fadf16bfabee4 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Wed, 27 Nov 2024 18:48:11 +0200 Subject: [PATCH 134/179] checkout helm --- .github/workflows/feature-build.yaml | 90 +++++++++++++++------------- 1 file changed, 50 insertions(+), 40 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 7a677e533..b9b6db6b3 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -141,14 +141,22 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: VS - checkout + - name: Helm - checkout uses: actions/checkout@v4 with: - repository: Percona-Lab/percona-version-service - ref: ${{ env.VS_BRANCH }} - path: percona-version-service + repository: percona/percona-helm-charts + path: percona-helm-charts token: ${{ secrets.ROBOT_TOKEN }} +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# ref: ${{ env.VS_BRANCH }} +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} + + # - name: VS - update # run: | # cd percona-version-service @@ -164,21 +172,23 @@ jobs: # push: true # tags: perconalab/version-service:${{ env.VS_TAG }} - - name: Everest checks - Start local Kubernetes cluster - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - - name: Run VS locally - run: | - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service - kubectl get svc/percona-version-service -o yaml - kubectl get po -A -o yaml - kubectl port-forward svc/percona-version-service $VS_PORT:80 & + +# - name: Start local Kubernetes cluster +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# +# - name: Run VS locally +# run: | +# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml +# kubectl apply -f percona-version-service/deploy.yaml +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service +# kubectl get svc/percona-version-service -o yaml +# kubectl get po -A -o yaml +# kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - check out @@ -307,11 +317,11 @@ jobs: # file: everest-catalog/everest-catalog.Dockerfile # # - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - ref: ${{ env.EVEREST_BRANCH }} +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# ref: ${{ env.EVEREST_BRANCH }} # # - name: Everest - setup golang # uses: actions/setup-go@v5 @@ -351,20 +361,20 @@ jobs: # push: true # tags: perconalab/everest:${{ env.VERSION }} # - - - - - name: Everest checks - install feature build - shell: bash - run: | - make feature-build-cli - ./bin/everestctl install -v \ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest - - echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" +# +# +# +# - name: Everest checks - install feature build +# shell: bash +# run: | +# make feature-build-cli +# ./bin/everestctl install -v \ +# --version $VERSION \ +# --version-metadata-url $VS_URL \ +# --operator.mongodb \ +# --operator.postgresql \ +# --operator.xtradb-cluster \ +# --skip-wizard \ +# --namespaces everest +# +# echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" From 11067f9421b57354c23409be28115eca54121997 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 10:22:02 +0200 Subject: [PATCH 135/179] use local helm --- .github/workflows/feature-build.yaml | 37 +++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index b9b6db6b3..045f94cbd 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -148,6 +148,14 @@ jobs: path: percona-helm-charts token: ${{ secrets.ROBOT_TOKEN }} + - name: Helm - build + run: | + cd percona-helm-charts/charts/everest + CRD_VERSION=v${{ env.VERSION }} make crds-gen + make release-dev + + + # - name: VS - checkout # uses: actions/checkout@v4 # with: @@ -364,17 +372,18 @@ jobs: # # # -# - name: Everest checks - install feature build -# shell: bash -# run: | -# make feature-build-cli -# ./bin/everestctl install -v \ -# --version $VERSION \ -# --version-metadata-url $VS_URL \ -# --operator.mongodb \ -# --operator.postgresql \ -# --operator.xtradb-cluster \ -# --skip-wizard \ -# --namespaces everest -# -# echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" + - name: Everest checks - install feature build + shell: bash + run: | + make feature-build-cli + ./bin/everestctl install -v \ + --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest + + echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" From f55fa92b84b975d3693ca4f5eaee7d0bc1016928 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 11:11:13 +0200 Subject: [PATCH 136/179] use local operator repo --- .github/workflows/feature-build.yaml | 68 +++++++++++++++------------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 045f94cbd..a591e62d7 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -141,6 +141,40 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + make build manifests bundle + git tag $VERSION + - name: Helm - checkout uses: actions/checkout@v4 with: @@ -151,7 +185,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - CRD_VERSION=v${{ env.VERSION }} make crds-gen + EVEREST_REPO_URL=${{GITHUB_WORKSPACE}}/everest-operator CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev @@ -199,37 +233,7 @@ jobs: # kubectl port-forward svc/percona-version-service $VS_PORT:80 & # -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle + # # - name: Operator - setup Docker meta for everest-operator # id: operator_meta From 3e757d69d099af619b3bf6cd875cee96c0b1e326 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 11:20:14 +0200 Subject: [PATCH 137/179] use local operator repo --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a591e62d7..64e1901e4 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -185,7 +185,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - EVEREST_REPO_URL=${{GITHUB_WORKSPACE}}/everest-operator CRD_VERSION=v${{ env.VERSION }} make crds-gen + EVEREST_REPO_URL=$GITHUB_WORKSPACE/everest-operator CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev From ff134464843c71320202b71c5188f78d4cab6deb Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 11:26:51 +0200 Subject: [PATCH 138/179] use crd --- .github/workflows/feature-build.yaml | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 64e1901e4..5f49d8eb0 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -142,38 +142,38 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - make build manifests bundle - git tag $VERSION +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# make build manifests bundle +# git tag $VERSION - name: Helm - checkout uses: actions/checkout@v4 @@ -185,7 +185,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - EVEREST_REPO_URL=$GITHUB_WORKSPACE/everest-operator CRD_VERSION=v${{ env.VERSION }} make crds-gen + EVEREST_REPO_URL="" CRD_DIR=$GITHUB_WORKSPACE/everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev From 43f8137f0ff93d4c0abd06316d8fa38cabeb0a36 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 11:27:54 +0200 Subject: [PATCH 139/179] operator --- .github/workflows/feature-build.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 5f49d8eb0..40cee5066 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -142,13 +142,13 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} # # - name: Operator - install operator-sdk # run: | @@ -169,11 +169,11 @@ jobs: # chmod +x operator-sdk_${OS}_${ARCH} # mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk # -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# make build manifests bundle -# git tag $VERSION + - name: Operator - build and bundle + run: | + cd everest-operator + # make build manifests bundle # !!! uncomment + git tag $VERSION - name: Helm - checkout uses: actions/checkout@v4 From 0167b041ec812ae2cf7d8d3c6af9e3a3b7bb947e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 11:29:43 +0200 Subject: [PATCH 140/179] operator --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 40cee5066..454a627f6 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -185,7 +185,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - EVEREST_REPO_URL="" CRD_DIR=$GITHUB_WORKSPACE/everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen + EVEREST_REPO_URL="" CRD_DIR=everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev From 4cf960f913bab54e912c5d1dabe2b3fdbdc5c2a0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 12:59:26 +0200 Subject: [PATCH 141/179] push operator branch --- .github/workflows/feature-build.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 454a627f6..9a283edae 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -172,8 +172,16 @@ jobs: - name: Operator - build and bundle run: | cd everest-operator + git checkout -b $VERSION # make build manifests bundle # !!! uncomment - git tag $VERSION + + # configure userdata for commits + git config --global user.email "everest-ci@percona.com" + git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + + # commit and push the updated files + git commit -a -m "operator manifests" + git push origin $VERSION - name: Helm - checkout uses: actions/checkout@v4 @@ -185,7 +193,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - EVEREST_REPO_URL="" CRD_DIR=everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen + CRD_DIR=everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev From e8092e8a62c87fc327a32a12d75fb38c9a4aa0b1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 14:52:12 +0200 Subject: [PATCH 142/179] push operator branch --- .github/workflows/feature-build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 9a283edae..8b7665601 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -173,7 +173,7 @@ jobs: run: | cd everest-operator git checkout -b $VERSION - # make build manifests bundle # !!! uncomment + make build manifests bundle # configure userdata for commits git config --global user.email "everest-ci@percona.com" @@ -181,6 +181,7 @@ jobs: # commit and push the updated files git commit -a -m "operator manifests" + # to build crds in helm, the remote ref with the version name should exist git push origin $VERSION - name: Helm - checkout From a1fa67546f48aaedeae311231305aa8f813b1e9f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 14:56:17 +0200 Subject: [PATCH 143/179] operator --- .github/workflows/feature-build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 8b7665601..f98ccc36c 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -172,7 +172,7 @@ jobs: - name: Operator - build and bundle run: | cd everest-operator - git checkout -b $VERSION + git checkout -b v$VERSION make build manifests bundle # configure userdata for commits @@ -182,7 +182,7 @@ jobs: # commit and push the updated files git commit -a -m "operator manifests" # to build crds in helm, the remote ref with the version name should exist - git push origin $VERSION + git push origin v$VERSION - name: Helm - checkout uses: actions/checkout@v4 From 9571f04a0246ad061bbc714537485a6a28392dba Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:00:39 +0200 Subject: [PATCH 144/179] operator --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index f98ccc36c..bb21a42e1 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -194,7 +194,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - CRD_DIR=everest-operator/config/crd CRD_VERSION=v${{ env.VERSION }} make crds-gen + CRD_VERSION=v${{ env.VERSION }} make crds-gen make release-dev From a67bd5f60dac34e100a146aa34dd8d84870d55b0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:05:23 +0200 Subject: [PATCH 145/179] run helm --- .github/workflows/feature-build.yaml | 43 ++++++++++++++-------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index bb21a42e1..671dab9b8 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -142,13 +142,13 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} # # - name: Operator - install operator-sdk # run: | @@ -169,20 +169,20 @@ jobs: # chmod +x operator-sdk_${OS}_${ARCH} # mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk # - - name: Operator - build and bundle - run: | - cd everest-operator - git checkout -b v$VERSION - make build manifests bundle - - # configure userdata for commits - git config --global user.email "everest-ci@percona.com" - git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" - - # commit and push the updated files - git commit -a -m "operator manifests" - # to build crds in helm, the remote ref with the version name should exist - git push origin v$VERSION +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# git checkout -b v$VERSION +# make build manifests bundle +# +# # configure userdata for commits +# git config --global user.email "everest-ci@percona.com" +# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" +# +# # commit and push the updated files +# git commit -a -m "operator manifests" +# # to build crds in helm, the remote ref with the version name should exist +# git push origin v$VERSION - name: Helm - checkout uses: actions/checkout@v4 @@ -388,6 +388,7 @@ jobs: - name: Everest checks - install feature build shell: bash run: | + cd $GITHUB_WORKSPACE make feature-build-cli ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest From beaf9feeee7159f9b43b334a01286981075595df Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:08:28 +0200 Subject: [PATCH 146/179] run helm --- .github/workflows/feature-build.yaml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 671dab9b8..5da5101d0 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -338,11 +338,11 @@ jobs: # file: everest-catalog/everest-catalog.Dockerfile # # -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# ref: ${{ env.EVEREST_BRANCH }} + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + ref: ${{ env.EVEREST_BRANCH }} # # - name: Everest - setup golang # uses: actions/setup-go@v5 @@ -388,7 +388,6 @@ jobs: - name: Everest checks - install feature build shell: bash run: | - cd $GITHUB_WORKSPACE make feature-build-cli ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest From 452ed83b358d3e762d9af556426cf39e00b11496 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:10:25 +0200 Subject: [PATCH 147/179] all together --- .github/workflows/feature-build.yaml | 30 +++++++++++++--------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 5da5101d0..5e70d4092 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -225,23 +225,21 @@ jobs: -# - name: Start local Kubernetes cluster -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# -# - name: Run VS locally -# run: | -# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml -# kubectl apply -f percona-version-service/deploy.yaml -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -# kubectl get svc/percona-version-service -o yaml -# kubectl get po -A -o yaml -# kubectl port-forward svc/percona-version-service $VS_PORT:80 & + - name: Start local Kubernetes cluster + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m -# + - name: Run VS locally + run: | + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml + kubectl apply -f percona-version-service/deploy.yaml + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service + kubectl get svc/percona-version-service -o yaml + kubectl get po -A -o yaml + kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - setup Docker meta for everest-operator From c3b397ad3debca36d70b617482674f38e6a7e6bf Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:14:30 +0200 Subject: [PATCH 148/179] checkout VS --- .github/workflows/feature-build.yaml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 5e70d4092..a22666690 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -199,13 +199,13 @@ jobs: -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# ref: ${{ env.VS_BRANCH }} -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + ref: ${{ env.VS_BRANCH }} + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} # - name: VS - update @@ -234,8 +234,9 @@ jobs: - name: Run VS locally run: | - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" percona-version-service/deploy.yaml - kubectl apply -f percona-version-service/deploy.yaml + cd percona-version-service + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml + kubectl apply -f deploy.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service kubectl get svc/percona-version-service -o yaml kubectl get po -A -o yaml From c3403152a43a18aaf9d29ba4e9a9e796fea45a28 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:18:46 +0200 Subject: [PATCH 149/179] build everest --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a22666690..cdbd3d201 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -387,7 +387,7 @@ jobs: - name: Everest checks - install feature build shell: bash run: | - make feature-build-cli + RELEASE_VERSION=$VERSION make feature-build-cli ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest --version $VERSION \ From 5dd1a2ef6eafa4382607f6ae20fa3a40db1eef3e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:25:54 +0200 Subject: [PATCH 150/179] build everest --- .github/workflows/feature-build.yaml | 395 ++++++++++++++------------- 1 file changed, 198 insertions(+), 197 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index cdbd3d201..59e696130 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -90,6 +90,7 @@ jobs: ARCH: "" OS: "" VERSION: "" + VERSION_TAG: "" VS_URL: "" VS_TAG: "" @@ -103,7 +104,9 @@ jobs: # !!! revert before merge # TIMESTAMP=$(date +'%Y%m%d%H%M%S') TIMESTAMP="20241125120500" - echo "VERSION=1.10000.0-rc$TIMESTAMP" >> $GITHUB_ENV + V="1.10000.0-rc$TIMESTAMP" + echo "VERSION=$V" >> $GITHUB_ENV + echo "VERSION_TAG=v$V" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV @@ -142,47 +145,47 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# git checkout -b v$VERSION -# make build manifests bundle -# -# # configure userdata for commits -# git config --global user.email "everest-ci@percona.com" -# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" -# -# # commit and push the updated files -# git commit -a -m "operator manifests" -# # to build crds in helm, the remote ref with the version name should exist -# git push origin v$VERSION + # - name: Operator - check out + # uses: actions/checkout@v4 + # with: + # repository: percona/everest-operator + # ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + # path: everest-operator + # token: ${{ secrets.ROBOT_TOKEN }} + # + # - name: Operator - install operator-sdk + # run: | + # mkdir -p $TOOLS_PATH + # echo $TOOLS_PATH >> $GITHUB_PATH + # + # export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + # curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + # + # gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + # + # curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + # curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + # gpg -u "Operator SDK (release) " --verify checksums.txt.asc + # + # grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + # + # chmod +x operator-sdk_${OS}_${ARCH} + # mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + # + # - name: Operator - build and bundle + # run: | + # cd everest-operator + # git checkout -b $VERSION_TAG + # make build manifests bundle + # + # # configure userdata for commits + # git config --global user.email "everest-ci@percona.com" + # git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + # + # # commit and push the updated files + # git commit -a -m "operator manifests" + # # to build crds in helm, the remote ref with the version name should exist + # git push origin $VERSION_TAG - name: Helm - checkout uses: actions/checkout@v4 @@ -194,7 +197,7 @@ jobs: - name: Helm - build run: | cd percona-helm-charts/charts/everest - CRD_VERSION=v${{ env.VERSION }} make crds-gen + CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen make release-dev @@ -208,20 +211,20 @@ jobs: token: ${{ secrets.ROBOT_TOKEN }} -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: perconalab/version-service:${{ env.VS_TAG }} + # - name: VS - update + # run: | + # cd percona-version-service + # make init + # # create an entry for the new Everest version + # printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + # + # + # - name: Build and Push VS dev image + # uses: docker/build-push-action@v6 + # with: + # context: percona-version-service + # push: true + # tags: perconalab/version-service:${{ env.VS_TAG }} @@ -238,156 +241,154 @@ jobs: sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml kubectl apply -f deploy.yaml kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service - kubectl get svc/percona-version-service -o yaml - kubectl get po -A -o yaml kubectl port-forward svc/percona-version-service $VS_PORT:80 & -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: Catalog - checkout -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-catalog -# path: everest-catalog -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if catalog has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi -# -# # If the feature build contains upstream upgrades -# if [ -n "$UPSTREAM_REPO" ]; then -# # Add a new record to the upstream veneer -# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml -# -# # Generate upstream catalog -# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml -# -# # Check if upstream catalog has the new image listed -# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then -# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" -# exit 1 -# fi -# fi -# -# git diff -# -# - name: Catalog - setup Docker meta for everest-catalog -# id: catalog_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-catalog -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Catalog - push everest-catalog image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ steps.catalog_meta.outputs.tags }} -# file: everest-catalog/everest-catalog.Dockerfile -# -# + # + # - name: Operator - setup Docker meta for everest-operator + # id: operator_meta + # uses: docker/metadata-action@v5 + # with: + # images: | + # perconalab/everest-operator + # tags: | + # type=raw,value=${{ env.VERSION }} + # + # - name: Operator - setup Docker meta for everest-operator-bundle + # id: bundle_meta + # uses: docker/metadata-action@v5 + # with: + # images: | + # perconalab/everest-operator-bundle + # tags: | + # type=raw,value=${{ env.VERSION }} + # + # - name: Operator - push everest-operator image + # uses: docker/build-push-action@v6 + # with: + # context: everest-operator + # push: true + # tags: ${{ steps.operator_meta.outputs.tags }} + # + # - name: Operator - push everest-operator-bundle image + # uses: docker/build-push-action@v6 + # with: + # context: everest-operator + # push: true + # tags: ${{ steps.bundle_meta.outputs.tags }} + # file: everest-operator/bundle.Dockerfile + # + # - name: Catalog - checkout + # uses: actions/checkout@v4 + # with: + # repository: percona/everest-catalog + # path: everest-catalog + # token: ${{ secrets.ROBOT_TOKEN }} + # + # - name: Catalog - update veneer file + # run: | + # cd everest-catalog/tools + # go run . \ + # --veneer-file ../veneer/everest-operator.yaml \ + # --channel fast-v0 \ + # --new-version ${{ env.VERSION }} \ + # + # cd .. + # curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + # chmod +x /tmp/opm + # /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + # + # # Check if catalog has the new version listed + # if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + # echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + # exit 1 + # fi + # + # # If the feature build contains upstream upgrades + # if [ -n "$UPSTREAM_REPO" ]; then + # # Add a new record to the upstream veneer + # yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + # + # # Generate upstream catalog + # /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + # + # # Check if upstream catalog has the new image listed + # if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + # echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + # exit 1 + # fi + # fi + # + # git diff + # + # - name: Catalog - setup Docker meta for everest-catalog + # id: catalog_meta + # uses: docker/metadata-action@v5 + # with: + # images: | + # perconalab/everest-catalog + # tags: | + # type=raw,value=${{ env.VERSION }} + # + # - name: Catalog - push everest-catalog image + # uses: docker/build-push-action@v6 + # with: + # context: everest-catalog + # push: true + # tags: ${{ steps.catalog_meta.outputs.tags }} + # file: everest-catalog/everest-catalog.Dockerfile + # + # - name: Everest - check out uses: actions/checkout@v4 with: token: ${{ secrets.ROBOT_TOKEN }} ref: ${{ env.EVEREST_BRANCH }} -# -# - name: Everest - setup golang -# uses: actions/setup-go@v5 -# with: -# go-version-file: "./go.mod" -# -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# if [[ $IS_RC == 1 ]]; then -# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# else -# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release -# fi -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: perconalab/everest:${{ env.VERSION }} -# -# -# -# + # + # - name: Everest - setup golang + # uses: actions/setup-go@v5 + # with: + # go-version-file: "./go.mod" + # + # - name: Everest UI - setup pnpm + # uses: pnpm/action-setup@v4 + # with: + # version: 9.4.0 + # + # - name: Everest UI - run with Node 20 + # uses: actions/setup-node@v4 + # with: + # node-version: 20.x + # cache: "pnpm" + # cache-dependency-path: ui/pnpm-lock.yaml + # + # - name: Everest UI - build + # run: | + # cd ui + # pnpm install + # EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + # + # - name: Everest - build binary + # run: | + # if [[ $IS_RC == 1 ]]; then + # RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + # else + # RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + # fi + # + # - name: Everest - push Everest image + # uses: docker/build-push-action@v6 + # with: + # context: . + # push: true + # tags: perconalab/everest:${{ env.VERSION }} + # + # + # + # - name: Everest checks - install feature build shell: bash run: | - RELEASE_VERSION=$VERSION make feature-build-cli + RELEASE_VERSION=$VERSION_TAG make feature-build-cli ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest --version $VERSION \ From 8d4897ea987a2909cbb1130a5cad67b0341ad0e8 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:34:27 +0200 Subject: [PATCH 151/179] test --- .github/workflows/feature-build.yaml | 37 +++++++++++++++++----------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 59e696130..cb729e3a6 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -228,20 +228,20 @@ jobs: - - name: Start local Kubernetes cluster - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - - - name: Run VS locally - run: | - cd percona-version-service - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml - kubectl apply -f deploy.yaml - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service - kubectl port-forward svc/percona-version-service $VS_PORT:80 & +# - name: Start local Kubernetes cluster +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# +# - name: Run VS locally +# run: | +# cd percona-version-service +# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml +# kubectl apply -f deploy.yaml +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service +# kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - setup Docker meta for everest-operator @@ -385,10 +385,19 @@ jobs: # # # + - name: Check pwd + shell: bash + run: | + pwd + cd $GITHUB_WORKSPACE/percona-helm-charts/charts/everest + ls + + - name: Everest checks - install feature build shell: bash run: | RELEASE_VERSION=$VERSION_TAG make feature-build-cli + echo "-----" ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest --version $VERSION \ From b1d406bdb39ad5ace79cbbd0cd324175bad5426a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:43:57 +0200 Subject: [PATCH 152/179] copy to workspace --- .github/workflows/feature-build.yaml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index cb729e3a6..87f6eb507 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -199,6 +199,8 @@ jobs: cd percona-helm-charts/charts/everest CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen make release-dev + mkdir ${GITHUB_WORKSPACE}/helm + cp -rvf ./* ${GITHUB_WORKSPACE}/helm/ @@ -385,12 +387,6 @@ jobs: # # # - - name: Check pwd - shell: bash - run: | - pwd - cd $GITHUB_WORKSPACE/percona-helm-charts/charts/everest - ls - name: Everest checks - install feature build @@ -399,7 +395,7 @@ jobs: RELEASE_VERSION=$VERSION_TAG make feature-build-cli echo "-----" ./bin/everestctl install -v \ - --chart-dir $GITHUB_WORKSPACE/percona-helm-charts/charts/everest + --chart-dir $GITHUB_WORKSPACE/helm/charts/everest --version $VERSION \ --version-metadata-url $VS_URL \ --operator.mongodb \ From 51741fac1bf83907b9e1514793461086ff593c5a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:44:33 +0200 Subject: [PATCH 153/179] test --- .github/workflows/feature-build.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 87f6eb507..990a9b42b 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -230,20 +230,20 @@ jobs: -# - name: Start local Kubernetes cluster -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# -# - name: Run VS locally -# run: | -# cd percona-version-service -# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml -# kubectl apply -f deploy.yaml -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -# kubectl port-forward svc/percona-version-service $VS_PORT:80 & + - name: Start local Kubernetes cluster + uses: medyagh/setup-minikube@latest + id: minikube + with: + cpus: 2 + memory: 2000m + + - name: Run VS locally + run: | + cd percona-version-service + sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml + kubectl apply -f deploy.yaml + kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service + kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - setup Docker meta for everest-operator From 42c9d7891026d449c99155e6f551e67e298da46a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 15:52:52 +0200 Subject: [PATCH 154/179] test --- .github/workflows/feature-build.yaml | 31 +++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 990a9b42b..51a815aa6 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -230,20 +230,20 @@ jobs: - - name: Start local Kubernetes cluster - uses: medyagh/setup-minikube@latest - id: minikube - with: - cpus: 2 - memory: 2000m - - - name: Run VS locally - run: | - cd percona-version-service - sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml - kubectl apply -f deploy.yaml - kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service - kubectl port-forward svc/percona-version-service $VS_PORT:80 & +# - name: Start local Kubernetes cluster +# uses: medyagh/setup-minikube@latest +# id: minikube +# with: +# cpus: 2 +# memory: 2000m +# +# - name: Run VS locally +# run: | +# cd percona-version-service +# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml +# kubectl apply -f deploy.yaml +# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service +# kubectl port-forward svc/percona-version-service $VS_PORT:80 & # # - name: Operator - setup Docker meta for everest-operator @@ -394,6 +394,9 @@ jobs: run: | RELEASE_VERSION=$VERSION_TAG make feature-build-cli echo "-----" + cd $GITHUB_WORKSPACE/helm + ls + ./bin/everestctl install -v \ --chart-dir $GITHUB_WORKSPACE/helm/charts/everest --version $VERSION \ From 798a75efc11913fadf0c0f25d8c188b36caabb60 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 16:06:54 +0200 Subject: [PATCH 155/179] test --- .github/workflows/feature-build.yaml | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 51a815aa6..c23c1b4a1 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -201,6 +201,11 @@ jobs: make release-dev mkdir ${GITHUB_WORKSPACE}/helm cp -rvf ./* ${GITHUB_WORKSPACE}/helm/ + - name: Upload Helm Chart + uses: actions/upload-artifact@v3 + with: + name: helm-chart + path: ${GITHUB_WORKSPACE}/helm @@ -387,18 +392,32 @@ jobs: # # # + + - name: Everest checks - install feature build + uses: actions/download-artifact@v3 + with: + name: helm-chart + path: helm + shell: bash + run: | + ./bin/everestctl install -v \ + --chart-dir ./helm + --version $VERSION \ + --version-metadata-url $VS_URL \ + --operator.mongodb \ + --operator.postgresql \ + --operator.xtradb-cluster \ + --skip-wizard \ + --namespaces everest - name: Everest checks - install feature build shell: bash run: | RELEASE_VERSION=$VERSION_TAG make feature-build-cli - echo "-----" - cd $GITHUB_WORKSPACE/helm - ls ./bin/everestctl install -v \ - --chart-dir $GITHUB_WORKSPACE/helm/charts/everest + --chart-dir $GITHUB_WORKSPACE/helm --version $VERSION \ --version-metadata-url $VS_URL \ --operator.mongodb \ From e3c083eccd41a176deb8cc6fdc962f411eee8e72 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 16:08:33 +0200 Subject: [PATCH 156/179] test --- .github/workflows/feature-build.yaml | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index c23c1b4a1..808ebdc92 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -398,18 +398,6 @@ jobs: with: name: helm-chart path: helm - shell: bash - run: | - ./bin/everestctl install -v \ - --chart-dir ./helm - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest - - name: Everest checks - install feature build shell: bash @@ -417,7 +405,7 @@ jobs: RELEASE_VERSION=$VERSION_TAG make feature-build-cli ./bin/everestctl install -v \ - --chart-dir $GITHUB_WORKSPACE/helm + --chart-dir ./helm --version $VERSION \ --version-metadata-url $VS_URL \ --operator.mongodb \ From d89917c7238c50c338c983e3c7ba72124ea8f9b3 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 16:17:44 +0200 Subject: [PATCH 157/179] test --- .github/workflows/feature-build.yaml | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 808ebdc92..267d5bc9a 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -201,12 +201,6 @@ jobs: make release-dev mkdir ${GITHUB_WORKSPACE}/helm cp -rvf ./* ${GITHUB_WORKSPACE}/helm/ - - name: Upload Helm Chart - uses: actions/upload-artifact@v3 - with: - name: helm-chart - path: ${GITHUB_WORKSPACE}/helm - - name: VS - checkout @@ -348,6 +342,7 @@ jobs: - name: Everest - check out uses: actions/checkout@v4 with: + path: ./api token: ${{ secrets.ROBOT_TOKEN }} ref: ${{ env.EVEREST_BRANCH }} # @@ -393,19 +388,17 @@ jobs: # # - - name: Everest checks - install feature build - uses: actions/download-artifact@v3 - with: - name: helm-chart - path: helm - name: Everest checks - install feature build shell: bash run: | + cp -rf ${GITHUB_WORKSPACE}/helm/* ${GITHUB_WORKSPACE}/api + cd ${GITHUB_WORKSPACE}/api + RELEASE_VERSION=$VERSION_TAG make feature-build-cli ./bin/everestctl install -v \ - --chart-dir ./helm + --chart-dir ./ --version $VERSION \ --version-metadata-url $VS_URL \ --operator.mongodb \ From df36e7d17b7c5ab730c2450c7faee6ecf77976c5 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 28 Nov 2024 16:31:08 +0200 Subject: [PATCH 158/179] test --- .github/workflows/feature-build.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 267d5bc9a..acb8c7488 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -393,6 +393,8 @@ jobs: shell: bash run: | cp -rf ${GITHUB_WORKSPACE}/helm/* ${GITHUB_WORKSPACE}/api + pwd + ls cd ${GITHUB_WORKSPACE}/api RELEASE_VERSION=$VERSION_TAG make feature-build-cli From 9efa86a41f9e54452acd89305577414fa3f55e90 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 10:51:48 +0200 Subject: [PATCH 159/179] upload artefacts --- .github/workflows/feature-build.yaml | 119 ++++++++++----------------- 1 file changed, 44 insertions(+), 75 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index acb8c7488..7ade72acd 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -121,28 +121,28 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} +# - name: Enable Go modules cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/go/pkg/mod +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- +# +# - name: Enable Go build cache +# uses: percona-platform/cache@v3 +# with: +# path: ~/.cache/go-build +# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} +# restore-keys: | +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- +# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- +# +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} # - name: Operator - check out @@ -199,17 +199,24 @@ jobs: cd percona-helm-charts/charts/everest CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen make release-dev - mkdir ${GITHUB_WORKSPACE}/helm - cp -rvf ./* ${GITHUB_WORKSPACE}/helm/ + - name: Helm - Create tar.gz archive + run: | + tar -czvf helm.tar.gz charts/everest - - name: VS - checkout - uses: actions/checkout@v4 + - name: Helm - Upload artifact + uses: actions/upload-artifact@v3 with: - repository: Percona-Lab/percona-version-service - ref: ${{ env.VS_BRANCH }} - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} + path: helm.tar.gz + + +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# ref: ${{ env.VS_BRANCH }} +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} # - name: VS - update @@ -226,24 +233,6 @@ jobs: # context: percona-version-service # push: true # tags: perconalab/version-service:${{ env.VS_TAG }} - - - -# - name: Start local Kubernetes cluster -# uses: medyagh/setup-minikube@latest -# id: minikube -# with: -# cpus: 2 -# memory: 2000m -# -# - name: Run VS locally -# run: | -# cd percona-version-service -# sed -i "s/perconalab\/version-service:.*/perconalab\/version-service:$VS_TAG/g" deploy.yaml -# kubectl apply -f deploy.yaml -# kubectl wait --for=jsonpath='{.status.readyReplicas}'=3 deployment/percona-version-service -# kubectl port-forward svc/percona-version-service $VS_PORT:80 & - # # - name: Operator - setup Docker meta for everest-operator # id: operator_meta @@ -339,12 +328,12 @@ jobs: # file: everest-catalog/everest-catalog.Dockerfile # # - - name: Everest - check out - uses: actions/checkout@v4 - with: - path: ./api - token: ${{ secrets.ROBOT_TOKEN }} - ref: ${{ env.EVEREST_BRANCH }} +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# path: ./api +# token: ${{ secrets.ROBOT_TOKEN }} +# ref: ${{ env.EVEREST_BRANCH }} # # - name: Everest - setup golang # uses: actions/setup-go@v5 @@ -389,24 +378,4 @@ jobs: # - - name: Everest checks - install feature build - shell: bash - run: | - cp -rf ${GITHUB_WORKSPACE}/helm/* ${GITHUB_WORKSPACE}/api - pwd - ls - cd ${GITHUB_WORKSPACE}/api - - RELEASE_VERSION=$VERSION_TAG make feature-build-cli - - ./bin/everestctl install -v \ - --chart-dir ./ - --version $VERSION \ - --version-metadata-url $VS_URL \ - --operator.mongodb \ - --operator.postgresql \ - --operator.xtradb-cluster \ - --skip-wizard \ - --namespaces everest - - echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" + From c3af68fd5276eea4da1633719e9ea31438b4cb72 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 10:53:06 +0200 Subject: [PATCH 160/179] upload artefacts --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 7ade72acd..95fbec974 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -202,7 +202,7 @@ jobs: - name: Helm - Create tar.gz archive run: | - tar -czvf helm.tar.gz charts/everest + tar -czvf helm.tar.gz percona-helm-charts/charts/everest - name: Helm - Upload artifact uses: actions/upload-artifact@v3 From 26d87080bfba127c54f702654da89484c5c963b7 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 11:00:48 +0200 Subject: [PATCH 161/179] delete branch from actions --- .github/workflows/feature-build.yaml | 56 +++++++++++++++++----------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 95fbec974..fc52c93f9 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -145,13 +145,13 @@ jobs: # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: Operator - check out - # uses: actions/checkout@v4 - # with: - # repository: percona/everest-operator - # ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - # path: everest-operator - # token: ${{ secrets.ROBOT_TOKEN }} + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} # # - name: Operator - install operator-sdk # run: | @@ -172,20 +172,21 @@ jobs: # chmod +x operator-sdk_${OS}_${ARCH} # mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk # - # - name: Operator - build and bundle - # run: | - # cd everest-operator - # git checkout -b $VERSION_TAG - # make build manifests bundle - # - # # configure userdata for commits - # git config --global user.email "everest-ci@percona.com" - # git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" - # - # # commit and push the updated files - # git commit -a -m "operator manifests" - # # to build crds in helm, the remote ref with the version name should exist - # git push origin $VERSION_TAG + - name: Operator - build and bundle + run: | + cd everest-operator + git checkout -b $VERSION_TAG + make build manifests bundle + + # configure userdata for commits + git config --global user.email "everest-ci@percona.com" + git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + + # commit and push the updated files + git commit -a -m "operator manifests" + # to build crds in helm, the remote ref with the version name should exist + git push origin $VERSION_TAG + - name: Helm - checkout uses: actions/checkout@v4 @@ -209,6 +210,19 @@ jobs: with: path: helm.tar.gz + - name: Operator - check out again + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - build and bundle + run: | + cd everest-operator + git push -d origin $VERSION_TAG + # - name: VS - checkout # uses: actions/checkout@v4 From c55f5630c737c455471779f80b7bcda9d6a8720c Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 11:08:05 +0200 Subject: [PATCH 162/179] output --- .github/workflows/feature-build.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index fc52c93f9..63b4c2c66 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -206,7 +206,7 @@ jobs: tar -czvf helm.tar.gz percona-helm-charts/charts/everest - name: Helm - Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: helm.tar.gz @@ -218,10 +218,11 @@ jobs: path: everest-operator token: ${{ secrets.ROBOT_TOKEN }} - - name: Operator - build and bundle + - name: Operator - delete the feature build branch run: | cd everest-operator git push -d origin $VERSION_TAG + echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" # - name: VS - checkout From aff00700cfb6068469084d233a90286431fdaac8 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 13:04:25 +0200 Subject: [PATCH 163/179] update artifacts --- .github/workflows/feature-build.yaml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 63b4c2c66..dcd9a59f5 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -6,15 +6,19 @@ on: everest_branch: required: false default: main - description: "Everest branch with the new build to checkout" + description: "Everest branch with the feature to checkout" everest_operator_branch: required: false default: main - description: "Everest operator branch with the new build to checkout" + description: "Everest operator branch with the feature to checkout" vs_branch: required: false default: main - description: "Version Service branch with the new build to checkout" + description: "Version Service branch with the feature to checkout" + helm_branch: + required: false + default: main + description: "Helm charts branch with the feature to checkout" upstream_operator: type: choice description: "The upstream operator to upgrade" @@ -63,6 +67,7 @@ jobs: TOOLS_PATH: "/opt/tools/bin" VS_BRANCH: ${{ github.event.inputs.vs_branch }} + HELM_BRANCH: ${{ github.event.inputs.helm_branch }} # !!! revert before merge to using inputs #EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} @@ -192,6 +197,7 @@ jobs: uses: actions/checkout@v4 with: repository: percona/percona-helm-charts + ref: ${{ env.HELM_BRANCH }} path: percona-helm-charts token: ${{ secrets.ROBOT_TOKEN }} @@ -201,9 +207,12 @@ jobs: CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen make release-dev - - name: Helm - Create tar.gz archive - run: | - tar -czvf helm.tar.gz percona-helm-charts/charts/everest + - name: Helm - Upload artefacts + uses: "actions/upload-artifact@v4" + with: + name: "helm" + path: | + ~/percona-helm-charts/charts/everest - name: Helm - Upload artifact uses: actions/upload-artifact@v4 From d01a3635efab81947450ae69cf5a95d6f4390e28 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 13:10:44 +0200 Subject: [PATCH 164/179] update artifacts --- .github/workflows/feature-build.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index dcd9a59f5..849ca9bb3 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -212,12 +212,8 @@ jobs: with: name: "helm" path: | - ~/percona-helm-charts/charts/everest + ${{ GITHUB_WORKSPACE}}/percona-helm-charts/charts/everest - - name: Helm - Upload artifact - uses: actions/upload-artifact@v4 - with: - path: helm.tar.gz - name: Operator - check out again uses: actions/checkout@v4 From bc863e32bf7c3f8c1d438eaf813a564131c80a49 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 13:12:21 +0200 Subject: [PATCH 165/179] update artifacts --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 849ca9bb3..398710be3 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -212,7 +212,7 @@ jobs: with: name: "helm" path: | - ${{ GITHUB_WORKSPACE}}/percona-helm-charts/charts/everest + ${{ GITHUB_WORKSPACE }}/percona-helm-charts/charts/everest - name: Operator - check out again From bf87708ae85c177d247b233848c6c97a56d1665f Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 13:12:47 +0200 Subject: [PATCH 166/179] update artifacts --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 398710be3..c226cf4c6 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -212,7 +212,7 @@ jobs: with: name: "helm" path: | - ${{ GITHUB_WORKSPACE }}/percona-helm-charts/charts/everest + ${{ env.GITHUB_WORKSPACE }}/percona-helm-charts/charts/everest - name: Operator - check out again From 843cf96711847cfac57282abbb9a769dbe742a51 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Fri, 29 Nov 2024 15:17:55 +0200 Subject: [PATCH 167/179] use old way to upload artifacts --- .github/workflows/feature-build.yaml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index c226cf4c6..a3f7dfa33 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -207,13 +207,14 @@ jobs: CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen make release-dev - - name: Helm - Upload artefacts - uses: "actions/upload-artifact@v4" - with: - name: "helm" - path: | - ${{ env.GITHUB_WORKSPACE }}/percona-helm-charts/charts/everest + - name: Helm - Create tar.gz archive + run: | + tar -czvf helm.tar.gz percona-helm-charts/charts/everest + - name: Helm - Upload artifact + uses: actions/upload-artifact@v4 + with: + path: helm.tar.gz - name: Operator - check out again uses: actions/checkout@v4 From 3bfa5f70619131cbcc2c1acd65ac1ada77752a97 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 2 Dec 2024 09:39:59 +0200 Subject: [PATCH 168/179] Uncomment --- .github/workflows/feature-build.yaml | 425 ++++++++++++++------------- 1 file changed, 214 insertions(+), 211 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a3f7dfa33..a80f405e2 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -39,9 +39,9 @@ on: required: false description: "Prerequisites for k8s version to add to the VS" default: ">= 1.27" - push: # !!! remove before merge - branches: - - EVEREST-1563-operator-early-adoption +# push: +# branches: +# - EVEREST-1563-operator-early-adoption permissions: contents: read @@ -126,28 +126,28 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# - name: Enable Go modules cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/go/pkg/mod -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- -# -# - name: Enable Go build cache -# uses: percona-platform/cache@v3 -# with: -# path: ~/.cache/go-build -# key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} -# restore-keys: | -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- -# ${{ matrix.os }}-go-${{ matrix.go-version }}-build- -# -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Enable Go modules cache + uses: percona-platform/cache@v3 + with: + path: ~/go/pkg/mod + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- + + - name: Enable Go build cache + uses: percona-platform/cache@v3 + with: + path: ~/.cache/go-build + key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} + restore-keys: | + ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- + ${{ matrix.os }}-go-${{ matrix.go-version }}-build- + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Operator - check out @@ -157,26 +157,26 @@ jobs: ref: ${{ env.EVEREST_OPERATOR_BRANCH }} path: everest-operator token: ${{ secrets.ROBOT_TOKEN }} - # - # - name: Operator - install operator-sdk - # run: | - # mkdir -p $TOOLS_PATH - # echo $TOOLS_PATH >> $GITHUB_PATH - # - # export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - # curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - # - # gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - # - # curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - # curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - # gpg -u "Operator SDK (release) " --verify checksums.txt.asc - # - # grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - # - # chmod +x operator-sdk_${OS}_${ARCH} - # mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - # + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + - name: Operator - build and bundle run: | cd everest-operator @@ -228,175 +228,178 @@ jobs: run: | cd everest-operator git push -d origin $VERSION_TAG + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + ref: ${{ env.VS_BRANCH }} + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + + - name: VS - update + run: | + cd percona-version-service + make init + # create an entry for the new Everest version + printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" + + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: perconalab/version-service:${{ env.VS_TAG }} + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - update veneer file + run: | + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + # If the feature build contains upstream upgrades + if [ -n "$UPSTREAM_REPO" ]; then + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi + fi + + git diff + + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-catalog + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Catalog - push everest-catalog image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.catalog_meta.outputs.tags }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + path: ./api + token: ${{ secrets.ROBOT_TOKEN }} + ref: ${{ env.EVEREST_BRANCH }} + + - name: Everest - setup golang + uses: actions/setup-go@v5 + with: + go-version-file: "./go.mod" + + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + if [[ $IS_RC == 1 ]]; then + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + else + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release + fi + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: perconalab/everest:${{ env.VERSION }} + + - name: Info + run: | echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# ref: ${{ env.VS_BRANCH }} -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} - - - # - name: VS - update - # run: | - # cd percona-version-service - # make init - # # create an entry for the new Everest version - # printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - # - # - # - name: Build and Push VS dev image - # uses: docker/build-push-action@v6 - # with: - # context: percona-version-service - # push: true - # tags: perconalab/version-service:${{ env.VS_TAG }} - # - # - name: Operator - setup Docker meta for everest-operator - # id: operator_meta - # uses: docker/metadata-action@v5 - # with: - # images: | - # perconalab/everest-operator - # tags: | - # type=raw,value=${{ env.VERSION }} - # - # - name: Operator - setup Docker meta for everest-operator-bundle - # id: bundle_meta - # uses: docker/metadata-action@v5 - # with: - # images: | - # perconalab/everest-operator-bundle - # tags: | - # type=raw,value=${{ env.VERSION }} - # - # - name: Operator - push everest-operator image - # uses: docker/build-push-action@v6 - # with: - # context: everest-operator - # push: true - # tags: ${{ steps.operator_meta.outputs.tags }} - # - # - name: Operator - push everest-operator-bundle image - # uses: docker/build-push-action@v6 - # with: - # context: everest-operator - # push: true - # tags: ${{ steps.bundle_meta.outputs.tags }} - # file: everest-operator/bundle.Dockerfile - # - # - name: Catalog - checkout - # uses: actions/checkout@v4 - # with: - # repository: percona/everest-catalog - # path: everest-catalog - # token: ${{ secrets.ROBOT_TOKEN }} - # - # - name: Catalog - update veneer file - # run: | - # cd everest-catalog/tools - # go run . \ - # --veneer-file ../veneer/everest-operator.yaml \ - # --channel fast-v0 \ - # --new-version ${{ env.VERSION }} \ - # - # cd .. - # curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - # chmod +x /tmp/opm - # /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - # - # # Check if catalog has the new version listed - # if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - # echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - # exit 1 - # fi - # - # # If the feature build contains upstream upgrades - # if [ -n "$UPSTREAM_REPO" ]; then - # # Add a new record to the upstream veneer - # yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - # - # # Generate upstream catalog - # /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - # - # # Check if upstream catalog has the new image listed - # if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - # echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - # exit 1 - # fi - # fi - # - # git diff - # - # - name: Catalog - setup Docker meta for everest-catalog - # id: catalog_meta - # uses: docker/metadata-action@v5 - # with: - # images: | - # perconalab/everest-catalog - # tags: | - # type=raw,value=${{ env.VERSION }} - # - # - name: Catalog - push everest-catalog image - # uses: docker/build-push-action@v6 - # with: - # context: everest-catalog - # push: true - # tags: ${{ steps.catalog_meta.outputs.tags }} - # file: everest-catalog/everest-catalog.Dockerfile - # - # -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# path: ./api -# token: ${{ secrets.ROBOT_TOKEN }} -# ref: ${{ env.EVEREST_BRANCH }} - # - # - name: Everest - setup golang - # uses: actions/setup-go@v5 - # with: - # go-version-file: "./go.mod" - # - # - name: Everest UI - setup pnpm - # uses: pnpm/action-setup@v4 - # with: - # version: 9.4.0 - # - # - name: Everest UI - run with Node 20 - # uses: actions/setup-node@v4 - # with: - # node-version: 20.x - # cache: "pnpm" - # cache-dependency-path: ui/pnpm-lock.yaml - # - # - name: Everest UI - build - # run: | - # cd ui - # pnpm install - # EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - # - # - name: Everest - build binary - # run: | - # if [[ $IS_RC == 1 ]]; then - # RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - # else - # RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - # fi - # - # - name: Everest - push Everest image - # uses: docker/build-push-action@v6 - # with: - # context: . - # push: true - # tags: perconalab/everest:${{ env.VERSION }} - # - # - # - # + + + From 2c3338d81474175e64aac52cc02ef29a29c1cd0e Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 2 Dec 2024 09:41:35 +0200 Subject: [PATCH 169/179] delete install.go --- pkg/install/install.go | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 pkg/install/install.go diff --git a/pkg/install/install.go b/pkg/install/install.go deleted file mode 100644 index e69de29bb..000000000 From a98546352170ea819d940a1b22c3af1d2202e969 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 3 Dec 2024 11:33:33 +0200 Subject: [PATCH 170/179] test build cli artifacts --- .github/workflows/feature-build.yaml | 442 ++++++++++++++------------- 1 file changed, 226 insertions(+), 216 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a80f405e2..e37936579 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -39,9 +39,9 @@ on: required: false description: "Prerequisites for k8s version to add to the VS" default: ">= 1.27" -# push: -# branches: -# - EVEREST-1563-operator-early-adoption + push: + branches: + - EVEREST-1563-operator-early-adoption permissions: contents: read @@ -143,208 +143,210 @@ jobs: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - git checkout -b $VERSION_TAG - make build manifests bundle - - # configure userdata for commits - git config --global user.email "everest-ci@percona.com" - git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" - - # commit and push the updated files - git commit -a -m "operator manifests" - # to build crds in helm, the remote ref with the version name should exist - git push origin $VERSION_TAG - - - - name: Helm - checkout - uses: actions/checkout@v4 - with: - repository: percona/percona-helm-charts - ref: ${{ env.HELM_BRANCH }} - path: percona-helm-charts - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Helm - build - run: | - cd percona-helm-charts/charts/everest - CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen - make release-dev - - - name: Helm - Create tar.gz archive - run: | - tar -czvf helm.tar.gz percona-helm-charts/charts/everest - - - name: Helm - Upload artifact - uses: actions/upload-artifact@v4 - with: - path: helm.tar.gz - - - name: Operator - check out again - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - delete the feature build branch - run: | - cd everest-operator - git push -d origin $VERSION_TAG - - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - ref: ${{ env.VS_BRANCH }} - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - - name: VS - update - run: | - cd percona-version-service - make init - # create an entry for the new Everest version - printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" - - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: perconalab/version-service:${{ env.VS_TAG }} - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Catalog - checkout - uses: actions/checkout@v4 - with: - repository: percona/everest-catalog - path: everest-catalog - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Catalog - update veneer file - run: | - cd everest-catalog/tools - go run . \ - --veneer-file ../veneer/everest-operator.yaml \ - --channel fast-v0 \ - --new-version ${{ env.VERSION }} \ - - cd .. - curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm - chmod +x /tmp/opm - /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml - - # Check if catalog has the new version listed - if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then - echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" - exit 1 - fi - - # If the feature build contains upstream upgrades - if [ -n "$UPSTREAM_REPO" ]; then - # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml - - # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml - - # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" - exit 1 - fi - fi - - git diff - - - name: Catalog - setup Docker meta for everest-catalog - id: catalog_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-catalog - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Catalog - push everest-catalog image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ steps.catalog_meta.outputs.tags }} - file: everest-catalog/everest-catalog.Dockerfile +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# git checkout -b $VERSION_TAG +# make build manifests bundle +# +# # configure userdata for commits +# git config --global user.email "everest-ci@percona.com" +# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" +# +# # commit and push the updated files +# git commit -a -m "operator manifests" +# # to build crds in helm, the remote ref with the version name should exist +# git push origin $VERSION_TAG +# +# +# - name: Helm - checkout +# uses: actions/checkout@v4 +# with: +# repository: percona/percona-helm-charts +# ref: ${{ env.HELM_BRANCH }} +# path: percona-helm-charts +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Helm - build +# run: | +# cd percona-helm-charts/charts/everest +# CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen +# make release-dev +# +# - name: Helm - Create tar.gz archive +# run: | +# tar -czvf helm.tar.gz percona-helm-charts/charts/everest +# +# - name: Helm - Upload artifact +# uses: actions/upload-artifact@v4 +# with: +# name: helm +# path: helm.tar.gz +# +# - name: Operator - check out again +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - delete the feature build branch +# run: | +# cd everest-operator +# git push -d origin $VERSION_TAG +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# ref: ${{ env.VS_BRANCH }} +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} +# +# +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# # create an entry for the new Everest version +# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" +# +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: perconalab/version-service:${{ env.VS_TAG }} +# +# +# - name: Catalog - checkout +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-catalog +# path: everest-catalog +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Catalog - update veneer file +# run: | +# cd everest-catalog/tools +# go run . \ +# --veneer-file ../veneer/everest-operator.yaml \ +# --channel fast-v0 \ +# --new-version ${{ env.VERSION }} \ +# +# cd .. +# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm +# chmod +x /tmp/opm +# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml +# +# # Check if catalog has the new version listed +# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then +# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" +# exit 1 +# fi +# +# # If the feature build contains upstream upgrades +# if [ -n "$UPSTREAM_REPO" ]; then +# # Add a new record to the upstream veneer +# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml +# +# # Generate upstream catalog +# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml +# +# # Check if upstream catalog has the new image listed +# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then +# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" +# exit 1 +# fi +# fi +# +# git diff +# +# - name: Catalog - setup Docker meta for everest-catalog +# id: catalog_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-catalog +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Catalog - push everest-catalog image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ steps.catalog_meta.outputs.tags }} +# file: everest-catalog/everest-catalog.Dockerfile - name: Everest - check out @@ -379,18 +381,26 @@ jobs: - name: Everest - build binary run: | - if [[ $IS_RC == 1 ]]; then - RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - else - RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make release - fi - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + release-cli + + - name: Upload CLI + uses: actions/upload-artifact@v4 + id: artifact-upload-step-1 with: - context: . - push: true - tags: perconalab/everest:${{ env.VERSION }} + name: everestctl.exe + path: ./dist/everestctl.exe + + - name: Output artifact ID + run: echo 'Artifact ID is ${{ steps.artifact-upload-step-1.outputs.artifact-id }}, Artifact URL is ${{ steps.artifact-upload-step-1.outputs.artifact-url }}' + + +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: perconalab/everest:${{ env.VERSION }} - name: Info run: | From 2846397d030da2943898eed325c88ce724f0d486 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 3 Dec 2024 11:35:36 +0200 Subject: [PATCH 171/179] test build cli artifacts --- .github/workflows/feature-build.yaml | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index e37936579..ab75cb9fd 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -126,23 +126,6 @@ jobs: go version echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - name: Enable Go modules cache - uses: percona-platform/cache@v3 - with: - path: ~/go/pkg/mod - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-modules-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-modules- - - - name: Enable Go build cache - uses: percona-platform/cache@v3 - with: - path: ~/.cache/go-build - key: ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}-${{ hashFiles('**') }} - restore-keys: | - ${{ matrix.os }}-go-${{ matrix.go-version }}-build-${{ github.ref }}- - ${{ matrix.os }}-go-${{ matrix.go-version }}-build- - # - name: Login to GitHub Container Registry # uses: docker/login-action@v3 # with: From a45ce1626c4458aff36aaf656290669cee716b4d Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Tue, 3 Dec 2024 11:36:11 +0200 Subject: [PATCH 172/179] upd according to tests --- .github/workflows/feature-build.yaml | 533 ++++++++++++++------------- Makefile | 3 - 2 files changed, 287 insertions(+), 249 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index ab75cb9fd..296c9d18e 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -31,17 +31,13 @@ on: upstream_operator_bundle_image: required: false description: "Full name of the upstream bundle image to test" - cli_prerequisites: + artifacts_retention_days: required: false - description: "Prerequisites for CLI to add to the VS" - default: ">= 1.2.0" - k8s_prerequisites: - required: false - description: "Prerequisites for k8s version to add to the VS" - default: ">= 1.27" + description: "How many days the artifacts will be stored in GitHub" + default: 30 push: branches: - - EVEREST-1563-operator-early-adoption + - early-adoption-test permissions: contents: read @@ -50,8 +46,8 @@ permissions: pull-requests: write jobs: - test: - name: Test + build: + name: Build timeout-minutes: 30 strategy: @@ -65,6 +61,7 @@ jobs: env: TOOLS_PATH: "/opt/tools/bin" + ARTIFACTS_RETENTION_DAYS: ${{ github.event.inputs.artifacts_retention_days }} VS_BRANCH: ${{ github.event.inputs.vs_branch }} HELM_BRANCH: ${{ github.event.inputs.helm_branch }} @@ -83,14 +80,6 @@ jobs: # UPSTREAM_REPO: ${{ github.event.inputs.upstream-operator }} UPSTREAM_REPO: "percona-xtradb-cluster-operator" - # !!! revert before merge to using inputs - CLI_PREREQUISITES: ">= 1.2.0" - # CLI_PREREQUISITES: ${{ github.event.inputs.cli_prerequisites }} - - # !!! revert before merge to using inputs - K8S_PREREQUISITES: ">= 1.27" - # K8S_PREREQUISITES: ${{ github.event.inputs.k8s_prerequisites }} - VS_PORT: 8081 ARCH: "" OS: "" @@ -100,6 +89,13 @@ jobs: VS_TAG: "" steps: + - name: Input validation + run: | + if [[ ! "$ARTIFACTS_RETENTION_DAYS" =~ ^[0-9]+$ ]]; then + echo "Wrong artifacts_retention_days format. Use an integer number. 0 means default GitHub repo settings." + exit 1 + fi + - name: Set environment variables run: | echo "ARCH=$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/')" >> $GITHUB_ENV @@ -115,234 +111,235 @@ jobs: echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Set up Go release uses: percona-platform/setup-go@v4 with: go-version: ${{ matrix.go-version }} - - name: Set GO_VERSION environment variable + - name: Operator - install operator-sdk run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.25.2 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# git checkout -b $VERSION_TAG -# make build manifests bundle -# -# # configure userdata for commits -# git config --global user.email "everest-ci@percona.com" -# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" -# -# # commit and push the updated files -# git commit -a -m "operator manifests" -# # to build crds in helm, the remote ref with the version name should exist -# git push origin $VERSION_TAG -# -# -# - name: Helm - checkout -# uses: actions/checkout@v4 -# with: -# repository: percona/percona-helm-charts -# ref: ${{ env.HELM_BRANCH }} -# path: percona-helm-charts -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Helm - build -# run: | -# cd percona-helm-charts/charts/everest -# CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen -# make release-dev -# -# - name: Helm - Create tar.gz archive -# run: | -# tar -czvf helm.tar.gz percona-helm-charts/charts/everest -# -# - name: Helm - Upload artifact -# uses: actions/upload-artifact@v4 -# with: -# name: helm -# path: helm.tar.gz -# -# - name: Operator - check out again -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - delete the feature build branch -# run: | -# cd everest-operator -# git push -d origin $VERSION_TAG -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# ref: ${{ env.VS_BRANCH }} -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} -# -# -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# # create an entry for the new Everest version -# printf "version: $VERSION\nsupported:\n cli: '$CLI_PREREQUISITES'\n kubernetes: '$K8S_PREREQUISITES'" > "sources/metadata/everest/$VERSION.yaml" -# -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: perconalab/version-service:${{ env.VS_TAG }} -# -# -# - name: Catalog - checkout -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-catalog -# path: everest-catalog -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Catalog - update veneer file -# run: | -# cd everest-catalog/tools -# go run . \ -# --veneer-file ../veneer/everest-operator.yaml \ -# --channel fast-v0 \ -# --new-version ${{ env.VERSION }} \ -# -# cd .. -# curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.44.0/${OS}-${ARCH}-opm -# chmod +x /tmp/opm -# /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml -# -# # Check if catalog has the new version listed -# if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then -# echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" -# exit 1 -# fi -# -# # If the feature build contains upstream upgrades -# if [ -n "$UPSTREAM_REPO" ]; then -# # Add a new record to the upstream veneer -# yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml -# -# # Generate upstream catalog -# /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml -# -# # Check if upstream catalog has the new image listed -# if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then -# echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" -# exit 1 -# fi -# fi -# -# git diff -# -# - name: Catalog - setup Docker meta for everest-catalog -# id: catalog_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-catalog -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Catalog - push everest-catalog image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ steps.catalog_meta.outputs.tags }} -# file: everest-catalog/everest-catalog.Dockerfile + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.38.0 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - name: Everest - check out + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + git checkout -b $VERSION_TAG + sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile + + make init + make release + + # configure userdata for commits + git config --global user.email "everest-ci@percona.com" + git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + + # commit and push the updated files + git commit -a -m "operator manifests" + # to build crds in helm, the remote ref with the version name should exist + git push origin $VERSION_TAG + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Helm - checkout uses: actions/checkout@v4 with: - path: ./api + repository: percona/percona-helm-charts + ref: ${{ env.HELM_BRANCH }} + path: percona-helm-charts token: ${{ secrets.ROBOT_TOKEN }} - ref: ${{ env.EVEREST_BRANCH }} - - name: Everest - setup golang - uses: actions/setup-go@v5 + - name: Helm - build + run: | + cd percona-helm-charts/charts/everest + CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen + make release-dev + + - name: Helm - Create tar.gz archive + run: | + tar -czvf helm.tar.gz percona-helm-charts/charts/everest + + - name: Helm - Upload artifact + uses: actions/upload-artifact@v4 + with: + name: helm + path: helm.tar.gz + + - name: Operator - check out again + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - delete the feature build branch + run: | + cd everest-operator + git push -d origin $VERSION_TAG + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + ref: ${{ env.VS_BRANCH }} + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + + - name: VS - update + run: | + cd percona-version-service + make init + + cd sources/metadata/everest + # read the file for the last version of everest + file_content=$(cat $(ls -1 | sort | tail -n 1)) + # create an entry for the new Everest version from this file by replacing the version + echo "$file_content" | sed "s/^version: .*/version: $VERSION/g" > "$VERSION.yaml" + + git status + cat "$VERSION.yaml" + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 with: - go-version-file: "./go.mod" + context: percona-version-service + push: true + tags: perconalab/version-service:${{ env.VS_TAG }} + + + - name: Catalog - checkout + uses: actions/checkout@v4 + with: + repository: percona/everest-catalog + path: everest-catalog + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Catalog - update veneer file + run: | + cd everest-catalog/tools + go run . \ + --veneer-file ../veneer/everest-operator.yaml \ + --channel fast-v0 \ + --new-version ${{ env.VERSION }} \ + + cd .. + curl -Lo /tmp/opm https://github.com/operator-framework/operator-registry/releases/download/v1.48.0/${OS}-${ARCH}-opm + chmod +x /tmp/opm + /tmp/opm alpha render-template basic --skip-tls -o yaml < veneer/everest-operator.yaml > catalog/everest-operator/catalog.yaml + + # Check if catalog has the new version listed + if ! grep -q "$VERSION$" catalog/everest-operator/catalog.yaml; then + echo "catalog/everest-operator/catalog.yaml does not include the version $VERSION" + exit 1 + fi + + # If the feature build contains upstream upgrades + if [ -n "$UPSTREAM_REPO" ]; then + # Add a new record to the upstream veneer + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + + # Generate upstream catalog + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + + # Check if upstream catalog has the new image listed + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then + echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + exit 1 + fi + fi + + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-catalog + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Catalog - push everest-catalog image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.catalog_meta.outputs.tags }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + ref: ${{ env.EVEREST_BRANCH }} - name: Everest UI - setup pnpm uses: pnpm/action-setup@v4 @@ -365,34 +362,78 @@ jobs: - name: Everest - build binary run: | RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - release-cli + RELEASE_VERSION=${VERSION} make release-cli - - name: Upload CLI + - name: Upload CLI artefacts uses: actions/upload-artifact@v4 - id: artifact-upload-step-1 + id: cli-upload-step-1 with: name: everestctl.exe path: ./dist/everestctl.exe + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - name: Output artifact ID - run: echo 'Artifact ID is ${{ steps.artifact-upload-step-1.outputs.artifact-id }}, Artifact URL is ${{ steps.artifact-upload-step-1.outputs.artifact-url }}' - + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-2 + with: + name: everestctl-darwin-amd64 + path: ./dist/everestctl-darwin-amd64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: perconalab/everest:${{ env.VERSION }} + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-3 + with: + name: everestctl-darwin-arm64 + path: ./dist/everestctl-darwin-arm64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - name: Info - run: | - echo "::notice title=Feature Build $VERSION is Created::Version Service Image: $VS_TAG" + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-4 + with: + name: everestctl-linux-amd64 + path: ./dist/everestctl-linux-amd64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-5 + with: + name: everestctl-linux-arm64 + path: ./dist/everestctl-linux-arm64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: perconalab/everest:${{ env.VERSION }} + - name: Create vs_tag file + run: | + echo "$VS_TAG" > vs_tag.txt + echo "$VERSION" > fb.txt + - name: Upload VS tag info artefact + uses: actions/upload-artifact@v4 + id: vs_file + with: + name: vs_tag.txt + path: ./vs_tag.txt + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + - name: Upload FB info artefact + uses: actions/upload-artifact@v4 + id: fb_file + with: + name: fb.txt + path: ./fb.txt + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + - name: Info + run: | + echo "::notice title=Feature Build $VERSION is created" diff --git a/Makefile b/Makefile index cb6624c66..bf1f31538 100644 --- a/Makefile +++ b/Makefile @@ -26,9 +26,6 @@ build: ## Build binaries build-cli: init charts ## Build binaries go build -tags debug -v $(LD_FLAGS_CLI_TEST) -o bin/everestctl ./cmd/cli -feature-build-cli: ## Build binaries for feature build - go build -tags debug -v $(LD_FLAGS_CLI) -o bin/everestctl ./cmd/cli - release: FLAGS += -X 'github.com/percona/everest/cmd/config.TelemetryURL=https://check.percona.com' -X 'github.com/percona/everest/cmd/config.TelemetryInterval=24h' release: build ## Build release version From f0c95ebef5f9a10b3d7f384799f3a41001caaa4a Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 17:39:25 +0200 Subject: [PATCH 173/179] revert commented for tests --- .github/workflows/feature-build.yaml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 296c9d18e..cb822d61a 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -35,9 +35,6 @@ on: required: false description: "How many days the artifacts will be stored in GitHub" default: 30 - push: - branches: - - early-adoption-test permissions: contents: read @@ -62,23 +59,12 @@ jobs: env: TOOLS_PATH: "/opt/tools/bin" ARTIFACTS_RETENTION_DAYS: ${{ github.event.inputs.artifacts_retention_days }} - VS_BRANCH: ${{ github.event.inputs.vs_branch }} HELM_BRANCH: ${{ github.event.inputs.helm_branch }} - - # !!! revert before merge to using inputs - #EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} - EVEREST_BRANCH: "EVEREST-1563-operator-early-adoption" - + EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} - - # !!! revert before merge to using inputs - # IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} - IMAGE: "docker.io/percona/percona-xtradb-cluster-operator:1.15.1-community-bundle" - - # !!! revert before merge to using inputs - # UPSTREAM_REPO: ${{ github.event.inputs.upstream-operator }} - UPSTREAM_REPO: "percona-xtradb-cluster-operator" + IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} + UPSTREAM_REPO: ${{ github.event.inputs.upstream-operator }} VS_PORT: 8081 ARCH: "" @@ -102,8 +88,6 @@ jobs: echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - # !!! revert before merge - # TIMESTAMP=$(date +'%Y%m%d%H%M%S') TIMESTAMP="20241125120500" V="1.10000.0-rc$TIMESTAMP" echo "VERSION=$V" >> $GITHUB_ENV From 08a4ff0de9e4fbba3cfd32a674687cc962ede171 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 18:18:07 +0200 Subject: [PATCH 174/179] rename upstream-operator --- .github/workflows/feature-build.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index cb822d61a..a0d0f9ed5 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -64,7 +64,7 @@ jobs: EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} - UPSTREAM_REPO: ${{ github.event.inputs.upstream-operator }} + UPSTREAM_OPERATOR: ${{ github.event.inputs.upstream_operator }} VS_PORT: 8081 ARCH: "" @@ -287,16 +287,16 @@ jobs: fi # If the feature build contains upstream upgrades - if [ -n "$UPSTREAM_REPO" ]; then + if [ -n "$UPSTREAM_OPERATOR" ]; then # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_REPO}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_REPO}.yaml + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml # Generate upstream catalog - /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_REPO}.yaml > catalog/${UPSTREAM_REPO}/catalog.yaml + /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_OPERATOR}.yaml > catalog/${UPSTREAM_OPERATOR}/catalog.yaml # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_REPO}/catalog.yaml; then - echo "catalog/${UPSTREAM_REPO}/catalog.yaml does not include the version $IMAGE" + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then + echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $IMAGE" exit 1 fi fi From d03353239dcd546af6afa6c47aa69dc807e4d9c0 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 18:20:34 +0200 Subject: [PATCH 175/179] use real timestamp --- .github/workflows/feature-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index a0d0f9ed5..74eb6f955 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -88,7 +88,7 @@ jobs: echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - TIMESTAMP="20241125120500" + TIMESTAMP=$(date +'%Y%m%d%H%M%S') V="1.10000.0-rc$TIMESTAMP" echo "VERSION=$V" >> $GITHUB_ENV echo "VERSION_TAG=v$V" >> $GITHUB_ENV From ca26e4c8260eaace2f75b4186cc3ede2c0bf2fb1 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 18:24:47 +0200 Subject: [PATCH 176/179] test --- .github/workflows/feature-build.yaml | 595 ++++++++++++++------------- 1 file changed, 300 insertions(+), 295 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 74eb6f955..04691bbf6 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -1,6 +1,9 @@ --- name: Custom build on: + push: + branches: + EVEREST-1563-operator-early-adoption workflow_dispatch: inputs: everest_branch: @@ -63,7 +66,7 @@ jobs: HELM_BRANCH: ${{ github.event.inputs.helm_branch }} EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} - IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} + UPSTREAM_OPERATOR_IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} UPSTREAM_OPERATOR: ${{ github.event.inputs.upstream_operator }} VS_PORT: 8081 @@ -75,12 +78,12 @@ jobs: VS_TAG: "" steps: - - name: Input validation - run: | - if [[ ! "$ARTIFACTS_RETENTION_DAYS" =~ ^[0-9]+$ ]]; then - echo "Wrong artifacts_retention_days format. Use an integer number. 0 means default GitHub repo settings." - exit 1 - fi +# - name: Input validation +# run: | +# if [[ ! "$ARTIFACTS_RETENTION_DAYS" =~ ^[0-9]+$ ]]; then +# echo "Wrong artifacts_retention_days format. Use an integer number. 0 means default GitHub repo settings." +# exit 1 +# fi - name: Set environment variables run: | @@ -88,177 +91,177 @@ jobs: echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - TIMESTAMP=$(date +'%Y%m%d%H%M%S') + TIMESTAMP="20241125120500" V="1.10000.0-rc$TIMESTAMP" echo "VERSION=$V" >> $GITHUB_ENV echo "VERSION_TAG=v$V" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV - - name: Set GO_VERSION environment variable - run: | - go version - echo "GO_VERSION=$(go version)" >> $GITHUB_ENV - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Operator - check out - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - - name: Set up Go release - uses: percona-platform/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - - name: Operator - install operator-sdk - run: | - mkdir -p $TOOLS_PATH - echo $TOOLS_PATH >> $GITHUB_PATH - - export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.38.0 - curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} - - gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E - - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt - curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc - gpg -u "Operator SDK (release) " --verify checksums.txt.asc - - grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - - - chmod +x operator-sdk_${OS}_${ARCH} - mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk - - - name: Operator - build and bundle - run: | - cd everest-operator - git checkout -b $VERSION_TAG - sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile - - make init - make release - - # configure userdata for commits - git config --global user.email "everest-ci@percona.com" - git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" - - # commit and push the updated files - git commit -a -m "operator manifests" - # to build crds in helm, the remote ref with the version name should exist - git push origin $VERSION_TAG - - - name: Operator - setup Docker meta for everest-operator - id: operator_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - setup Docker meta for everest-operator-bundle - id: bundle_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-operator-bundle - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Operator - push everest-operator image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.operator_meta.outputs.tags }} - - - name: Operator - push everest-operator-bundle image - uses: docker/build-push-action@v6 - with: - context: everest-operator - push: true - tags: ${{ steps.bundle_meta.outputs.tags }} - file: everest-operator/bundle.Dockerfile - - - name: Helm - checkout - uses: actions/checkout@v4 - with: - repository: percona/percona-helm-charts - ref: ${{ env.HELM_BRANCH }} - path: percona-helm-charts - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Helm - build - run: | - cd percona-helm-charts/charts/everest - CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen - make release-dev - - - name: Helm - Create tar.gz archive - run: | - tar -czvf helm.tar.gz percona-helm-charts/charts/everest - - - name: Helm - Upload artifact - uses: actions/upload-artifact@v4 - with: - name: helm - path: helm.tar.gz - - - name: Operator - check out again - uses: actions/checkout@v4 - with: - repository: percona/everest-operator - ref: ${{ env.EVEREST_OPERATOR_BRANCH }} - path: everest-operator - token: ${{ secrets.ROBOT_TOKEN }} - - - name: Operator - delete the feature build branch - run: | - cd everest-operator - git push -d origin $VERSION_TAG - - - name: VS - checkout - uses: actions/checkout@v4 - with: - repository: Percona-Lab/percona-version-service - ref: ${{ env.VS_BRANCH }} - path: percona-version-service - token: ${{ secrets.ROBOT_TOKEN }} - - - - name: VS - update - run: | - cd percona-version-service - make init - - cd sources/metadata/everest - # read the file for the last version of everest - file_content=$(cat $(ls -1 | sort | tail -n 1)) - # create an entry for the new Everest version from this file by replacing the version - echo "$file_content" | sed "s/^version: .*/version: $VERSION/g" > "$VERSION.yaml" - - git status - cat "$VERSION.yaml" - - - name: Build and Push VS dev image - uses: docker/build-push-action@v6 - with: - context: percona-version-service - push: true - tags: perconalab/version-service:${{ env.VS_TAG }} - +# - name: Set GO_VERSION environment variable +# run: | +# go version +# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV +# +# - name: Login to GitHub Container Registry +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# +# - name: Operator - check out +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# +# - name: Set up Go release +# uses: percona-platform/setup-go@v4 +# with: +# go-version: ${{ matrix.go-version }} +# +# +# - name: Operator - install operator-sdk +# run: | +# mkdir -p $TOOLS_PATH +# echo $TOOLS_PATH >> $GITHUB_PATH +# +# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.38.0 +# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} +# +# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E +# +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt +# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc +# gpg -u "Operator SDK (release) " --verify checksums.txt.asc +# +# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - +# +# chmod +x operator-sdk_${OS}_${ARCH} +# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk +# +# - name: Operator - build and bundle +# run: | +# cd everest-operator +# git checkout -b $VERSION_TAG +# sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile +# +# make init +# make release +# +# # configure userdata for commits +# git config --global user.email "everest-ci@percona.com" +# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" +# +# # commit and push the updated files +# git commit -a -m "operator manifests" +# # to build crds in helm, the remote ref with the version name should exist +# git push origin $VERSION_TAG +# +# - name: Operator - setup Docker meta for everest-operator +# id: operator_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - setup Docker meta for everest-operator-bundle +# id: bundle_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-operator-bundle +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Operator - push everest-operator image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.operator_meta.outputs.tags }} +# +# - name: Operator - push everest-operator-bundle image +# uses: docker/build-push-action@v6 +# with: +# context: everest-operator +# push: true +# tags: ${{ steps.bundle_meta.outputs.tags }} +# file: everest-operator/bundle.Dockerfile +# +# - name: Helm - checkout +# uses: actions/checkout@v4 +# with: +# repository: percona/percona-helm-charts +# ref: ${{ env.HELM_BRANCH }} +# path: percona-helm-charts +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Helm - build +# run: | +# cd percona-helm-charts/charts/everest +# CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen +# make release-dev +# +# - name: Helm - Create tar.gz archive +# run: | +# tar -czvf helm.tar.gz percona-helm-charts/charts/everest +# +# - name: Helm - Upload artifact +# uses: actions/upload-artifact@v4 +# with: +# name: helm +# path: helm.tar.gz +# +# - name: Operator - check out again +# uses: actions/checkout@v4 +# with: +# repository: percona/everest-operator +# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} +# path: everest-operator +# token: ${{ secrets.ROBOT_TOKEN }} +# +# - name: Operator - delete the feature build branch +# run: | +# cd everest-operator +# git push -d origin $VERSION_TAG +# +# - name: VS - checkout +# uses: actions/checkout@v4 +# with: +# repository: Percona-Lab/percona-version-service +# ref: ${{ env.VS_BRANCH }} +# path: percona-version-service +# token: ${{ secrets.ROBOT_TOKEN }} +# +# +# - name: VS - update +# run: | +# cd percona-version-service +# make init +# +# cd sources/metadata/everest +# # read the file for the last version of everest +# file_content=$(cat $(ls -1 | sort | tail -n 1)) +# # create an entry for the new Everest version from this file by replacing the version +# echo "$file_content" | sed "s/^version: .*/version: $VERSION/g" > "$VERSION.yaml" +# +# git status +# cat "$VERSION.yaml" +# +# - name: Build and Push VS dev image +# uses: docker/build-push-action@v6 +# with: +# context: percona-version-service +# push: true +# tags: perconalab/version-service:${{ env.VS_TAG }} +# - name: Catalog - checkout uses: actions/checkout@v4 @@ -289,135 +292,137 @@ jobs: # If the feature build contains upstream upgrades if [ -n "$UPSTREAM_OPERATOR" ]; then # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml + yq e ".Stable.Bundles += {\"Image\": \"$UPSTREAM_OPERATOR_IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_OPERATOR}.yaml > catalog/${UPSTREAM_OPERATOR}/catalog.yaml # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then - echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $IMAGE" + if ! grep -q "$UPSTREAM_OPERATOR_IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then + echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $UPSTREAM_OPERATOR_IMAGE" exit 1 fi fi + + git status - - name: Catalog - setup Docker meta for everest-catalog - id: catalog_meta - uses: docker/metadata-action@v5 - with: - images: | - perconalab/everest-catalog - tags: | - type=raw,value=${{ env.VERSION }} - - - name: Catalog - push everest-catalog image - uses: docker/build-push-action@v6 - with: - context: everest-catalog - push: true - tags: ${{ steps.catalog_meta.outputs.tags }} - file: everest-catalog/everest-catalog.Dockerfile - - - - name: Everest - check out - uses: actions/checkout@v4 - with: - token: ${{ secrets.ROBOT_TOKEN }} - ref: ${{ env.EVEREST_BRANCH }} - - - name: Everest UI - setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 9.4.0 - - - name: Everest UI - run with Node 20 - uses: actions/setup-node@v4 - with: - node-version: 20.x - cache: "pnpm" - cache-dependency-path: ui/pnpm-lock.yaml - - - name: Everest UI - build - run: | - cd ui - pnpm install - EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build - - - name: Everest - build binary - run: | - RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc - RELEASE_VERSION=${VERSION} make release-cli - - - name: Upload CLI artefacts - uses: actions/upload-artifact@v4 - id: cli-upload-step-1 - with: - name: everestctl.exe - path: ./dist/everestctl.exe - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Upload CLI artefacts - uses: actions/upload-artifact@v4 - id: cli-upload-step-2 - with: - name: everestctl-darwin-amd64 - path: ./dist/everestctl-darwin-amd64 - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Upload CLI artefacts - uses: actions/upload-artifact@v4 - id: cli-upload-step-3 - with: - name: everestctl-darwin-arm64 - path: ./dist/everestctl-darwin-arm64 - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Upload CLI artefacts - uses: actions/upload-artifact@v4 - id: cli-upload-step-4 - with: - name: everestctl-linux-amd64 - path: ./dist/everestctl-linux-amd64 - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Upload CLI artefacts - uses: actions/upload-artifact@v4 - id: cli-upload-step-5 - with: - name: everestctl-linux-arm64 - path: ./dist/everestctl-linux-arm64 - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Everest - push Everest image - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: perconalab/everest:${{ env.VERSION }} - - - name: Create vs_tag file - run: | - echo "$VS_TAG" > vs_tag.txt - echo "$VERSION" > fb.txt - - - name: Upload VS tag info artefact - uses: actions/upload-artifact@v4 - id: vs_file - with: - name: vs_tag.txt - path: ./vs_tag.txt - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - - name: Upload FB info artefact - uses: actions/upload-artifact@v4 - id: fb_file - with: - name: fb.txt - path: ./fb.txt - retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} - - - name: Info - run: | - echo "::notice title=Feature Build $VERSION is created" - +# - name: Catalog - setup Docker meta for everest-catalog +# id: catalog_meta +# uses: docker/metadata-action@v5 +# with: +# images: | +# perconalab/everest-catalog +# tags: | +# type=raw,value=${{ env.VERSION }} +# +# - name: Catalog - push everest-catalog image +# uses: docker/build-push-action@v6 +# with: +# context: everest-catalog +# push: true +# tags: ${{ steps.catalog_meta.outputs.tags }} +# file: everest-catalog/everest-catalog.Dockerfile +# +# +# - name: Everest - check out +# uses: actions/checkout@v4 +# with: +# token: ${{ secrets.ROBOT_TOKEN }} +# ref: ${{ env.EVEREST_BRANCH }} +# +# - name: Everest UI - setup pnpm +# uses: pnpm/action-setup@v4 +# with: +# version: 9.4.0 +# +# - name: Everest UI - run with Node 20 +# uses: actions/setup-node@v4 +# with: +# node-version: 20.x +# cache: "pnpm" +# cache-dependency-path: ui/pnpm-lock.yaml +# +# - name: Everest UI - build +# run: | +# cd ui +# pnpm install +# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build +# +# - name: Everest - build binary +# run: | +# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc +# RELEASE_VERSION=${VERSION} make release-cli +# +# - name: Upload CLI artefacts +# uses: actions/upload-artifact@v4 +# id: cli-upload-step-1 +# with: +# name: everestctl.exe +# path: ./dist/everestctl.exe +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Upload CLI artefacts +# uses: actions/upload-artifact@v4 +# id: cli-upload-step-2 +# with: +# name: everestctl-darwin-amd64 +# path: ./dist/everestctl-darwin-amd64 +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Upload CLI artefacts +# uses: actions/upload-artifact@v4 +# id: cli-upload-step-3 +# with: +# name: everestctl-darwin-arm64 +# path: ./dist/everestctl-darwin-arm64 +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Upload CLI artefacts +# uses: actions/upload-artifact@v4 +# id: cli-upload-step-4 +# with: +# name: everestctl-linux-amd64 +# path: ./dist/everestctl-linux-amd64 +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Upload CLI artefacts +# uses: actions/upload-artifact@v4 +# id: cli-upload-step-5 +# with: +# name: everestctl-linux-arm64 +# path: ./dist/everestctl-linux-arm64 +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Everest - push Everest image +# uses: docker/build-push-action@v6 +# with: +# context: . +# push: true +# tags: perconalab/everest:${{ env.VERSION }} +# +# - name: Create vs_tag file +# run: | +# echo "$VS_TAG" > vs_tag.txt +# echo "$VERSION" > fb.txt +# +# - name: Upload VS tag info artefact +# uses: actions/upload-artifact@v4 +# id: vs_file +# with: +# name: vs_tag.txt +# path: ./vs_tag.txt +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# +# - name: Upload FB info artefact +# uses: actions/upload-artifact@v4 +# id: fb_file +# with: +# name: fb.txt +# path: ./fb.txt +# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} +# +# - name: Info +# run: | +# echo "::notice title=Feature Build $VERSION is created" +# From 3b7897b2733309d3e03399539bde5ef0e84f8a55 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 18:40:13 +0200 Subject: [PATCH 177/179] Revert "test" This reverts commit ca26e4c8260eaace2f75b4186cc3ede2c0bf2fb1. --- .github/workflows/feature-build.yaml | 595 +++++++++++++-------------- 1 file changed, 295 insertions(+), 300 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 04691bbf6..74eb6f955 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -1,9 +1,6 @@ --- name: Custom build on: - push: - branches: - EVEREST-1563-operator-early-adoption workflow_dispatch: inputs: everest_branch: @@ -66,7 +63,7 @@ jobs: HELM_BRANCH: ${{ github.event.inputs.helm_branch }} EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} - UPSTREAM_OPERATOR_IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} + IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} UPSTREAM_OPERATOR: ${{ github.event.inputs.upstream_operator }} VS_PORT: 8081 @@ -78,12 +75,12 @@ jobs: VS_TAG: "" steps: -# - name: Input validation -# run: | -# if [[ ! "$ARTIFACTS_RETENTION_DAYS" =~ ^[0-9]+$ ]]; then -# echo "Wrong artifacts_retention_days format. Use an integer number. 0 means default GitHub repo settings." -# exit 1 -# fi + - name: Input validation + run: | + if [[ ! "$ARTIFACTS_RETENTION_DAYS" =~ ^[0-9]+$ ]]; then + echo "Wrong artifacts_retention_days format. Use an integer number. 0 means default GitHub repo settings." + exit 1 + fi - name: Set environment variables run: | @@ -91,177 +88,177 @@ jobs: echo "OS=$(uname | awk '{print tolower($0)}')" >> $GITHUB_ENV echo "VS_URL=http://localhost:$VS_PORT" >> $GITHUB_ENV - TIMESTAMP="20241125120500" + TIMESTAMP=$(date +'%Y%m%d%H%M%S') V="1.10000.0-rc$TIMESTAMP" echo "VERSION=$V" >> $GITHUB_ENV echo "VERSION_TAG=v$V" >> $GITHUB_ENV echo "VS_TAG=everest-test$TIMESTAMP" >> $GITHUB_ENV -# - name: Set GO_VERSION environment variable -# run: | -# go version -# echo "GO_VERSION=$(go version)" >> $GITHUB_ENV -# -# - name: Login to GitHub Container Registry -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# -# - name: Operator - check out -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# -# - name: Set up Go release -# uses: percona-platform/setup-go@v4 -# with: -# go-version: ${{ matrix.go-version }} -# -# -# - name: Operator - install operator-sdk -# run: | -# mkdir -p $TOOLS_PATH -# echo $TOOLS_PATH >> $GITHUB_PATH -# -# export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.38.0 -# curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} -# -# gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E -# -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt -# curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc -# gpg -u "Operator SDK (release) " --verify checksums.txt.asc -# -# grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - -# -# chmod +x operator-sdk_${OS}_${ARCH} -# mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk -# -# - name: Operator - build and bundle -# run: | -# cd everest-operator -# git checkout -b $VERSION_TAG -# sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile -# -# make init -# make release -# -# # configure userdata for commits -# git config --global user.email "everest-ci@percona.com" -# git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" -# -# # commit and push the updated files -# git commit -a -m "operator manifests" -# # to build crds in helm, the remote ref with the version name should exist -# git push origin $VERSION_TAG -# -# - name: Operator - setup Docker meta for everest-operator -# id: operator_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - setup Docker meta for everest-operator-bundle -# id: bundle_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-operator-bundle -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Operator - push everest-operator image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.operator_meta.outputs.tags }} -# -# - name: Operator - push everest-operator-bundle image -# uses: docker/build-push-action@v6 -# with: -# context: everest-operator -# push: true -# tags: ${{ steps.bundle_meta.outputs.tags }} -# file: everest-operator/bundle.Dockerfile -# -# - name: Helm - checkout -# uses: actions/checkout@v4 -# with: -# repository: percona/percona-helm-charts -# ref: ${{ env.HELM_BRANCH }} -# path: percona-helm-charts -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Helm - build -# run: | -# cd percona-helm-charts/charts/everest -# CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen -# make release-dev -# -# - name: Helm - Create tar.gz archive -# run: | -# tar -czvf helm.tar.gz percona-helm-charts/charts/everest -# -# - name: Helm - Upload artifact -# uses: actions/upload-artifact@v4 -# with: -# name: helm -# path: helm.tar.gz -# -# - name: Operator - check out again -# uses: actions/checkout@v4 -# with: -# repository: percona/everest-operator -# ref: ${{ env.EVEREST_OPERATOR_BRANCH }} -# path: everest-operator -# token: ${{ secrets.ROBOT_TOKEN }} -# -# - name: Operator - delete the feature build branch -# run: | -# cd everest-operator -# git push -d origin $VERSION_TAG -# -# - name: VS - checkout -# uses: actions/checkout@v4 -# with: -# repository: Percona-Lab/percona-version-service -# ref: ${{ env.VS_BRANCH }} -# path: percona-version-service -# token: ${{ secrets.ROBOT_TOKEN }} -# -# -# - name: VS - update -# run: | -# cd percona-version-service -# make init -# -# cd sources/metadata/everest -# # read the file for the last version of everest -# file_content=$(cat $(ls -1 | sort | tail -n 1)) -# # create an entry for the new Everest version from this file by replacing the version -# echo "$file_content" | sed "s/^version: .*/version: $VERSION/g" > "$VERSION.yaml" -# -# git status -# cat "$VERSION.yaml" -# -# - name: Build and Push VS dev image -# uses: docker/build-push-action@v6 -# with: -# context: percona-version-service -# push: true -# tags: perconalab/version-service:${{ env.VS_TAG }} -# + - name: Set GO_VERSION environment variable + run: | + go version + echo "GO_VERSION=$(go version)" >> $GITHUB_ENV + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + + - name: Operator - check out + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + + - name: Set up Go release + uses: percona-platform/setup-go@v4 + with: + go-version: ${{ matrix.go-version }} + + + - name: Operator - install operator-sdk + run: | + mkdir -p $TOOLS_PATH + echo $TOOLS_PATH >> $GITHUB_PATH + + export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.38.0 + curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH} + + gpg --keyserver keyserver.ubuntu.com --recv-keys 052996E2A20B5C7E + + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt + curl -LO ${OPERATOR_SDK_DL_URL}/checksums.txt.asc + gpg -u "Operator SDK (release) " --verify checksums.txt.asc + + grep operator-sdk_${OS}_${ARCH} checksums.txt | sha256sum -c - + + chmod +x operator-sdk_${OS}_${ARCH} + mv operator-sdk_${OS}_${ARCH} $TOOLS_PATH/operator-sdk + + - name: Operator - build and bundle + run: | + cd everest-operator + git checkout -b $VERSION_TAG + sed -i "s/^VERSION ?=.*/VERSION ?= $VERSION/g" Makefile + + make init + make release + + # configure userdata for commits + git config --global user.email "everest-ci@percona.com" + git config --global user.name "Everest RC CI triggered by ${{ github.actor }}" + + # commit and push the updated files + git commit -a -m "operator manifests" + # to build crds in helm, the remote ref with the version name should exist + git push origin $VERSION_TAG + + - name: Operator - setup Docker meta for everest-operator + id: operator_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - setup Docker meta for everest-operator-bundle + id: bundle_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-operator-bundle + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Operator - push everest-operator image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.operator_meta.outputs.tags }} + + - name: Operator - push everest-operator-bundle image + uses: docker/build-push-action@v6 + with: + context: everest-operator + push: true + tags: ${{ steps.bundle_meta.outputs.tags }} + file: everest-operator/bundle.Dockerfile + + - name: Helm - checkout + uses: actions/checkout@v4 + with: + repository: percona/percona-helm-charts + ref: ${{ env.HELM_BRANCH }} + path: percona-helm-charts + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Helm - build + run: | + cd percona-helm-charts/charts/everest + CRD_VERSION=${{ env.VERSION_TAG }} make crds-gen + make release-dev + + - name: Helm - Create tar.gz archive + run: | + tar -czvf helm.tar.gz percona-helm-charts/charts/everest + + - name: Helm - Upload artifact + uses: actions/upload-artifact@v4 + with: + name: helm + path: helm.tar.gz + + - name: Operator - check out again + uses: actions/checkout@v4 + with: + repository: percona/everest-operator + ref: ${{ env.EVEREST_OPERATOR_BRANCH }} + path: everest-operator + token: ${{ secrets.ROBOT_TOKEN }} + + - name: Operator - delete the feature build branch + run: | + cd everest-operator + git push -d origin $VERSION_TAG + + - name: VS - checkout + uses: actions/checkout@v4 + with: + repository: Percona-Lab/percona-version-service + ref: ${{ env.VS_BRANCH }} + path: percona-version-service + token: ${{ secrets.ROBOT_TOKEN }} + + + - name: VS - update + run: | + cd percona-version-service + make init + + cd sources/metadata/everest + # read the file for the last version of everest + file_content=$(cat $(ls -1 | sort | tail -n 1)) + # create an entry for the new Everest version from this file by replacing the version + echo "$file_content" | sed "s/^version: .*/version: $VERSION/g" > "$VERSION.yaml" + + git status + cat "$VERSION.yaml" + + - name: Build and Push VS dev image + uses: docker/build-push-action@v6 + with: + context: percona-version-service + push: true + tags: perconalab/version-service:${{ env.VS_TAG }} + - name: Catalog - checkout uses: actions/checkout@v4 @@ -292,137 +289,135 @@ jobs: # If the feature build contains upstream upgrades if [ -n "$UPSTREAM_OPERATOR" ]; then # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$UPSTREAM_OPERATOR_IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml + yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_OPERATOR}.yaml > catalog/${UPSTREAM_OPERATOR}/catalog.yaml # Check if upstream catalog has the new image listed - if ! grep -q "$UPSTREAM_OPERATOR_IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then - echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $UPSTREAM_OPERATOR_IMAGE" + if ! grep -q "$IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then + echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $IMAGE" exit 1 fi fi - - git status -# - name: Catalog - setup Docker meta for everest-catalog -# id: catalog_meta -# uses: docker/metadata-action@v5 -# with: -# images: | -# perconalab/everest-catalog -# tags: | -# type=raw,value=${{ env.VERSION }} -# -# - name: Catalog - push everest-catalog image -# uses: docker/build-push-action@v6 -# with: -# context: everest-catalog -# push: true -# tags: ${{ steps.catalog_meta.outputs.tags }} -# file: everest-catalog/everest-catalog.Dockerfile -# -# -# - name: Everest - check out -# uses: actions/checkout@v4 -# with: -# token: ${{ secrets.ROBOT_TOKEN }} -# ref: ${{ env.EVEREST_BRANCH }} -# -# - name: Everest UI - setup pnpm -# uses: pnpm/action-setup@v4 -# with: -# version: 9.4.0 -# -# - name: Everest UI - run with Node 20 -# uses: actions/setup-node@v4 -# with: -# node-version: 20.x -# cache: "pnpm" -# cache-dependency-path: ui/pnpm-lock.yaml -# -# - name: Everest UI - build -# run: | -# cd ui -# pnpm install -# EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build -# -# - name: Everest - build binary -# run: | -# RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc -# RELEASE_VERSION=${VERSION} make release-cli -# -# - name: Upload CLI artefacts -# uses: actions/upload-artifact@v4 -# id: cli-upload-step-1 -# with: -# name: everestctl.exe -# path: ./dist/everestctl.exe -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Upload CLI artefacts -# uses: actions/upload-artifact@v4 -# id: cli-upload-step-2 -# with: -# name: everestctl-darwin-amd64 -# path: ./dist/everestctl-darwin-amd64 -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Upload CLI artefacts -# uses: actions/upload-artifact@v4 -# id: cli-upload-step-3 -# with: -# name: everestctl-darwin-arm64 -# path: ./dist/everestctl-darwin-arm64 -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Upload CLI artefacts -# uses: actions/upload-artifact@v4 -# id: cli-upload-step-4 -# with: -# name: everestctl-linux-amd64 -# path: ./dist/everestctl-linux-amd64 -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Upload CLI artefacts -# uses: actions/upload-artifact@v4 -# id: cli-upload-step-5 -# with: -# name: everestctl-linux-arm64 -# path: ./dist/everestctl-linux-arm64 -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Everest - push Everest image -# uses: docker/build-push-action@v6 -# with: -# context: . -# push: true -# tags: perconalab/everest:${{ env.VERSION }} -# -# - name: Create vs_tag file -# run: | -# echo "$VS_TAG" > vs_tag.txt -# echo "$VERSION" > fb.txt -# -# - name: Upload VS tag info artefact -# uses: actions/upload-artifact@v4 -# id: vs_file -# with: -# name: vs_tag.txt -# path: ./vs_tag.txt -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# -# - name: Upload FB info artefact -# uses: actions/upload-artifact@v4 -# id: fb_file -# with: -# name: fb.txt -# path: ./fb.txt -# retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} -# -# - name: Info -# run: | -# echo "::notice title=Feature Build $VERSION is created" -# + - name: Catalog - setup Docker meta for everest-catalog + id: catalog_meta + uses: docker/metadata-action@v5 + with: + images: | + perconalab/everest-catalog + tags: | + type=raw,value=${{ env.VERSION }} + + - name: Catalog - push everest-catalog image + uses: docker/build-push-action@v6 + with: + context: everest-catalog + push: true + tags: ${{ steps.catalog_meta.outputs.tags }} + file: everest-catalog/everest-catalog.Dockerfile + + + - name: Everest - check out + uses: actions/checkout@v4 + with: + token: ${{ secrets.ROBOT_TOKEN }} + ref: ${{ env.EVEREST_BRANCH }} + + - name: Everest UI - setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 9.4.0 + + - name: Everest UI - run with Node 20 + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: "pnpm" + cache-dependency-path: ui/pnpm-lock.yaml + + - name: Everest UI - build + run: | + cd ui + pnpm install + EVEREST_OUT_DIR=${GITHUB_WORKSPACE}/public/dist/ pnpm build + + - name: Everest - build binary + run: | + RELEASE_VERSION=${VERSION} CGO_ENABLED=0 GOOS=linux GOARCH=amd64 make rc + RELEASE_VERSION=${VERSION} make release-cli + + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-1 + with: + name: everestctl.exe + path: ./dist/everestctl.exe + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-2 + with: + name: everestctl-darwin-amd64 + path: ./dist/everestctl-darwin-amd64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-3 + with: + name: everestctl-darwin-arm64 + path: ./dist/everestctl-darwin-arm64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-4 + with: + name: everestctl-linux-amd64 + path: ./dist/everestctl-linux-amd64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Upload CLI artefacts + uses: actions/upload-artifact@v4 + id: cli-upload-step-5 + with: + name: everestctl-linux-arm64 + path: ./dist/everestctl-linux-arm64 + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Everest - push Everest image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: perconalab/everest:${{ env.VERSION }} + + - name: Create vs_tag file + run: | + echo "$VS_TAG" > vs_tag.txt + echo "$VERSION" > fb.txt + + - name: Upload VS tag info artefact + uses: actions/upload-artifact@v4 + id: vs_file + with: + name: vs_tag.txt + path: ./vs_tag.txt + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + + - name: Upload FB info artefact + uses: actions/upload-artifact@v4 + id: fb_file + with: + name: fb.txt + path: ./fb.txt + retention-days: ${{ env.ARTIFACTS_RETENTION_DAYS }} + + - name: Info + run: | + echo "::notice title=Feature Build $VERSION is created" + From acaa0bfb9cbbb32a03459800c4bfb4d4b5035776 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Thu, 5 Dec 2024 18:41:04 +0200 Subject: [PATCH 178/179] rename IMAGE to UPSTREAM_OPERATOR_IMAGE --- .github/workflows/feature-build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/feature-build.yaml b/.github/workflows/feature-build.yaml index 74eb6f955..e557753d9 100644 --- a/.github/workflows/feature-build.yaml +++ b/.github/workflows/feature-build.yaml @@ -63,7 +63,7 @@ jobs: HELM_BRANCH: ${{ github.event.inputs.helm_branch }} EVEREST_BRANCH: ${{ github.event.inputs.everest_branch }} EVEREST_OPERATOR_BRANCH: ${{ github.event.inputs.everest_operator_branch }} - IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} + UPSTREAM_OPERATOR_IMAGE: ${{ github.event.inputs.upstream_operator_bundle_image }} UPSTREAM_OPERATOR: ${{ github.event.inputs.upstream_operator }} VS_PORT: 8081 @@ -289,14 +289,14 @@ jobs: # If the feature build contains upstream upgrades if [ -n "$UPSTREAM_OPERATOR" ]; then # Add a new record to the upstream veneer - yq e ".Stable.Bundles += {\"Image\": \"$IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml + yq e ".Stable.Bundles += {\"Image\": \"$UPSTREAM_OPERATOR_IMAGE\"}" veneer/${UPSTREAM_OPERATOR}.yaml > temp.yaml && mv temp.yaml veneer/${UPSTREAM_OPERATOR}.yaml # Generate upstream catalog /tmp/opm alpha render-template semver --skip-tls -o yaml < veneer/${UPSTREAM_OPERATOR}.yaml > catalog/${UPSTREAM_OPERATOR}/catalog.yaml # Check if upstream catalog has the new image listed - if ! grep -q "$IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then - echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $IMAGE" + if ! grep -q "$UPSTREAM_OPERATOR_IMAGE$" catalog/${UPSTREAM_OPERATOR}/catalog.yaml; then + echo "catalog/${UPSTREAM_OPERATOR}/catalog.yaml does not include the version $UPSTREAM_OPERATOR_IMAGE" exit 1 fi fi From bbb8fb05007f4d49ea356e48e57540f5a549ff91 Mon Sep 17 00:00:00 2001 From: Oksana Grishchenko Date: Mon, 16 Dec 2024 18:12:42 +0200 Subject: [PATCH 179/179] helm charts update --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5715def31..75ff31dd6 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/operator-framework/api v0.27.0 github.com/operator-framework/operator-lifecycle-manager v0.27.0 github.com/percona/everest-operator v0.6.0-dev1.0.20241203113640-8dd4a9d32733 - github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241213125842-25611d63cb26 + github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241216150058-e3a86db671f6 github.com/rodaine/table v1.3.0 github.com/spf13/cobra v1.8.1 github.com/spf13/viper v1.18.2 diff --git a/go.sum b/go.sum index 51fe4b3ab..23d8ba582 100644 --- a/go.sum +++ b/go.sum @@ -2218,8 +2218,8 @@ github.com/percona/everest-operator v0.6.0-dev1.0.20241203113640-8dd4a9d32733 h1 github.com/percona/everest-operator v0.6.0-dev1.0.20241203113640-8dd4a9d32733/go.mod h1:FTKcDBn/1BHKNDnocKBAWH2mG3BYyD6yLXtoS58o1BM= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939 h1:OggdqSzqe9pO3A4GaRlrLwZXS3zEQ84O4+7Jm9cg74s= github.com/percona/percona-backup-mongodb v1.8.1-0.20241002124601-957ac501f939/go.mod h1:KhIlTT4wR2mIkMvDtEFerr9zaADJorL7UThSztzxBaY= -github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241213125842-25611d63cb26 h1:uRrJYrNEl/egNtFXjDceLwxbPMcBB0iXiBcgFK4myCA= -github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241213125842-25611d63cb26/go.mod h1:j5Ci48Azwb4Xs4XvZQNfleWCn2uyiZywazklxNH1ut4= +github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241216150058-e3a86db671f6 h1:rlMpiu/gNP8oUqVHCE6wPmwKkUwOEodNIppYaWZ5Cxw= +github.com/percona/percona-helm-charts/charts/everest v0.0.0-20241216150058-e3a86db671f6/go.mod h1:j5Ci48Azwb4Xs4XvZQNfleWCn2uyiZywazklxNH1ut4= github.com/percona/percona-postgresql-operator v0.0.0-20241007204305-35d61aa5aebd h1:9RCUfPUxbdXuL/247r77DJmRSowDzA2xzZC9FpuLuUw= github.com/percona/percona-postgresql-operator v0.0.0-20241007204305-35d61aa5aebd/go.mod h1:ICbLstSO4zhYo+SFSciIWO9rLHQg29GJ1335L0tfhR0= github.com/percona/percona-server-mongodb-operator v1.18.0 h1:inRWonCOTacD++D/tvyFXVUqKx7f2OQzz8w1NyT3cAI=