From 43734d7c444de7bd57e226253f3ef54f5e2e572c Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 16:38:46 -0600 Subject: [PATCH 01/21] build and push on frouioui for testing Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_lite.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build_lite.yml b/.github/workflows/docker_build_lite.yml index 54c2bcb2419..280e52bdbc9 100644 --- a/.github/workflows/docker_build_lite.yml +++ b/.github/workflows/docker_build_lite.yml @@ -58,9 +58,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=vitess/lite:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/lite:${TAG_NAME}" >> $GITHUB_ENV else - echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - name: Build and push on main From d27d4b0dab0693231c5ff5608a972b4783a02ffe Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 16:52:18 -0600 Subject: [PATCH 02/21] build and push on frouioui for testing Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_lite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build_lite.yml b/.github/workflows/docker_build_lite.yml index 280e52bdbc9..e55fc6219ad 100644 --- a/.github/workflows/docker_build_lite.yml +++ b/.github/workflows/docker_build_lite.yml @@ -48,7 +48,7 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: vitess/lite:${{ matrix.branch }} + tags: frouioui/lite:${{ matrix.branch }} - name: Get the Git tag if: startsWith(github.ref, 'refs/tags/') From e3b20f9f9e297d882ea402955ee89176ec9b9970 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 17:33:13 -0600 Subject: [PATCH 03/21] remove all wip Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_lite.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_build_lite.yml b/.github/workflows/docker_build_lite.yml index e55fc6219ad..54c2bcb2419 100644 --- a/.github/workflows/docker_build_lite.yml +++ b/.github/workflows/docker_build_lite.yml @@ -48,7 +48,7 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: frouioui/lite:${{ matrix.branch }} + tags: vitess/lite:${{ matrix.branch }} - name: Get the Git tag if: startsWith(github.ref, 'refs/tags/') @@ -58,9 +58,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=frouioui/lite:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/lite:${TAG_NAME}" >> $GITHUB_ENV else - echo "DOCKER_TAG=frouioui/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - name: Build and push on main From 3e36d13b0cad4b7dae743b3ba8024d0f9e0ba28a Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 17:43:36 -0600 Subject: [PATCH 04/21] add build base docker image workflow Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 73 +++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 .github/workflows/docker_build_base.yml diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml new file mode 100644 index 00000000000..e4cda66e736 --- /dev/null +++ b/.github/workflows/docker_build_base.yml @@ -0,0 +1,73 @@ +name: Docker Build Base +on: + push: + branches: + - main + tags: + - '*' + +concurrency: + group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Base') + cancel-in-progress: true + +permissions: read-all + +jobs: + build_and_push_base: + name: Build and push vitess/base Docker images + runs-on: gh-hosted-runners-16cores-1 + if: github.repository == 'vitessio/vitess' + + strategy: + fail-fast: true + matrix: + branch: [ latest, mysql57, percona57, percona80 ] + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set Dockerfile path + run: | + if [[ "${{ matrix.branch }}" == "latest" ]]; then + echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV + else + echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV + fi + + - name: Build and push on main + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + tags: vitess/base:${{ matrix.branch }} + + - name: Get the Git tag + if: startsWith(github.ref, 'refs/tags/') + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Set Docker tag name + if: startsWith(github.ref, 'refs/tags/') + run: | + if [[ "${{ matrix.branch }}" == "latest" ]]; then + echo "DOCKER_TAG=vitess/base:${TAG_NAME}" >> $GITHUB_ENV + else + echo "DOCKER_TAG=vitess/base:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV + fi + + - name: Build and push on main + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + tags: ${{ env.DOCKER_TAG }} \ No newline at end of file From c854a79d5ae0b08bac136c73bbd21331f9ae9cd5 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 17:45:09 -0600 Subject: [PATCH 05/21] build and push to frouioui for testing purposes Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index e4cda66e736..d4b8452b88c 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -48,7 +48,7 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: vitess/base:${{ matrix.branch }} + tags: frouioui/base:${{ matrix.branch }} - name: Get the Git tag if: startsWith(github.ref, 'refs/tags/') @@ -58,9 +58,9 @@ jobs: if: startsWith(github.ref, 'refs/tags/') run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=vitess/base:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV else - echo "DOCKER_TAG=vitess/base:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/base:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - name: Build and push on main From ddb040b19c6d1b553ad3d43db8bee803b9cdf404 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 17:49:10 -0600 Subject: [PATCH 06/21] run workflow on ubuntu for testing Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index d4b8452b88c..14b970d4fc2 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -15,7 +15,7 @@ permissions: read-all jobs: build_and_push_base: name: Build and push vitess/base Docker images - runs-on: gh-hosted-runners-16cores-1 + runs-on: ubuntu-latest if: github.repository == 'vitessio/vitess' strategy: From 3d72c8dd1be6c0ac951c907772faa2468b4dde2d Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 17:56:58 -0600 Subject: [PATCH 07/21] wip testing Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 14b970d4fc2..68cf23b808b 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -16,7 +16,7 @@ jobs: build_and_push_base: name: Build and push vitess/base Docker images runs-on: ubuntu-latest - if: github.repository == 'vitessio/vitess' +# if: github.repository == 'vitessio/vitess' strategy: fail-fast: true From 1b31c113ab8b48b0955960acf172ba305d698530 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 18:17:54 -0600 Subject: [PATCH 08/21] fix typo and build only latest on tag for base Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 8 +++----- .github/workflows/docker_build_lite.yml | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 68cf23b808b..386b0e84a77 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -55,16 +55,14 @@ jobs: run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == "latest" run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV - else - echo "DOCKER_TAG=frouioui/base:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - - name: Build and push on main - if: startsWith(github.ref, 'refs/tags/') + - name: Build and push on tags + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == "latest" uses: docker/build-push-action@v5 with: context: . diff --git a/.github/workflows/docker_build_lite.yml b/.github/workflows/docker_build_lite.yml index 54c2bcb2419..7f355ddfd32 100644 --- a/.github/workflows/docker_build_lite.yml +++ b/.github/workflows/docker_build_lite.yml @@ -63,7 +63,7 @@ jobs: echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV fi - - name: Build and push on main + - name: Build and push on tags if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: From 857286dd9da8826bbe72e7809990522823510704 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Thu, 12 Oct 2023 18:20:03 -0600 Subject: [PATCH 09/21] use simple quote instead of double Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 386b0e84a77..ec917f8ff8f 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -55,14 +55,14 @@ jobs: run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == "latest" + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV fi - name: Build and push on tags - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == "latest" + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' uses: docker/build-push-action@v5 with: context: . From 02a2d1a3fac03254c0c82755ac4bb92a4f601f07 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 17:31:31 -0600 Subject: [PATCH 10/21] Build vitess component docker images Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 81 ++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index ec917f8ff8f..d77ab33d7df 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -15,7 +15,7 @@ permissions: read-all jobs: build_and_push_base: name: Build and push vitess/base Docker images - runs-on: ubuntu-latest + runs-on: ubuntu-latest # TODO: use larger runner when testing is done # if: github.repository == 'vitessio/vitess' strategy: @@ -68,4 +68,81 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: ${{ env.DOCKER_TAG }} \ No newline at end of file + tags: ${{ env.DOCKER_TAG }} + + + build_and_push_components: + name: Build and push vitess components Docker images + runs-on: ubuntu-latest # TODO: use larger runner when testing is done + # if: github.repository == 'vitessio/vitess' + + strategy: + fail-fast: true + matrix: + debian: [ bullseye, bookworm ] + component: [ k8s, vtadmin, vtorc, vtgate, vttablet, mysqlctld, mysqlctl, vtctl, vtctlclient, vtctld, logrotate, logtail ] + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + # Build and Push component image to tag "latest" if branch=main and debian=bookworm + - name: Build and push on main Bookworm (default) + if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' + uses: docker/build-push-action@v5 + with: + context: docker/${{ matrix.component }} + push: true + tags: frouioui/${{ matrix.component }}:latest + + # Build and Push component image to tag "latest-bullseye" if branch=main and debian=bullseye + - name: Build and push on main Bullseye + if: github.ref == 'refs/heads/main' && matrix.debian == 'bullseye' + uses: docker/build-push-action@v5 + with: + context: docker/${{ matrix.component }} + push: true + tags: frouioui/${{ matrix.component }}:latest-bullseye + + ###### + # All code below only applies to new tags + ###### + + - name: Get the Git tag + if: startsWith(github.ref, 'refs/tags/') + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + # We push git-tag-based images to three tags, i.e. for 'v19.0.0' we push to: + # vitess/${{ matrix.component }}:v19.0.0 + # vitess/${{ matrix.component }}:v19.0.0-bookworm + # vitess/${{ matrix.component }}:v19.0.0-bullseye + - name: Set Docker tag name + if: startsWith(github.ref, 'refs/tags/') + run: | + echo "DOCKER_TAG=frouioui/${{ matrix.component }}:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV + echo "DOCKER_TAG_DEFAULT_DEBIAN=frouioui/${{ matrix.component }}:${TAG_NAME}" >> $GITHUB_ENV + + # Build and Push component image to DOCKER_TAG, applies to both debian version + - name: Build and push on tags using Debian extension + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: docker/${{ matrix.component }} + push: true + tags: ${{ env.DOCKER_TAG }} + + # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) + # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already + - name: Build and push on tags without Debian extension + if: startsWith(github.ref, 'refs/tags/') && matrix.debian == 'bookworm' + uses: docker/build-push-action@v5 + with: + context: docker/${{ matrix.component }} + push: true + tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} \ No newline at end of file From aabe3cf00f214a757243b13084e208c0fff1ee9c Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 17:41:58 -0600 Subject: [PATCH 11/21] use proper docker context path Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index d77ab33d7df..8439841820d 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -72,6 +72,7 @@ jobs: build_and_push_components: + needs: build_and_push_base name: Build and push vitess components Docker images runs-on: ubuntu-latest # TODO: use larger runner when testing is done # if: github.repository == 'vitessio/vitess' @@ -92,12 +93,20 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Set Docker context path + run: | + if [[ "${{ matrix.component }}" == "k8s" ]]; then + echo "DOCKER_CTX=./docker/k8s" >> $GITHUB_ENV + else + echo "DOCKER_CTX=./docker/k8s/${{ matrix.component }}" >> $GITHUB_ENV + fi + # Build and Push component image to tag "latest" if branch=main and debian=bookworm - name: Build and push on main Bookworm (default) if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' uses: docker/build-push-action@v5 with: - context: docker/${{ matrix.component }} + context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest @@ -106,7 +115,7 @@ jobs: if: github.ref == 'refs/heads/main' && matrix.debian == 'bullseye' uses: docker/build-push-action@v5 with: - context: docker/${{ matrix.component }} + context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest-bullseye @@ -133,7 +142,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') uses: docker/build-push-action@v5 with: - context: docker/${{ matrix.component }} + context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} @@ -143,6 +152,6 @@ jobs: if: startsWith(github.ref, 'refs/tags/') && matrix.debian == 'bookworm' uses: docker/build-push-action@v5 with: - context: docker/${{ matrix.component }} + context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} \ No newline at end of file From 89a78f505daa5a3b5a9ddf79ce77920aa4d28cd9 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 17:59:54 -0600 Subject: [PATCH 12/21] add one more job to build k8s between base and other components Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 140 +++++++++++++++++++++--- 1 file changed, 122 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 8439841820d..85a3e7c6133 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -50,6 +50,10 @@ jobs: push: true tags: frouioui/base:${{ matrix.branch }} + ###### + # All code below only applies to new tags + ###### + - name: Get the Git tag if: startsWith(github.ref, 'refs/tags/') run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV @@ -70,9 +74,101 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} + build_and_push_k8s: + needs: build_and_push_base + name: Build and push vitess/k8s image + runs-on: ubuntu-latest # TODO: use larger runner when testing is done + # if: github.repository == 'vitessio/vitess' + + strategy: + fail-fast: true + matrix: + debian: [ bullseye, bookworm ] + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set Docker context path + run: | + echo "DOCKER_CTX=./docker/k8s" >> $GITHUB_ENV + + - name: Build and push on main latest tag + if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_CTX }} + push: true + tags: frouioui/k8s:latest + build-args: + VT_BASE_VER: latest + DEBIAN_VER: ${{ matrix.debian }}-slim + + - name: Build and push on main debian specific tag + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_CTX }} + push: true + tags: frouioui/k8s:latest-${{ matrix.debian }} + build-args: + VT_BASE_VER: latest + DEBIAN_VER: ${{ matrix.debian }}-slim + + ###### + # All code below only applies to new tags + ###### + + - name: Get the Git tag + if: startsWith(github.ref, 'refs/tags/') + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + # We push git-tag-based k8s image to three tags, i.e. for 'v19.0.0' we push to: + # + # vitess/k8s:v19.0.0 (DOCKER_TAG_DEFAULT_DEBIAN) + # vitess/k8s:v19.0.0-bookworm (DOCKER_TAG) + # vitess/k8s:v19.0.0-bullseye (DOCKER_TAG) + # + - name: Set Docker tag name + if: startsWith(github.ref, 'refs/tags/') + run: | + echo "DOCKER_TAG_DEFAULT_DEBIAN=frouioui/k8s:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/k8s:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV + + # Build and Push component image to DOCKER_TAG, applies to both debian version + - name: Build and push on tags using Debian extension + if: startsWith(github.ref, 'refs/tags/') + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_CTX }} + push: true + tags: ${{ env.DOCKER_TAG }} + build-args: + VT_BASE_VER: ${TAG_NAME} + DEBIAN_VER: ${{ matrix.debian }}-slim + + # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) + # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already + - name: Build and push on tags without Debian extension + if: startsWith(github.ref, 'refs/tags/') && matrix.debian == 'bookworm' + uses: docker/build-push-action@v5 + with: + context: ${{ env.DOCKER_CTX }} + push: true + tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} + build-args: + VT_BASE_VER: ${TAG_NAME} + DEBIAN_VER: ${{ matrix.debian }}-slim + build_and_push_components: - needs: build_and_push_base + needs: build_and_push_k8s name: Build and push vitess components Docker images runs-on: ubuntu-latest # TODO: use larger runner when testing is done # if: github.repository == 'vitessio/vitess' @@ -81,7 +177,7 @@ jobs: fail-fast: true matrix: debian: [ bullseye, bookworm ] - component: [ k8s, vtadmin, vtorc, vtgate, vttablet, mysqlctld, mysqlctl, vtctl, vtctlclient, vtctld, logrotate, logtail ] + component: [ vtadmin, vtorc, vtgate, vttablet, mysqlctld, mysqlctl, vtctl, vtctlclient, vtctld, logrotate, logtail ] steps: - name: Check out code @@ -95,29 +191,29 @@ jobs: - name: Set Docker context path run: | - if [[ "${{ matrix.component }}" == "k8s" ]]; then - echo "DOCKER_CTX=./docker/k8s" >> $GITHUB_ENV - else - echo "DOCKER_CTX=./docker/k8s/${{ matrix.component }}" >> $GITHUB_ENV - fi + echo "DOCKER_CTX=./docker/k8s/${{ matrix.component }}" >> $GITHUB_ENV - # Build and Push component image to tag "latest" if branch=main and debian=bookworm - - name: Build and push on main Bookworm (default) + - name: Build and push on main latest tag if: github.ref == 'refs/heads/main' && matrix.debian == 'bookworm' uses: docker/build-push-action@v5 with: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest + build-args: + VT_BASE_VER: latest + DEBIAN_VER: ${{ matrix.debian }}-slim - # Build and Push component image to tag "latest-bullseye" if branch=main and debian=bullseye - - name: Build and push on main Bullseye - if: github.ref == 'refs/heads/main' && matrix.debian == 'bullseye' + - name: Build and push on main debian specific tag + if: github.ref == 'refs/heads/main' uses: docker/build-push-action@v5 with: context: ${{ env.DOCKER_CTX }} push: true - tags: frouioui/${{ matrix.component }}:latest-bullseye + tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} + build-args: + VT_BASE_VER: latest + DEBIAN_VER: ${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -128,14 +224,16 @@ jobs: run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV # We push git-tag-based images to three tags, i.e. for 'v19.0.0' we push to: - # vitess/${{ matrix.component }}:v19.0.0 - # vitess/${{ matrix.component }}:v19.0.0-bookworm - # vitess/${{ matrix.component }}:v19.0.0-bullseye + # + # vitess/${{ matrix.component }}:v19.0.0 (DOCKER_TAG_DEFAULT_DEBIAN) + # vitess/${{ matrix.component }}:v19.0.0-bookworm (DOCKER_TAG) + # vitess/${{ matrix.component }}:v19.0.0-bullseye (DOCKER_TAG) + # - name: Set Docker tag name if: startsWith(github.ref, 'refs/tags/') run: | - echo "DOCKER_TAG=frouioui/${{ matrix.component }}:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV echo "DOCKER_TAG_DEFAULT_DEBIAN=frouioui/${{ matrix.component }}:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=frouioui/${{ matrix.component }}:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV # Build and Push component image to DOCKER_TAG, applies to both debian version - name: Build and push on tags using Debian extension @@ -145,6 +243,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} + build-args: + VT_BASE_VER: ${TAG_NAME} + DEBIAN_VER: ${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -154,4 +255,7 @@ jobs: with: context: ${{ env.DOCKER_CTX }} push: true - tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} \ No newline at end of file + tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} + build-args: + VT_BASE_VER: ${TAG_NAME} + DEBIAN_VER: ${{ matrix.debian }}-slim \ No newline at end of file From 024b981065a038f9d88ecd6801dd45c2e7262add Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:03:54 -0600 Subject: [PATCH 13/21] fix yaml syntax Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 32 ++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 85a3e7c6133..5089636abf1 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -107,8 +107,8 @@ jobs: push: true tags: frouioui/k8s:latest build-args: - VT_BASE_VER: latest - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -118,8 +118,8 @@ jobs: push: true tags: frouioui/k8s:latest-${{ matrix.debian }} build-args: - VT_BASE_VER: latest - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -150,8 +150,8 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} build-args: - VT_BASE_VER: ${TAG_NAME} - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -163,8 +163,8 @@ jobs: push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: - VT_BASE_VER: ${TAG_NAME} - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim build_and_push_components: @@ -201,8 +201,8 @@ jobs: push: true tags: frouioui/${{ matrix.component }}:latest build-args: - VT_BASE_VER: latest - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -212,8 +212,8 @@ jobs: push: true tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} build-args: - VT_BASE_VER: latest - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -244,8 +244,8 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} build-args: - VT_BASE_VER: ${TAG_NAME} - DEBIAN_VER: ${{ matrix.debian }}-slim + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -257,5 +257,5 @@ jobs: push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: - VT_BASE_VER: ${TAG_NAME} - DEBIAN_VER: ${{ matrix.debian }}-slim \ No newline at end of file + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim \ No newline at end of file From 614ad73ece8dbb492a6d5e9ab0f24174e4f11aa7 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:09:16 -0600 Subject: [PATCH 14/21] fix yaml syntax Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 32 +++++++------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 5089636abf1..4d86cba2168 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -106,9 +106,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -117,9 +115,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest-${{ matrix.debian }} - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -149,9 +145,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -162,9 +156,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim build_and_push_components: @@ -200,9 +192,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -211,9 +201,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -243,9 +231,7 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -256,6 +242,4 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim \ No newline at end of file + build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim From 673ee5346ee0b31e42ce17328a21cd6f05e569c7 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:22:16 -0600 Subject: [PATCH 15/21] wip - use frouioui base and k8s images Signed-off-by: Florent Poinsard --- docker/k8s/Dockerfile | 2 +- docker/k8s/mysqlctl/Dockerfile | 2 +- docker/k8s/mysqlctld/Dockerfile | 2 +- docker/k8s/vtadmin/Dockerfile | 2 +- docker/k8s/vtbackup/Dockerfile | 2 +- docker/k8s/vtctl/Dockerfile | 2 +- docker/k8s/vtctlclient/Dockerfile | 2 +- docker/k8s/vtctld/Dockerfile | 2 +- docker/k8s/vtgate/Dockerfile | 2 +- docker/k8s/vtorc/Dockerfile | 2 +- docker/k8s/vttablet/Dockerfile | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 3ba46595a83..97ec478fb9f 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/base:${VT_BASE_VER} AS base +FROM frouioui/base:${VT_BASE_VER} AS base FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/mysqlctl/Dockerfile b/docker/k8s/mysqlctl/Dockerfile index 6c449552354..61523263d63 100644 --- a/docker/k8s/mysqlctl/Dockerfile +++ b/docker/k8s/mysqlctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/mysqlctld/Dockerfile b/docker/k8s/mysqlctld/Dockerfile index 6fdb30f012a..0aa70d48db0 100644 --- a/docker/k8s/mysqlctld/Dockerfile +++ b/docker/k8s/mysqlctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtadmin/Dockerfile b/docker/k8s/vtadmin/Dockerfile index f952681d3c9..1b774376171 100644 --- a/docker/k8s/vtadmin/Dockerfile +++ b/docker/k8s/vtadmin/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=bullseye-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM node:18-${DEBIAN_VER} as node diff --git a/docker/k8s/vtbackup/Dockerfile b/docker/k8s/vtbackup/Dockerfile index 4a8b3be9d52..665b53b390c 100644 --- a/docker/k8s/vtbackup/Dockerfile +++ b/docker/k8s/vtbackup/Dockerfile @@ -16,7 +16,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctl/Dockerfile b/docker/k8s/vtctl/Dockerfile index cce3b6dc63c..cb3a0a5aa90 100644 --- a/docker/k8s/vtctl/Dockerfile +++ b/docker/k8s/vtctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctlclient/Dockerfile b/docker/k8s/vtctlclient/Dockerfile index 17eab700eb4..b79b704b1e4 100644 --- a/docker/k8s/vtctlclient/Dockerfile +++ b/docker/k8s/vtctlclient/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctld/Dockerfile b/docker/k8s/vtctld/Dockerfile index 5daaf929486..6884d0dca41 100644 --- a/docker/k8s/vtctld/Dockerfile +++ b/docker/k8s/vtctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtgate/Dockerfile b/docker/k8s/vtgate/Dockerfile index 3829227e2fa..fc7abbef45f 100644 --- a/docker/k8s/vtgate/Dockerfile +++ b/docker/k8s/vtgate/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtorc/Dockerfile b/docker/k8s/vtorc/Dockerfile index b62b30ee676..7988fe088c0 100644 --- a/docker/k8s/vtorc/Dockerfile +++ b/docker/k8s/vtorc/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vttablet/Dockerfile b/docker/k8s/vttablet/Dockerfile index dd504d7860d..f0b936518bb 100644 --- a/docker/k8s/vttablet/Dockerfile +++ b/docker/k8s/vttablet/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM vitess/k8s:${VT_BASE_VER} AS k8s +FROM frouioui/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} From ef2f02e9b7f7ad745edf99089b641a570a743cdf Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:25:33 -0600 Subject: [PATCH 16/21] wip - attempt to use list type for build args Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 154 +++++++++++++----------- 1 file changed, 85 insertions(+), 69 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 4d86cba2168..19e5c50a242 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -13,69 +13,69 @@ concurrency: permissions: read-all jobs: - build_and_push_base: - name: Build and push vitess/base Docker images - runs-on: ubuntu-latest # TODO: use larger runner when testing is done -# if: github.repository == 'vitessio/vitess' - - strategy: - fail-fast: true - matrix: - branch: [ latest, mysql57, percona57, percona80 ] - - steps: - - name: Check out code - uses: actions/checkout@v3 - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set Dockerfile path - run: | - if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV - else - echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV - fi - - - name: Build and push on main - if: github.ref == 'refs/heads/main' - uses: docker/build-push-action@v5 - with: - context: . - file: ${{ env.DOCKERFILE }} - push: true - tags: frouioui/base:${{ matrix.branch }} - - ###### - # All code below only applies to new tags - ###### - - - name: Get the Git tag - if: startsWith(github.ref, 'refs/tags/') - run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - - - name: Set Docker tag name - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' - run: | - if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV - fi - - - name: Build and push on tags - if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' - uses: docker/build-push-action@v5 - with: - context: . - file: ${{ env.DOCKERFILE }} - push: true - tags: ${{ env.DOCKER_TAG }} +# build_and_push_base: +# name: Build and push vitess/base Docker images +# runs-on: ubuntu-latest # TODO: use larger runner when testing is done +## if: github.repository == 'vitessio/vitess' +# +# strategy: +# fail-fast: true +# matrix: +# branch: [ latest, mysql57, percona57, percona80 ] +# +# steps: +# - name: Check out code +# uses: actions/checkout@v3 +# +# - name: Login to Docker Hub +# uses: docker/login-action@v3 +# with: +# username: ${{ secrets.DOCKERHUB_USERNAME }} +# password: ${{ secrets.DOCKERHUB_TOKEN }} +# +# - name: Set Dockerfile path +# run: | +# if [[ "${{ matrix.branch }}" == "latest" ]]; then +# echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV +# else +# echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV +# fi +# +# - name: Build and push on main +# if: github.ref == 'refs/heads/main' +# uses: docker/build-push-action@v5 +# with: +# context: . +# file: ${{ env.DOCKERFILE }} +# push: true +# tags: frouioui/base:${{ matrix.branch }} +# +# ###### +# # All code below only applies to new tags +# ###### +# +# - name: Get the Git tag +# if: startsWith(github.ref, 'refs/tags/') +# run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV +# +# - name: Set Docker tag name +# if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' +# run: | +# if [[ "${{ matrix.branch }}" == "latest" ]]; then +# echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV +# fi +# +# - name: Build and push on tags +# if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' +# uses: docker/build-push-action@v5 +# with: +# context: . +# file: ${{ env.DOCKERFILE }} +# push: true +# tags: ${{ env.DOCKER_TAG }} build_and_push_k8s: - needs: build_and_push_base +# needs: build_and_push_base name: Build and push vitess/k8s image runs-on: ubuntu-latest # TODO: use larger runner when testing is done # if: github.repository == 'vitessio/vitess' @@ -106,7 +106,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest - build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -115,7 +117,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest-${{ matrix.debian }} - build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -145,7 +149,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -156,7 +162,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim build_and_push_components: @@ -192,7 +200,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest - build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -201,7 +211,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} - build-args: VT_BASE_VER=latest,DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=latest + - DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -231,7 +243,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -242,4 +256,6 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: VT_BASE_VER=${TAG_NAME},DEBIAN_VER=${{ matrix.debian }}-slim + build-args: + - VT_BASE_VER=${TAG_NAME} + - DEBIAN_VER=${{ matrix.debian }}-slim From 4a45800bc722b2ae733bbbf96919b25f2d94f12b Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:30:04 -0600 Subject: [PATCH 17/21] wip - attempt to use list type for build args Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 48 ++++++++++++------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 19e5c50a242..47c4f5fe25e 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -106,9 +106,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=latest + DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -117,9 +117,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/k8s:latest-${{ matrix.debian }} - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=latest + DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -149,9 +149,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=${TAG_NAME} + DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -162,9 +162,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=${TAG_NAME} + DEBIAN_VER=${{ matrix.debian }}-slim build_and_push_components: @@ -200,9 +200,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=latest + DEBIAN_VER=${{ matrix.debian }}-slim - name: Build and push on main debian specific tag if: github.ref == 'refs/heads/main' @@ -211,9 +211,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} - build-args: - - VT_BASE_VER=latest - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=latest + DEBIAN_VER=${{ matrix.debian }}-slim ###### # All code below only applies to new tags @@ -243,9 +243,9 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=${TAG_NAME} + DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) # It is fine to build a second time here when "matrix.debian == 'bookworm'" as we have cached the first build already @@ -256,6 +256,6 @@ jobs: context: ${{ env.DOCKER_CTX }} push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} - build-args: - - VT_BASE_VER=${TAG_NAME} - - DEBIAN_VER=${{ matrix.debian }}-slim + build-args: | + VT_BASE_VER=${TAG_NAME} + DEBIAN_VER=${{ matrix.debian }}-slim From 55854ae0c5c9b9120c7757994c394e4b22a57fdd Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 18:41:34 -0600 Subject: [PATCH 18/21] remove wip that disabled base building Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 122 ++++++++++++------------ 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 47c4f5fe25e..030698c4205 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -13,69 +13,69 @@ concurrency: permissions: read-all jobs: -# build_and_push_base: -# name: Build and push vitess/base Docker images -# runs-on: ubuntu-latest # TODO: use larger runner when testing is done -## if: github.repository == 'vitessio/vitess' -# -# strategy: -# fail-fast: true -# matrix: -# branch: [ latest, mysql57, percona57, percona80 ] -# -# steps: -# - name: Check out code -# uses: actions/checkout@v3 -# -# - name: Login to Docker Hub -# uses: docker/login-action@v3 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_TOKEN }} -# -# - name: Set Dockerfile path -# run: | -# if [[ "${{ matrix.branch }}" == "latest" ]]; then -# echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV -# else -# echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV -# fi -# -# - name: Build and push on main -# if: github.ref == 'refs/heads/main' -# uses: docker/build-push-action@v5 -# with: -# context: . -# file: ${{ env.DOCKERFILE }} -# push: true -# tags: frouioui/base:${{ matrix.branch }} -# -# ###### -# # All code below only applies to new tags -# ###### -# -# - name: Get the Git tag -# if: startsWith(github.ref, 'refs/tags/') -# run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV -# -# - name: Set Docker tag name -# if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' -# run: | -# if [[ "${{ matrix.branch }}" == "latest" ]]; then -# echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV -# fi -# -# - name: Build and push on tags -# if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' -# uses: docker/build-push-action@v5 -# with: -# context: . -# file: ${{ env.DOCKERFILE }} -# push: true -# tags: ${{ env.DOCKER_TAG }} + build_and_push_base: + name: Build and push vitess/base Docker images + runs-on: ubuntu-latest # TODO: use larger runner when testing is done +# if: github.repository == 'vitessio/vitess' + + strategy: + fail-fast: true + matrix: + branch: [ latest, mysql57, percona57, percona80 ] + + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set Dockerfile path + run: | + if [[ "${{ matrix.branch }}" == "latest" ]]; then + echo "DOCKERFILE=./docker/base/Dockerfile" >> $GITHUB_ENV + else + echo "DOCKERFILE=./docker/base/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV + fi + + - name: Build and push on main + if: github.ref == 'refs/heads/main' + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + tags: frouioui/base:${{ matrix.branch }} + + ###### + # All code below only applies to new tags + ###### + + - name: Get the Git tag + if: startsWith(github.ref, 'refs/tags/') + run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Set Docker tag name + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' + run: | + if [[ "${{ matrix.branch }}" == "latest" ]]; then + echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV + fi + + - name: Build and push on tags + if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' + uses: docker/build-push-action@v5 + with: + context: . + file: ${{ env.DOCKERFILE }} + push: true + tags: ${{ env.DOCKER_TAG }} build_and_push_k8s: -# needs: build_and_push_base + needs: build_and_push_base name: Build and push vitess/k8s image runs-on: ubuntu-latest # TODO: use larger runner when testing is done # if: github.repository == 'vitessio/vitess' From f83626f789c108fbd7063679fd147015b992ef84 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 19:10:30 -0600 Subject: [PATCH 19/21] remove wip Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 32 ++++++++++++------------- docker/k8s/Dockerfile | 2 +- docker/k8s/mysqlctl/Dockerfile | 2 +- docker/k8s/mysqlctld/Dockerfile | 2 +- docker/k8s/vtadmin/Dockerfile | 2 +- docker/k8s/vtbackup/Dockerfile | 2 +- docker/k8s/vtctl/Dockerfile | 2 +- docker/k8s/vtctlclient/Dockerfile | 2 +- docker/k8s/vtctld/Dockerfile | 2 +- docker/k8s/vtgate/Dockerfile | 2 +- docker/k8s/vtorc/Dockerfile | 2 +- docker/k8s/vttablet/Dockerfile | 2 +- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index 030698c4205..e3fbf1c3a9f 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -15,8 +15,8 @@ permissions: read-all jobs: build_and_push_base: name: Build and push vitess/base Docker images - runs-on: ubuntu-latest # TODO: use larger runner when testing is done -# if: github.repository == 'vitessio/vitess' + runs-on: gh-hosted-runners-16cores-1 + if: github.repository == 'vitessio/vitess' strategy: fail-fast: true @@ -48,7 +48,7 @@ jobs: context: . file: ${{ env.DOCKERFILE }} push: true - tags: frouioui/base:${{ matrix.branch }} + tags: vitess/base:${{ matrix.branch }} ###### # All code below only applies to new tags @@ -62,7 +62,7 @@ jobs: if: startsWith(github.ref, 'refs/tags/') && matrix.branch == 'latest' run: | if [[ "${{ matrix.branch }}" == "latest" ]]; then - echo "DOCKER_TAG=frouioui/base:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/base:${TAG_NAME}" >> $GITHUB_ENV fi - name: Build and push on tags @@ -77,8 +77,8 @@ jobs: build_and_push_k8s: needs: build_and_push_base name: Build and push vitess/k8s image - runs-on: ubuntu-latest # TODO: use larger runner when testing is done - # if: github.repository == 'vitessio/vitess' + runs-on: gh-hosted-runners-16cores-1 + if: github.repository == 'vitessio/vitess' strategy: fail-fast: true @@ -105,7 +105,7 @@ jobs: with: context: ${{ env.DOCKER_CTX }} push: true - tags: frouioui/k8s:latest + tags: vitess/k8s:latest build-args: | VT_BASE_VER=latest DEBIAN_VER=${{ matrix.debian }}-slim @@ -116,7 +116,7 @@ jobs: with: context: ${{ env.DOCKER_CTX }} push: true - tags: frouioui/k8s:latest-${{ matrix.debian }} + tags: vitess/k8s:latest-${{ matrix.debian }} build-args: | VT_BASE_VER=latest DEBIAN_VER=${{ matrix.debian }}-slim @@ -138,8 +138,8 @@ jobs: - name: Set Docker tag name if: startsWith(github.ref, 'refs/tags/') run: | - echo "DOCKER_TAG_DEFAULT_DEBIAN=frouioui/k8s:${TAG_NAME}" >> $GITHUB_ENV - echo "DOCKER_TAG=frouioui/k8s:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV + echo "DOCKER_TAG_DEFAULT_DEBIAN=vitess/k8s:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/k8s:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV # Build and Push component image to DOCKER_TAG, applies to both debian version - name: Build and push on tags using Debian extension @@ -170,8 +170,8 @@ jobs: build_and_push_components: needs: build_and_push_k8s name: Build and push vitess components Docker images - runs-on: ubuntu-latest # TODO: use larger runner when testing is done - # if: github.repository == 'vitessio/vitess' + runs-on: gh-hosted-runners-16cores-1 + if: github.repository == 'vitessio/vitess' strategy: fail-fast: true @@ -199,7 +199,7 @@ jobs: with: context: ${{ env.DOCKER_CTX }} push: true - tags: frouioui/${{ matrix.component }}:latest + tags: vitess/${{ matrix.component }}:latest build-args: | VT_BASE_VER=latest DEBIAN_VER=${{ matrix.debian }}-slim @@ -210,7 +210,7 @@ jobs: with: context: ${{ env.DOCKER_CTX }} push: true - tags: frouioui/${{ matrix.component }}:latest-${{ matrix.debian }} + tags: vitess/${{ matrix.component }}:latest-${{ matrix.debian }} build-args: | VT_BASE_VER=latest DEBIAN_VER=${{ matrix.debian }}-slim @@ -232,8 +232,8 @@ jobs: - name: Set Docker tag name if: startsWith(github.ref, 'refs/tags/') run: | - echo "DOCKER_TAG_DEFAULT_DEBIAN=frouioui/${{ matrix.component }}:${TAG_NAME}" >> $GITHUB_ENV - echo "DOCKER_TAG=frouioui/${{ matrix.component }}:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV + echo "DOCKER_TAG_DEFAULT_DEBIAN=vitess/${{ matrix.component }}:${TAG_NAME}" >> $GITHUB_ENV + echo "DOCKER_TAG=vitess/${{ matrix.component }}:${TAG_NAME}-${{ matrix.debian }}" >> $GITHUB_ENV # Build and Push component image to DOCKER_TAG, applies to both debian version - name: Build and push on tags using Debian extension diff --git a/docker/k8s/Dockerfile b/docker/k8s/Dockerfile index 97ec478fb9f..3ba46595a83 100644 --- a/docker/k8s/Dockerfile +++ b/docker/k8s/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/base:${VT_BASE_VER} AS base +FROM vitess/base:${VT_BASE_VER} AS base FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/mysqlctl/Dockerfile b/docker/k8s/mysqlctl/Dockerfile index 61523263d63..6c449552354 100644 --- a/docker/k8s/mysqlctl/Dockerfile +++ b/docker/k8s/mysqlctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/mysqlctld/Dockerfile b/docker/k8s/mysqlctld/Dockerfile index 0aa70d48db0..6fdb30f012a 100644 --- a/docker/k8s/mysqlctld/Dockerfile +++ b/docker/k8s/mysqlctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtadmin/Dockerfile b/docker/k8s/vtadmin/Dockerfile index 1b774376171..f952681d3c9 100644 --- a/docker/k8s/vtadmin/Dockerfile +++ b/docker/k8s/vtadmin/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=bullseye-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM node:18-${DEBIAN_VER} as node diff --git a/docker/k8s/vtbackup/Dockerfile b/docker/k8s/vtbackup/Dockerfile index 665b53b390c..4a8b3be9d52 100644 --- a/docker/k8s/vtbackup/Dockerfile +++ b/docker/k8s/vtbackup/Dockerfile @@ -16,7 +16,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctl/Dockerfile b/docker/k8s/vtctl/Dockerfile index cb3a0a5aa90..cce3b6dc63c 100644 --- a/docker/k8s/vtctl/Dockerfile +++ b/docker/k8s/vtctl/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctlclient/Dockerfile b/docker/k8s/vtctlclient/Dockerfile index b79b704b1e4..17eab700eb4 100644 --- a/docker/k8s/vtctlclient/Dockerfile +++ b/docker/k8s/vtctlclient/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtctld/Dockerfile b/docker/k8s/vtctld/Dockerfile index 6884d0dca41..5daaf929486 100644 --- a/docker/k8s/vtctld/Dockerfile +++ b/docker/k8s/vtctld/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtgate/Dockerfile b/docker/k8s/vtgate/Dockerfile index fc7abbef45f..3829227e2fa 100644 --- a/docker/k8s/vtgate/Dockerfile +++ b/docker/k8s/vtgate/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vtorc/Dockerfile b/docker/k8s/vtorc/Dockerfile index 7988fe088c0..b62b30ee676 100644 --- a/docker/k8s/vtorc/Dockerfile +++ b/docker/k8s/vtorc/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} diff --git a/docker/k8s/vttablet/Dockerfile b/docker/k8s/vttablet/Dockerfile index f0b936518bb..dd504d7860d 100644 --- a/docker/k8s/vttablet/Dockerfile +++ b/docker/k8s/vttablet/Dockerfile @@ -15,7 +15,7 @@ ARG VT_BASE_VER=latest ARG DEBIAN_VER=stable-slim -FROM frouioui/k8s:${VT_BASE_VER} AS k8s +FROM vitess/k8s:${VT_BASE_VER} AS k8s FROM debian:${DEBIAN_VER} From 2e741462690c51d427f0b5ce1c334c0299a9ecb0 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 19:13:56 -0600 Subject: [PATCH 20/21] remove release.sh and update release docs Signed-off-by: Florent Poinsard --- doc/internal/release/how-to-release.md | 5 +- docker/release.sh | 73 -------------------------- tools/back_to_dev_mode.sh | 1 - tools/create_release.sh | 1 - tools/release_utils.sh | 5 -- 5 files changed, 1 insertion(+), 84 deletions(-) delete mode 100755 docker/release.sh diff --git a/doc/internal/release/how-to-release.md b/doc/internal/release/how-to-release.md index 1d463c088da..fd5caa81e03 100644 --- a/doc/internal/release/how-to-release.md +++ b/doc/internal/release/how-to-release.md @@ -127,10 +127,7 @@ On the release day, there are several things to do: > - The benchmarks need to complete before announcing the blog posts or before they get cross-posted. - **Go back to dev mode on the release branch.** > - The version constants across the codebase must be updated to `SNAPSHOT`. -- **Build k8s Docker images and publish them.** - > - The docker image for `base`, `lite`, etc are built automatically by DockerHub. The k8s images however are dependent on these images and are required to be built manually. - > - These images should be built after the `base` image has been built and available on DockerHub. - > - To build and publish these images, checkout the new release tag that was just created and run `./release.sh` from the directory `./docker`. +- **Ensure the k8s images are available on DockerHub.** - **Close the current GitHub Milestone** > - Once we are done releasing the current version, we must close its corresponding GitHub Milestone as the development cycle for it is over. > - **This does not apply if we are releasing an RC release.** For instance, if we are releasing `v18.0.0-rc1` we want to keep the `v18.0.0` milestone opened as development is not fully done for `v18.0.0`. diff --git a/docker/release.sh b/docker/release.sh deleted file mode 100755 index 938cf91f1a4..00000000000 --- a/docker/release.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/bash -set -ex - -vt_base_version='v18.0.0-SNAPSHOT' -debian_versions='bullseye bookworm' -default_debian_version='bookworm' - -docker pull --platform linux/amd64 vitess/base:$vt_base_version - -for debian_version in $debian_versions -do - echo "####### Building vitess/vt:$debian_version" - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/k8s:$vt_base_version-$debian_version k8s - docker tag vitess/k8s:$vt_base_version-$debian_version vitess/k8s:$vt_base_version - docker push vitess/k8s:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/k8s:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtadmin:$vt_base_version-$debian_version k8s/vtadmin - docker tag vitess/vtadmin:$vt_base_version-$debian_version vitess/vtadmin:$vt_base_version - docker push vitess/vtadmin:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtadmin:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtorc:$vt_base_version-$debian_version k8s/vtorc - docker tag vitess/vtorc:$vt_base_version-$debian_version vitess/vtorc:$vt_base_version - docker push vitess/vtorc:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtorc:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtgate:$vt_base_version-$debian_version k8s/vtgate - docker tag vitess/vtgate:$vt_base_version-$debian_version vitess/vtgate:$vt_base_version - docker push vitess/vtgate:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtgate:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vttablet:$vt_base_version-$debian_version k8s/vttablet - docker tag vitess/vttablet:$vt_base_version-$debian_version vitess/vttablet:$vt_base_version - docker push vitess/vttablet:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vttablet:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/mysqlctld:$vt_base_version-$debian_version k8s/mysqlctld - docker tag vitess/mysqlctld:$vt_base_version-$debian_version vitess/mysqlctld:$vt_base_version - docker push vitess/mysqlctld:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/mysqlctld:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/mysqlctl:$vt_base_version-$debian_version k8s/mysqlctl - docker tag vitess/mysqlctl:$vt_base_version-$debian_version vitess/mysqlctl:$vt_base_version - docker push vitess/mysqlctl:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/mysqlctl:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtctl:$vt_base_version-$debian_version k8s/vtctl - docker tag vitess/vtctl:$vt_base_version-$debian_version vitess/vtctl:$vt_base_version - docker push vitess/vtctl:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtctl:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtctlclient:$vt_base_version-$debian_version k8s/vtctlclient - docker tag vitess/vtctlclient:$vt_base_version-$debian_version vitess/vtctlclient:$vt_base_version - docker push vitess/vtctlclient:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtctlclient:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/vtctld:$vt_base_version-$debian_version k8s/vtctld - docker tag vitess/vtctld:$vt_base_version-$debian_version vitess/vtctld:$vt_base_version - docker push vitess/vtctld:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/vtctld:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/logrotate:$vt_base_version-$debian_version k8s/logrotate - docker tag vitess/logrotate:$vt_base_version-$debian_version vitess/logrotate:$vt_base_version - docker push vitess/logrotate:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/logrotate:$vt_base_version; fi - - docker build --platform linux/amd64 --build-arg VT_BASE_VER=$vt_base_version --build-arg DEBIAN_VER=$debian_version-slim -t vitess/logtail:$vt_base_version-$debian_version k8s/logtail - docker tag vitess/logtail:$vt_base_version-$debian_version vitess/logtail:$vt_base_version - docker push vitess/logtail:$vt_base_version-$debian_version - if [[ $debian_version == $default_debian_version ]]; then docker push vitess/logtail:$vt_base_version; fi -done diff --git a/tools/back_to_dev_mode.sh b/tools/back_to_dev_mode.sh index 9f4cc25b71f..a3b945fd87d 100755 --- a/tools/back_to_dev_mode.sh +++ b/tools/back_to_dev_mode.sh @@ -48,7 +48,6 @@ fi function doBackToDevMode () { # Preparing the "dev mode" commit updateJava $DEV_VERSION - updateDockerReleaseScript $DEV_VERSION updateVersionGo $DEV_VERSION git add --all diff --git a/tools/create_release.sh b/tools/create_release.sh index 77c9cb9d423..68e051f884e 100755 --- a/tools/create_release.sh +++ b/tools/create_release.sh @@ -61,7 +61,6 @@ function createRelease () { # Preparing the release commit updateVitessExamples $RELEASE_VERSION $VTOP_VERSION updateJava $RELEASE_VERSION - updateDockerReleaseScript $RELEASE_VERSION updateVersionGo $RELEASE_VERSION ## Create the commit for this release and tag it diff --git a/tools/release_utils.sh b/tools/release_utils.sh index ff7d348bcd3..d94d2fe7f31 100755 --- a/tools/release_utils.sh +++ b/tools/release_utils.sh @@ -24,11 +24,6 @@ function checkGitState() { fi } -function updateDockerReleaseScript () { - sed -i.bak -E "s/vt_base_version=.*/vt_base_version='v$1'/g" $ROOT/docker/release.sh - rm -f $ROOT/docker/release.sh.bak -} - function checkoutNewBranch () { branch_name=$1 From d9cdc3f57af61e1a9dbca8a183f09cd8eb95f98d Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Tue, 17 Oct 2023 19:23:23 -0600 Subject: [PATCH 21/21] fix TAG_NAME variable usage during tag builds Signed-off-by: Florent Poinsard --- .github/workflows/docker_build_base.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker_build_base.yml b/.github/workflows/docker_build_base.yml index e3fbf1c3a9f..af459215099 100644 --- a/.github/workflows/docker_build_base.yml +++ b/.github/workflows/docker_build_base.yml @@ -150,7 +150,7 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} build-args: | - VT_BASE_VER=${TAG_NAME} + VT_BASE_VER=${{ env.TAG_NAME }} DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) @@ -163,7 +163,7 @@ jobs: push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: | - VT_BASE_VER=${TAG_NAME} + VT_BASE_VER=${{ env.TAG_NAME }} DEBIAN_VER=${{ matrix.debian }}-slim @@ -244,7 +244,7 @@ jobs: push: true tags: ${{ env.DOCKER_TAG }} build-args: | - VT_BASE_VER=${TAG_NAME} + VT_BASE_VER=${{ env.TAG_NAME }} DEBIAN_VER=${{ matrix.debian }}-slim # Build and Push component image to DOCKER_TAG_DEFAULT_DEBIAN, only applies when building the default Debian version (bookworm) @@ -257,5 +257,5 @@ jobs: push: true tags: ${{ env.DOCKER_TAG_DEFAULT_DEBIAN }} build-args: | - VT_BASE_VER=${TAG_NAME} + VT_BASE_VER=${{ env.TAG_NAME }} DEBIAN_VER=${{ matrix.debian }}-slim