-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continue building base/k8s when tag version is below v20 #15638
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4aa4b9c
Skip workflow if we are below version 20
frouioui 8472a89
Re-add old base/lite actions for previous releases
frouioui fa4efbe
Rename old base action
frouioui 6df6b0d
Copy config folder in lite image
frouioui 091cdc9
More debug
frouioui ab696dd
install ca-cert in the common bootstrap image
frouioui 143a53a
copy ca-cert into the lite image
frouioui 1e4de40
copy cert on all lite images
frouioui 0caa1b7
remove any debug
frouioui b206241
Remove build on PR
frouioui File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
name: Docker Build Base (<v20) | ||
on: | ||
push: | ||
tags-ignore: | ||
- 'v[2-9][0-9]*.*' # ignore all the tags greater or equal to v20.0.0 | ||
|
||
concurrency: | ||
group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Base (<v20)') | ||
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@v4 | ||
|
||
- 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 }} | ||
|
||
###### | ||
# 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=vitess/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 | ||
name: Build and push vitess/k8s image | ||
runs-on: gh-hosted-runners-16cores-1 | ||
if: github.repository == 'vitessio/vitess' | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
debian: [ bullseye, bookworm ] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- 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: vitess/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: vitess/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=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 | ||
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=${{ 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) | ||
# 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=${{ env.TAG_NAME }} | ||
DEBIAN_VER=${{ matrix.debian }}-slim | ||
|
||
|
||
build_and_push_components: | ||
needs: build_and_push_k8s | ||
name: Build and push vitess components Docker images | ||
runs-on: gh-hosted-runners-16cores-1 | ||
if: github.repository == 'vitessio/vitess' | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
debian: [ bullseye, bookworm ] | ||
component: [ vtadmin, vtorc, vtgate, vttablet, mysqlctld, mysqlctl, vtctl, vtctlclient, vtctld, logrotate, logtail, vtbackup, vtexplain ] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- 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/${{ matrix.component }}" >> $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: vitess/${{ matrix.component }}: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: vitess/${{ matrix.component }}: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 images to three tags, i.e. for 'v19.0.0' we push to: | ||
# | ||
# 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_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 | ||
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=${{ 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) | ||
# 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=${{ env.TAG_NAME }} | ||
DEBIAN_VER=${{ matrix.debian }}-slim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Docker Build Lite (<v20) | ||
on: | ||
push: | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
tags-ignore: | ||
- 'v[2-9][0-9]*.*' # ignore all the tags greater or equal to v20.0.0 | ||
|
||
concurrency: | ||
group: format('{0}-{1}', ${{ github.ref }}, 'Docker Build Lite (<v20)') | ||
cancel-in-progress: true | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
build_and_push: | ||
name: Build and push vitess/lite Docker images | ||
runs-on: gh-hosted-runners-16cores-1 | ||
if: github.repository == 'vitessio/vitess' | ||
|
||
strategy: | ||
fail-fast: true | ||
matrix: | ||
branch: [ latest ] | ||
|
||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- 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/lite/Dockerfile" >> $GITHUB_ENV | ||
else | ||
echo "DOCKERFILE=./docker/lite/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/lite:${{ 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/lite:${TAG_NAME}" >> $GITHUB_ENV | ||
else | ||
echo "DOCKER_TAG=vitess/lite:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV | ||
fi | ||
|
||
- name: Build and push on tags | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ${{ env.DOCKERFILE }} | ||
push: true | ||
tags: ${{ env.DOCKER_TAG }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pure copy of what we used to have before #15620, only the workflow name and the
tags-ignore
field on lines 4 and 5 changed.