vtcombo: enable VReplication and OnlineDDL support (#2) #9
This file contains hidden or 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: Online DDL flow - Upgrade Downgrade Testing | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| - "release-[0-9]+.[0-9]" | |
| tags: '**' | |
| pull_request: | |
| branches: '**' | |
| concurrency: | |
| group: format('{0}-{1}', ${{ github.ref }}, 'Upgrade Downgrade Testing Online DDL flow') | |
| cancel-in-progress: true | |
| permissions: read-all | |
| # This test ensures that our Online DDL + VReplication + throttler components | |
| # work using primary and replica vttablets built on different versions. | |
| jobs: | |
| upgrade_downgrade_test: | |
| timeout-minutes: 60 | |
| name: Run Upgrade Downgrade Test - Online DDL flow | |
| runs-on: oracle-vm-16cpu-64gb-x86-64 | |
| steps: | |
| - name: Skip CI | |
| run: | | |
| if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then | |
| echo "skipping CI due to the 'Skip CI' label" | |
| exit 1 | |
| fi | |
| - name: Check out commit's code | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: 'false' | |
| - name: Check for changes in relevant files | |
| uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3.0.1 | |
| id: changes | |
| with: | |
| token: '' | |
| filters: | | |
| end_to_end: | |
| - 'test/config.json' | |
| - 'go/**' | |
| - 'go/**/*.go' | |
| - 'test.go' | |
| - 'Makefile' | |
| - 'build.env' | |
| - 'go.sum' | |
| - 'go.mod' | |
| - 'proto/*.proto' | |
| - 'tools/**' | |
| - 'config/**' | |
| - 'bootstrap.sh' | |
| - '.github/workflows/upgrade_downgrade_test_onlineddl_flow.yml' | |
| - name: Set output with latest release branch | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| id: output-previous-release-ref | |
| run: | | |
| previous_release_ref=$(./tools/get_previous_release.sh ${{github.base_ref}} ${{github.ref}}) | |
| echo $previous_release_ref | |
| echo "previous_release_ref=${previous_release_ref}" >> $GITHUB_OUTPUT | |
| - name: Set output with next release branch | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| id: output-next-release-ref | |
| run: | | |
| next_release_ref=$(./tools/get_next_release.sh ${{github.base_ref}} ${{github.ref}}) | |
| echo $next_release_ref | |
| echo "next_release_ref=${next_release_ref}" >> $GITHUB_OUTPUT | |
| - name: Tune the OS | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: ./.github/actions/tune-os | |
| - name: Set up python | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1 | |
| - name: Setup MySQL | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: ./.github/actions/setup-mysql | |
| with: | |
| flavor: mysql-8.4 | |
| - name: Get base dependencies | |
| timeout-minutes: 10 | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| sudo DEBIAN_FRONTEND="noninteractive" apt-get update | |
| # Install everything else we need, and configure | |
| sudo apt-get install -y make unzip g++ etcd-client etcd-server curl git wget | |
| sudo service etcd stop | |
| # Checkout to the last release of Vitess | |
| - name: Check out last version's code (${{ steps.output-previous-release-ref.outputs.previous_release_ref }}) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: ${{ steps.output-previous-release-ref.outputs.previous_release_ref }} | |
| persist-credentials: 'false' | |
| - name: Set up Go | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - name: Get dependencies for the last release | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| go mod download | |
| - name: Building last release's binaries | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| timeout-minutes: 10 | |
| run: | | |
| echo "building last release: $(git rev-parse HEAD)" | |
| source build.env | |
| make build | |
| mkdir -p /tmp/vitess-build-last/ | |
| cp -R bin /tmp/vitess-build-last/ | |
| rm -Rf bin/* | |
| # Checkout to the next release of Vitess | |
| - name: Check out next version's code (${{ steps.output-next-release-ref.outputs.next_release_ref }}) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| ref: ${{ steps.output-next-release-ref.outputs.next_release_ref }} | |
| persist-credentials: 'false' | |
| - name: Set up Go | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - name: Get dependencies for the next release | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| go mod download | |
| - name: Building next release's binaries | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| timeout-minutes: 10 | |
| run: | | |
| echo "building next release: $(git rev-parse HEAD)" | |
| source build.env | |
| NOVTADMINBUILD=1 make build | |
| mkdir -p /tmp/vitess-build-next/ | |
| cp -R bin /tmp/vitess-build-next/ | |
| rm -Rf bin/* | |
| # Checkout to this build's commit | |
| - name: Check out commit's code | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| persist-credentials: 'false' | |
| - name: Set up Go | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | |
| with: | |
| go-version-file: go.mod | |
| cache: false | |
| - name: Get dependencies for this commit | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| go mod download | |
| - name: Building the binaries for this commit | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| timeout-minutes: 10 | |
| run: | | |
| echo "building this SHA: $(git rev-parse HEAD)" | |
| source build.env | |
| make build | |
| mkdir -p /tmp/vitess-build-current/ | |
| cp -R bin /tmp/vitess-build-current/ | |
| # Copy vttablet and related binaries under new names | |
| - name: Use current version Vtctl, and other version VTTablet | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| source build.env | |
| cp /tmp/vitess-build-last/bin/vttablet $PWD/bin/vttablet-last | |
| cp /tmp/vitess-build-last/bin/mysqlctl $PWD/bin/mysqlctl-last | |
| cp /tmp/vitess-build-last/bin/mysqlctld $PWD/bin/mysqlctld-last | |
| cp /tmp/vitess-build-next/bin/vttablet $PWD/bin/vttablet-next | |
| cp /tmp/vitess-build-next/bin/mysqlctl $PWD/bin/mysqlctl-next | |
| cp /tmp/vitess-build-next/bin/mysqlctld $PWD/bin/mysqlctld-next | |
| $PWD/bin/vttablet-last --version | |
| $PWD/bin/vttablet --version | |
| $PWD/bin/vttablet-next --version | |
| # Running a test with primary tablet at version n (current SHA) and replica vttablet at version n-1 | |
| - name: Run Online DDL tests (primary=N, replica=N-1) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| rm -rf /tmp/vtdataroot | |
| mkdir -p /tmp/vtdataroot | |
| source build.env | |
| export PRIMARY_TABLET_BINARY_SUFFIX="" | |
| export REPLICA_TABLET_BINARY_SUFFIX="-last" | |
| go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_onlineddl_flow | |
| # Running a test with primary tablet at version n-1 and replica vttablet at version n (current SHA) | |
| - name: Run Online DDL tests (primary=N-1, replica=N) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| rm -rf /tmp/vtdataroot | |
| mkdir -p /tmp/vtdataroot | |
| source build.env | |
| export PRIMARY_TABLET_BINARY_SUFFIX="-last" | |
| export REPLICA_TABLET_BINARY_SUFFIX="" | |
| go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_onlineddl_flow | |
| # Running a test with primary tablet at version n+1 and replica vttablet at version n (current SHA) | |
| - name: Run Online DDL tests (primary=N+1, replica=N) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| rm -rf /tmp/vtdataroot | |
| mkdir -p /tmp/vtdataroot | |
| source build.env | |
| export PRIMARY_TABLET_BINARY_SUFFIX="-next" | |
| export REPLICA_TABLET_BINARY_SUFFIX="" | |
| go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_onlineddl_flow | |
| # Running a test with primary tablet at version n (current SHA) and replica vttablet at version n+1 | |
| - name: Run Online DDL tests (primary=N, replica=N+1) | |
| if: steps.changes.outputs.end_to_end == 'true' | |
| run: | | |
| rm -rf /tmp/vtdataroot | |
| mkdir -p /tmp/vtdataroot | |
| source build.env | |
| export PRIMARY_TABLET_BINARY_SUFFIX="" | |
| export REPLICA_TABLET_BINARY_SUFFIX="-next" | |
| go run test.go -skip-build -keep-data=false -docker=false -print-log -follow -tag upgrade_downgrade_onlineddl_flow |