-
Notifications
You must be signed in to change notification settings - Fork 94
Migrate e2e tests from Buildkite to GitHub Actions #781
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
Open
nickvanw
wants to merge
9
commits into
main
Choose a base branch
from
ci/migrate-to-github-actions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ec1fd6e
Migrate e2e tests from Buildkite to GitHub Actions
nickvanw a34028f
Use self-hosted vitess-ubuntu-shr-4cpu-16gb runners
nickvanw 2cd70d7
Switch e2e runners to depot-ubuntu-22.04-4
nickvanw c36fbbe
Use vitess-operator-runner 8-core hosted runners
nickvanw 7581142
Fix e2e kind hostname overflow and narrow chromium install
nickvanw f582658
Disable Ubuntu 24.04 apparmor userns restriction before kind
nickvanw ed30a3b
Fully disable AppArmor and all userns restrictions before kind
nickvanw f9a4737
Drop apparmor teardown — it breaks the docker build
nickvanw 8bfedb6
Build operator image before tearing down AppArmor
nickvanw 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| name: e2e-test | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - release-** | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - release-** | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: ${{ matrix.test.name }} | ||
| runs-on: vitess-operator-runner | ||
| timeout-minutes: 40 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test: | ||
| - name: "Upgrade Test" | ||
| target: upgrade-test | ||
| - name: "Backup Restore Test" | ||
| target: backup-restore-test | ||
| - name: "Backup Schedule Cluster/Keyspace Scope Test" | ||
| target: backup-schedule-keyspace-test | ||
| - name: "Backup Schedule Test" | ||
| target: backup-schedule-test | ||
| - name: "Backup Schedule vtctldclient Method Test" | ||
| target: backup-schedule-vtctldclient-test | ||
| - name: "VTOrc and VTAdmin Test" | ||
| target: vtorc-vtadmin-test | ||
| - name: "Unmanaged Tablet Test" | ||
| target: unmanaged-tablet-test | ||
| - name: "HPA Test" | ||
| target: hpa-test | ||
| env: | ||
| # Kept short because kind sets the control-plane container hostname to | ||
| # "kind-<CI_JOB_ID>-control-plane", and Linux HOST_NAME_MAX is 64. | ||
| CI_JOB_ID: ${{ matrix.test.target }} | ||
| steps: | ||
| - name: Prepare runner for kind (Ubuntu 24.04) | ||
| run: | | ||
| # Ubuntu 24.04 ships with several kernel-level restrictions on | ||
| # unprivileged user namespaces that break mysqld when it runs inside | ||
| # a nested container (vttablet pod → kind → docker → runner VM). | ||
| # Buildkite's older-kernel agents don't hit these. | ||
| # | ||
| # Only sysctls here — do NOT stop apparmor.service or run | ||
| # aa-teardown, because Docker/BuildKit applies the docker-default | ||
| # AppArmor profile to build containers and will fail with | ||
| # "unable to apply apparmor profile" if the profile is unloaded. | ||
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 || true | ||
| sudo sysctl -w kernel.apparmor_restrict_unprivileged_unconfined=0 || true | ||
| sudo sysctl -w kernel.unprivileged_userns_clone=1 || true | ||
| sudo sysctl -w user.max_user_namespaces=65536 || true | ||
| # kind needs generous inotify limits once pod count grows. | ||
| sudo sysctl -w fs.inotify.max_user_watches=524288 | ||
| sudo sysctl -w fs.inotify.max_user_instances=512 | ||
|
|
||
| - name: Check out code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Go | ||
| uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 | ||
| with: | ||
| go-version-file: go.mod | ||
|
|
||
| - name: Install test dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y mysql-client | ||
|
|
||
| - name: Install chromium (vtorc-vtadmin only) | ||
| if: matrix.test.target == 'vtorc-vtadmin-test' | ||
| uses: browser-actions/setup-chrome@v2 | ||
| with: | ||
| chrome-version: stable | ||
|
|
||
| - name: Alias chrome as chromium-browser | ||
| if: matrix.test.target == 'vtorc-vtadmin-test' | ||
| run: | | ||
| CHROME_BIN="$(command -v chrome || command -v google-chrome)" | ||
| sudo ln -sf "$CHROME_BIN" /usr/local/bin/chromium-browser | ||
|
|
||
| - name: Build operator image | ||
| # Build before we tear down AppArmor. BuildKit refuses to start build | ||
| # containers once the docker-default AppArmor profile is unloaded. | ||
| # The image is tagged vitess-operator-pr:latest, which the test's | ||
| # setupBuildContainerImage will detect and skip rebuilding. | ||
| run: docker build --progress plain --file build/Dockerfile.release --tag vitess-operator-pr:latest . | ||
|
|
||
| - name: Disable AppArmor before kind | ||
| # Now tear down AppArmor so the kind container and the pods it runs | ||
| # (in particular mysqld inside vttablet pods) aren't subject to Ubuntu | ||
| # 24.04's docker-default profile, which appears to be what's killing | ||
| # mysqld on startup ("Failed to open required defaults file" within | ||
| # ~17ms of spawn even though mysqlctld just wrote the file). | ||
| run: | | ||
| sudo systemctl stop apparmor.service || true | ||
| sudo systemctl disable apparmor.service || true | ||
| sudo aa-teardown || true | ||
|
|
||
| - name: Run ${{ matrix.test.name }} | ||
| run: make ${{ matrix.test.target }} | ||
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
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
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.
actions/checkoutis referenced by a mutable tag (@v6). For supply-chain safety and reproducibility, pin this action to a specific commit SHA (similar to howactions/setup-gois pinned) so workflow runs can't change behavior unexpectedly if the tag is moved.