diff --git a/.github/workflows/docs_spread.yaml b/.github/workflows/docs_spread.yaml new file mode 100644 index 0000000..8bfeb25 --- /dev/null +++ b/.github/workflows/docs_spread.yaml @@ -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 diff --git a/docs/changelog.md b/docs/changelog.md index 15195f5..80b8d9e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -10,6 +10,10 @@ Each revision is versioned by the date of the revision. Place any unreleased changes here, that are subject to release in coming versions :). +## 2026-02-19 + +- Update tutorial and add workflow to test the tutorial using Spread. + ## 2025-01-11 - Fixed the model config variable names for HTTP and HTTPS proxy. @@ -25,4 +29,3 @@ Place any unreleased changes here, that are subject to release in coming version ## 2025-10-9 - Added core functionality and tests to the charm. - diff --git a/docs/tutorial.md b/docs/tutorial.md index bda54c6..526ccd2 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -46,8 +46,14 @@ Deploy the Ubuntu charm: juju deploy ubuntu ``` + + Wait until the deployment is complete: + + ```bash juju status --watch 1s ``` @@ -59,6 +65,8 @@ App Version Status Scale Charm Channel Rev Exposed Message ubuntu 24.04 active 1 ubuntu latest/stable 26 no ``` + + ## Deploy the aproxy subordinate charm Now deploy the aproxy charm with the target proxy address and proxy port. In this tutorial, we will use `127.0.0.1:80`. @@ -89,6 +97,8 @@ juju status The output should be similar to the following: + + ``` Model Controller Cloud/Region Version aproxy-tutorial lxd localhost 3.4.1 @@ -102,6 +112,8 @@ ubuntu/0* active idle 0 10.152.184.228 aproxy/0* active idle 10.152.184.228 Service ready on target proxy 127.0.0.1:80 ``` + + You should see both applications in an **active** state, with aproxy listed as a subordinate unit to the Ubuntu charm. ## Run a configuration test @@ -122,6 +134,8 @@ juju config aproxy The output should be similar to the following: + + ``` application: aproxy application-config: @@ -165,12 +179,20 @@ settings: ``` + + ## Run a connection test To confirm that aproxy is forwarding properly, make an outbound TCP connection on the principal charm. For example, let's curl `cloud-images.ubuntu.com` from inside `ubuntu/0` unit: + + + + ```bash juju ssh ubuntu/0 curl -v cloud-images.ubuntu.com @@ -221,7 +243,7 @@ Congratulations! 🎉 You have successfully deployed the aproxy subordinate charm, related it to a primary application, and verified that it works as expected. -When you’re done with the tutorial, clean up your environment to free resources: +When you're done with the tutorial, clean up your environment to free resources: ```bash juju destroy-model aproxy-tutorial --destroy-storage --force --no-prompt @@ -233,6 +255,8 @@ If you used a Multipass VM for this tutorial and no longer need it, you can remo multipass delete --purge my-juju-vm ``` + + ## Next steps Visit the [aproxy charm documentation](https://charmhub.io/aproxy/docs) for advanced usage and configuration options. diff --git a/spread.yaml b/spread.yaml new file mode 100644 index 0000000..d0fc682 --- /dev/null +++ b/spread.yaml @@ -0,0 +1,43 @@ +# 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 + +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