From 6864e826d8d136e6ad1e8799cb7ed704107b2725 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 18 Aug 2026 15:26:24 -0400 Subject: [PATCH 1/6] feat: Microceph charm --- .github/workflows/_integration.yml | 48 +++---------- .github/workflows/terraform.yml | 105 +---------------------------- tests/integration/conftest.py | 9 ++- 3 files changed, 21 insertions(+), 141 deletions(-) diff --git a/.github/workflows/_integration.yml b/.github/workflows/_integration.yml index 5ea461c2..1d6334c2 100644 --- a/.github/workflows/_integration.yml +++ b/.github/workflows/_integration.yml @@ -39,10 +39,7 @@ jobs: fail-fast: false matrix: juju-channel: ["3.6/stable"] - scenario: ["tls_full", "tls_external", "tls_internal", "tls_none"] - include: - - juju-channel: "4.1/beta" - scenario: "juju_4" + scenario: ["tls_none"] steps: - name: Checkout uses: actions/checkout@v4 @@ -51,6 +48,7 @@ jobs: run: | sudo snap install concierge --classic sudo concierge prepare --juju-channel ${{ matrix.juju-channel }} -p microk8s --extra-snaps just,astral-uv,terraform + sudo concierge prepare --juju-channel ${{ matrix.juju-channel }} -p machine # Setup for Self-hosted (PS7) runners - name: Install snaps @@ -60,6 +58,10 @@ jobs: sudo snap install just --classic sudo snap install astral-uv --classic sudo snap install terraform --classic + - name: Concierge prepare machine + if: ${{ runner.environment == 'self-hosted' }} + run: | + sudo concierge prepare --juju-channel ${{ matrix.juju-channel }} -p machine - name: (IS hosted) Configure microk8s Docker Hub mirror timeout-minutes: 10 if: ${{ runner.environment == 'self-hosted' }} @@ -117,39 +119,11 @@ jobs: mkdir -p ~/.local/share/juju # Workaround for juju 3 strict snap sudo --user "$USER" --preserve-env --preserve-env=PATH -- env -- juju bootstrap microk8s --config model-logs-size=10G microk8s juju model-defaults logging-config='=INFO; unit=DEBUG' - - # Runner-independent setup - - name: Install and configure microceph - if: ${{ inputs.product == 'cos' }} - run: | - # https://github.com/canonical/microceph-action/blob/main/microceph.sh - function check_ceph_ok_or_exit () { - i=0 - for i in {1..5}; do - if sudo microceph.ceph status | grep HEALTH_OK; then - break - else - sudo microceph.ceph status - sleep 30 - sudo microceph.ceph health detail - fi - done - if [ "$i" -eq 5 ]; then - exit 1 - fi - } - - sudo snap install microceph - sudo microceph cluster bootstrap - sleep 30s - sudo microceph.ceph config set "mon.$(hostname)" mon_data_avail_warn 6 - sudo microceph disk add loop,2G,3 - check_ceph_ok_or_exit - - sudo microceph enable rgw --port 8080 --ssl-port 8443 - sudo microceph.radosgw-admin user create --uid=user --display-name=User - sudo microceph.radosgw-admin key create --uid=user --key-type=s3 --access-key=access-key --secret-key=secret-key - + - name: Open SSH session on failure + uses: mxschmitt/action-tmate@v3 + with: + timeout-minutes: 30 + limit-access-to-actor: true - name: Test deployment run: | if [[ "${{ inputs.product }}" == "cos" ]]; then diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 7164cc25..adc9d008 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -8,110 +8,11 @@ on: - "tests/integration/**" jobs: - lint-terraform: - name: Terraform lint - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo snap install terraform --classic - sudo snap install just --classic - - name: Lint the Terraform modules - run: just lint-terraform - lint-terraform-docs: - name: Lint terraform docs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo snap install terraform --classic - sudo snap install terraform-docs - sudo snap install just --classic - - name: Lint the Terraform docs - run: just lint-terraform-docs - validate-terraform: - name: Terraform validate - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo snap install terraform --classic - sudo snap install just --classic - - name: Validate the Terraform modules - run: just validate-terraform - test-unit: - name: Terraform unit tests - needs: [lint-terraform, lint-terraform-docs, validate-terraform] - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo snap install terraform --classic - sudo snap install just --classic - - name: Unit test the Terraform modules - run: just unit - changes: - name: Detect changed products - runs-on: ubuntu-latest - outputs: - cos: ${{ steps.filter.outputs.cos }} - cos_lite: ${{ steps.filter.outputs.cos_lite }} - cos_dev: ${{ steps.filter.outputs.cos_dev }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Filter changed paths per product - uses: dorny/paths-filter@v3 - id: filter - with: - filters: | - # Shared paths affect *both* products, so they trigger both suites - shared: &shared - - '.github/workflows/terraform.yml' - - '.github/workflows/_integration.yml' - - 'tests/integration/conftest.py' - - 'tests/integration/helpers.py' - cos: - - *shared - - 'terraform/cos/**' - - 'tests/integration/cos/**' - cos_lite: - - *shared - - 'terraform/cos-lite/**' - - 'tests/integration/cos_lite/**' - cos_dev: - - *shared - - 'terraform/cos-dev/**' - - 'tests/integration/cos_dev/**' - test-integration-cos-lite: - name: COS Lite Terraform integration - needs: [test-unit, changes] - if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.cos_lite == 'true' }} - uses: canonical/observability-stack/.github/workflows/_integration.yml@main - with: - product: cos_lite - runner: self-hosted-linux-amd64-noble-large test-integration-cos: name: COS Terraform integration - needs: [test-unit, changes] + if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.cos == 'true' }} - uses: canonical/observability-stack/.github/workflows/_integration.yml@main + uses: canonical/observability-stack/.github/workflows/_integration.yml@feat/ceph-charm with: product: cos - runner: self-hosted-linux-amd64-noble-xlarge - test-integration-cos-dev: - name: COS Dev Terraform integration - needs: [test-unit, changes] - if: ${{ github.event_name == 'workflow_dispatch' || needs.changes.outputs.cos_dev == 'true' }} - uses: canonical/observability-stack/.github/workflows/_integration.yml@main - with: - product: cos_dev - runner: self-hosted-linux-amd64-noble-large \ No newline at end of file + runner: self-hosted-linux-amd64-noble-xlarge \ No newline at end of file diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 91f492e5..43cd7fc2 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -28,16 +28,21 @@ def _keep_models(request) -> bool: @pytest.fixture(scope="module") def ca_model(request): - with jubilant.temp_model(keep=_keep_models(request)) as juju: + with jubilant.temp_model(keep=_keep_models(request), controller="concierge-microk8s") as juju: yield juju @pytest.fixture(scope="module") def cos_model(request): - with jubilant.temp_model(keep=_keep_models(request)) as juju: + with jubilant.temp_model(keep=_keep_models(request), controller="concierge-microk8s") as juju: yield juju +@pytest.fixture(scope="module") +def machine_model(request): + with jubilant.temp_model(keep=_keep_models(request), controller="concierge-lxd") as juju: + yield juju + @pytest.fixture(scope="module") def tf_manager(tmp_path_factory): base = tmp_path_factory.mktemp("terraform_base") From a234e5100c1f5b1b609b13b20e3c445c33756cf9 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 18 Aug 2026 15:29:56 -0400 Subject: [PATCH 2/6] chore --- .github/workflows/terraform.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index adc9d008..08bcd758 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -8,6 +8,39 @@ on: - "tests/integration/**" jobs: + changes: + name: Detect changed products + runs-on: ubuntu-latest + outputs: + cos: ${{ steps.filter.outputs.cos }} + cos_lite: ${{ steps.filter.outputs.cos_lite }} + cos_dev: ${{ steps.filter.outputs.cos_dev }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Filter changed paths per product + uses: dorny/paths-filter@v3 + id: filter + with: + filters: | + # Shared paths affect *both* products, so they trigger both suites + shared: &shared + - '.github/workflows/terraform.yml' + - '.github/workflows/_integration.yml' + - 'tests/integration/conftest.py' + - 'tests/integration/helpers.py' + cos: + - *shared + - 'terraform/cos/**' + - 'tests/integration/cos/**' + cos_lite: + - *shared + - 'terraform/cos-lite/**' + - 'tests/integration/cos_lite/**' + cos_dev: + - *shared + - 'terraform/cos-dev/**' + - 'tests/integration/cos_dev/**' test-integration-cos: name: COS Terraform integration From 2830f28b087c398de3687447fa791f5641b118be Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 18 Aug 2026 16:30:45 -0400 Subject: [PATCH 3/6] chore --- .github/workflows/_integration.yml | 1 + .github/workflows/terraform.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/_integration.yml b/.github/workflows/_integration.yml index 1d6334c2..be883010 100644 --- a/.github/workflows/_integration.yml +++ b/.github/workflows/_integration.yml @@ -61,6 +61,7 @@ jobs: - name: Concierge prepare machine if: ${{ runner.environment == 'self-hosted' }} run: | + sudo snap install concierge --classic sudo concierge prepare --juju-channel ${{ matrix.juju-channel }} -p machine - name: (IS hosted) Configure microk8s Docker Hub mirror timeout-minutes: 10 diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index 08bcd758..d9773da4 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -23,7 +23,7 @@ jobs: id: filter with: filters: | - # Shared paths affect *both* products, so they trigger both suites + # Shared paths affect *multiple* products, so they trigger as well shared: &shared - '.github/workflows/terraform.yml' - '.github/workflows/_integration.yml' From 98b9147346965e87e930b01493270997f9095d98 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 18 Aug 2026 16:56:01 -0400 Subject: [PATCH 4/6] chore --- .github/workflows/_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_integration.yml b/.github/workflows/_integration.yml index be883010..ff1e461a 100644 --- a/.github/workflows/_integration.yml +++ b/.github/workflows/_integration.yml @@ -123,7 +123,7 @@ jobs: - name: Open SSH session on failure uses: mxschmitt/action-tmate@v3 with: - timeout-minutes: 30 + connect-timeout-seconds: 1800 limit-access-to-actor: true - name: Test deployment run: | @@ -144,5 +144,5 @@ jobs: if: ${{ failure() && (runner.debug == '1') }} uses: mxschmitt/action-tmate@v3 with: - timeout-minutes: 30 + connect-timeout-seconds: 1800 limit-access-to-actor: true From f017aeed4bd2feb3f5c44e141683906142bd1007 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Wed, 19 Aug 2026 08:23:15 -0400 Subject: [PATCH 5/6] chore --- tests/integration/conftest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 43cd7fc2..4cd17087 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -28,13 +28,15 @@ def _keep_models(request) -> bool: @pytest.fixture(scope="module") def ca_model(request): - with jubilant.temp_model(keep=_keep_models(request), controller="concierge-microk8s") as juju: + # TODO: Set the name of the controller in concierge to "microk8s" since we have 2 paths: self-hosted and GH hosted which will break this. + # This will also break local testing if the controller is not named "microk8s" + with jubilant.temp_model(keep=_keep_models(request), controller="microk8s") as juju: yield juju @pytest.fixture(scope="module") def cos_model(request): - with jubilant.temp_model(keep=_keep_models(request), controller="concierge-microk8s") as juju: + with jubilant.temp_model(keep=_keep_models(request), controller="microk8s") as juju: yield juju From 39ac836a569c6b5f5cbcc0e0377c0744c33a8fe2 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Wed, 19 Aug 2026 09:41:31 -0400 Subject: [PATCH 6/6] chore --- .github/workflows/_integration.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/_integration.yml b/.github/workflows/_integration.yml index ff1e461a..f8e82306 100644 --- a/.github/workflows/_integration.yml +++ b/.github/workflows/_integration.yml @@ -123,7 +123,7 @@ jobs: - name: Open SSH session on failure uses: mxschmitt/action-tmate@v3 with: - connect-timeout-seconds: 1800 + connect-timeout-seconds: 3600 limit-access-to-actor: true - name: Test deployment run: | @@ -144,5 +144,5 @@ jobs: if: ${{ failure() && (runner.debug == '1') }} uses: mxschmitt/action-tmate@v3 with: - connect-timeout-seconds: 1800 + connect-timeout-seconds: 3600 limit-access-to-actor: true