Fix error code received from vttablets on context expiration #954
Workflow file for this run
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
name: Build Docker Images | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
concurrency: | |
group: format('{0}-{1}', ${{ github.ref }}, 'Build Docker Images') | |
cancel-in-progress: true | |
permissions: read-all | |
jobs: | |
push: | |
name: Set push variable | |
runs-on: ubuntu-20.04 | |
if: github.repository == 'vitessio/vitess' | |
outputs: | |
push: ${{ steps.push.outputs.push }} | |
steps: | |
- name: Set push variable | |
id: push | |
run: | | |
push='false' | |
if [[ "${{github.event.pull_request}}" == "" ]]; then | |
push='true' | |
fi | |
echo Push ${push} | |
echo "push=${push}" >> $GITHUB_OUTPUT | |
build_and_push_vttestserver: | |
name: Build and push vttestserver | |
runs-on: gh-hosted-runners-16cores-1 | |
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success' | |
needs: | |
- push | |
strategy: | |
fail-fast: true | |
matrix: | |
branch: [ mysql80 ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Login to Docker Hub | |
if: needs.push.outputs.push == 'true' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set Dockerfile path | |
run: | | |
echo "DOCKERFILE=./docker/vttestserver/Dockerfile.${{ matrix.branch }}" >> $GITHUB_ENV | |
- name: Build and push on main | |
if: startsWith(github.ref, 'refs/tags/') == false | |
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: . | |
file: ${{ env.DOCKERFILE }} | |
push: ${{ needs.push.outputs.push }} | |
tags: vitess/vttestserver:${{ 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/') | |
run: | | |
echo "DOCKER_TAG=vitess/vttestserver:${TAG_NAME}-${{ matrix.branch }}" >> $GITHUB_ENV | |
- name: Build and push on tags | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: . | |
file: ${{ env.DOCKERFILE }} | |
push: true | |
tags: ${{ env.DOCKER_TAG }} | |
build_and_push_lite: | |
name: Build and push lite | |
runs-on: gh-hosted-runners-16cores-1 | |
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success' | |
needs: | |
- push | |
strategy: | |
fail-fast: true | |
matrix: | |
branch: [ latest, percona80 ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Login to Docker Hub | |
if: needs.push.outputs.push == 'true' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
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: startsWith(github.ref, 'refs/tags/') == false | |
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: . | |
file: ${{ env.DOCKERFILE }} | |
push: ${{ needs.push.outputs.push }} | |
tags: vitess/lite:${{ 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/') | |
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@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: . | |
file: ${{ env.DOCKERFILE }} | |
push: true | |
tags: ${{ env.DOCKER_TAG }} | |
build_and_push_components: | |
name: Build and push | |
runs-on: gh-hosted-runners-16cores-1 | |
if: github.repository == 'vitessio/vitess' && needs.push.result == 'success' && needs.build_and_push_lite.result == 'success' | |
needs: | |
- push | |
- build_and_push_lite | |
strategy: | |
fail-fast: true | |
matrix: | |
debian: [ bullseye, bookworm ] | |
component: [ vtadmin, vtorc, vtgate, vttablet, mysqlctld, mysqlctl, vtctl, vtctlclient, vtctld, vtctldclient, logrotate, logtail, vtbackup, vtexplain ] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: Login to Docker Hub | |
if: needs.push.outputs.push == 'true' | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set Docker context path | |
run: | | |
echo "DOCKER_CTX=./docker/binaries/${{ matrix.component }}" >> $GITHUB_ENV | |
- name: Build and push on main latest tag | |
if: startsWith(github.ref, 'refs/tags/') == false && matrix.debian == 'bookworm' | |
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: ${{ env.DOCKER_CTX }} | |
push: ${{ needs.push.outputs.push }} | |
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: startsWith(github.ref, 'refs/tags/') == false | |
uses: docker/build-push-action@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
with: | |
context: ${{ env.DOCKER_CTX }} | |
push: ${{ needs.push.outputs.push }} | |
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@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
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@ca052bb54ab0790a636c9b5f226502c73d547a25 # v5.4.0 | |
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 |