-
Notifications
You must be signed in to change notification settings - Fork 1
docs: add spread testing for tutorial #66
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7a22d34
docs: add spread testing for tutorial
florentianayuwono aca1b99
add spread skips
florentianayuwono cf6c521
switch to lxd for machine charm
florentianayuwono d2208dd
add output check
florentianayuwono 828be18
remove juju command
florentianayuwono 9e370ae
Apply suggestions from code review
florentianayuwono 5ae8787
add concierge
florentianayuwono 695d0ac
modify grep
florentianayuwono af6a39b
change grep
florentianayuwono 217dd72
remove sign
florentianayuwono 2bc358c
remove file
florentianayuwono b48ddcf
remove backend
florentianayuwono 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 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,16 @@ | ||
| name: "Test tutorial documentation with Spread" | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - "docs/tutorial.md" | ||
|
|
||
| jobs: | ||
| tutorial-spread-test: | ||
| uses: canonical/operator-workflows/.github/workflows/docs_spread.yaml@main | ||
| secrets: inherit | ||
| with: | ||
| input-file: docs/tutorial.md | ||
| output-dir: tests/spread/tutorial/ | ||
| spread-job: github-ci:ubuntu-24.04-64:tests/spread/tutorial |
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
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,99 @@ | ||
| # Copyright 2026 Canonical Ltd. | ||
| # See LICENSE file for licensing details. | ||
|
|
||
| project: aproxy-operator | ||
|
|
||
| path: /aproxy-operator | ||
| environment: | ||
| PROJECT_PATH: /aproxy-operator | ||
|
|
||
| # important to ensure adhoc and linode/qemu behave the same | ||
| SUDO_USER: "" | ||
| SUDO_UID: "" | ||
|
|
||
| LANG: "C.UTF-8" | ||
| LANGUAGE: "en" | ||
|
|
||
| exclude: | ||
| - .git | ||
| - .github | ||
| - .tox | ||
| - .venv | ||
| - .*_cache | ||
| - charmcraft | ||
| - libexec | ||
| - schema | ||
| - snap | ||
|
|
||
| backends: | ||
| multipass: | ||
| type: adhoc | ||
| allocate: | | ||
| # Mitigate issues found when launching multiple Multipass instances | ||
| # concurrently. See https://github.com/canonical/multipass/issues/3336 | ||
| sleep 0.$RANDOM | ||
| sleep 0.$RANDOM | ||
| sleep 0.$RANDOM | ||
|
|
||
| mkdir -p "$HOME/.spread" | ||
| export counter_file="$HOME/.spread/multipass-count" | ||
|
|
||
| # Sequential variable for unique instance names | ||
| instance_num=$(flock -x $counter_file bash -c ' | ||
| [ -s $counter_file ] || echo 0 > $counter_file | ||
| num=$(< $counter_file) | ||
| echo $num | ||
| echo $(( $num + 1 )) > $counter_file') | ||
|
|
||
| multipass_image=$(echo "${SPREAD_SYSTEM}" | sed -e s/ubuntu-// -e s/-64//) | ||
|
|
||
| system=$(echo "${SPREAD_SYSTEM}" | tr . -) | ||
| instance_name="spread-${SPREAD_BACKEND}-${instance_num}-${system}" | ||
|
|
||
| multipass launch -vv --cpus 4 --disk 50G --memory 8G --name "${instance_name}" "${multipass_image}" | ||
|
|
||
| # Get the IP from the instance | ||
| ip=$(multipass info --format csv "$instance_name" | tail -1 | cut -d\, -f3) | ||
| ADDRESS "$ip" | ||
| discard: | | ||
| instance_name=$(multipass list --format csv | grep $SPREAD_SYSTEM_ADDRESS | cut -f1 -d\,) | ||
| multipass delete --purge "${instance_name}" | ||
| systems: | ||
| - ubuntu-24.04-64: | ||
| username: spread | ||
| password: spread | ||
| workers: 1 | ||
| github-ci: | ||
| type: adhoc | ||
| allocate: | | ||
| echo "Allocating ad-hoc $SPREAD_SYSTEM" | ||
| if [ -z "${GITHUB_RUN_ID:-}" ]; then | ||
| FATAL "this back-end only works inside GitHub CI" | ||
| exit 1 | ||
| fi | ||
| echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' | sudo tee /etc/sudoers.d/99-spread-users | ||
| ADDRESS localhost:22 | ||
| discard: | | ||
| echo "Discarding ad-hoc $SPREAD_SYSTEM" | ||
| systems: | ||
| - ubuntu-24.04-64: | ||
| username: ubuntu | ||
| password: ubuntu | ||
| workers: 1 | ||
|
|
||
| prepare: | | ||
| snap refresh --hold | ||
|
|
||
| if systemctl is-enabled unattended-upgrades.service; then | ||
| systemctl stop unattended-upgrades.service | ||
| systemctl mask unattended-upgrades.service | ||
| fi | ||
|
|
||
| sudo snap install --classic concierge | ||
| sudo concierge prepare -p machine | ||
|
|
||
| suites: | ||
| tests/spread/: | ||
| summary: tutorial test | ||
| systems: | ||
| - ubuntu-24.04-64 |
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.
Uh oh!
There was an error while loading. Please reload this page.