Skip to content
Merged
16 changes: 16 additions & 0 deletions .github/workflows/docs_spread.yaml
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
5 changes: 4 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.

26 changes: 25 additions & 1 deletion docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@ Deploy the Ubuntu charm:
juju deploy ubuntu
```

<!-- SPREAD
juju wait-for application ubuntu --query='status=="active"'
-->

Wait until the deployment is complete:

<!-- SPREAD SKIP -->

```bash
juju status --watch 1s
Comment thread
florentianayuwono marked this conversation as resolved.
```
Expand All @@ -59,6 +65,8 @@ App Version Status Scale Charm Channel Rev Exposed Message
ubuntu 24.04 active 1 ubuntu latest/stable 26 no
```

<!-- SPREAD SKIP END -->

## 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`.
Expand Down Expand Up @@ -89,6 +97,8 @@ juju status

The output should be similar to the following:

<!-- SPREAD SKIP -->

```
Model Controller Cloud/Region Version
aproxy-tutorial lxd localhost 3.4.1
Expand All @@ -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
```

<!-- SPREAD SKIP END -->

You should see both applications in an **active** state, with aproxy listed as a subordinate unit to the Ubuntu charm.

## Run a configuration test
Expand All @@ -122,6 +134,8 @@ juju config aproxy

The output should be similar to the following:

<!-- SPREAD SKIP -->

```
application: aproxy
application-config:
Expand Down Expand Up @@ -165,12 +179,20 @@ settings:

```

<!-- SPREAD SKIP END -->

## 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:

<!-- SPREAD
juju ssh ubuntu/0 -- curl -sL -o /dev/null -w "%{http_code}" cloud-images.ubuntu.com | grep -q '200'
-->

<!-- SPREAD SKIP -->

```bash
juju ssh ubuntu/0
curl -v cloud-images.ubuntu.com
Expand Down Expand Up @@ -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 youre 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
Expand All @@ -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
```

<!-- SPREAD SKIP END -->

## Next steps

Visit the [aproxy charm documentation](https://charmhub.io/aproxy/docs) for advanced usage and configuration options.
43 changes: 43 additions & 0 deletions spread.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading