From 62518cebc63cff0617671bdb4dfe3ca3327a98c9 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Fri, 22 May 2026 22:35:42 +0300 Subject: [PATCH 01/13] chore: Update CI to use charmcraftcache --- .github/workflows/{integrate.yaml => ci.yaml} | 68 ++++++++--- .github/workflows/get-charm-paths.sh | 30 ----- .github/workflows/on_pull_request.yaml | 50 -------- .github/workflows/on_push.yaml | 54 --------- .github/workflows/promote.yaml | 26 ++++ .github/workflows/publish.yaml | 112 ------------------ .github/workflows/release.yaml | 41 +++---- .github/workflows/weekly_ci.yaml | 5 +- 8 files changed, 101 insertions(+), 285 deletions(-) rename .github/workflows/{integrate.yaml => ci.yaml} (71%) delete mode 100644 .github/workflows/get-charm-paths.sh delete mode 100644 .github/workflows/on_pull_request.yaml delete mode 100644 .github/workflows/on_push.yaml create mode 100644 .github/workflows/promote.yaml delete mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/integrate.yaml b/.github/workflows/ci.yaml similarity index 71% rename from .github/workflows/integrate.yaml rename to .github/workflows/ci.yaml index ca42b52f..c6e4f36f 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/ci.yaml @@ -3,30 +3,37 @@ name: CI on: workflow_call: - secrets: - CHARMCRAFT_CREDENTIALS: - required: true + pull_request: + push: + branches: + - main + - track/** jobs: + get-charm-paths-track: + name: Get charm paths / track + uses: canonical/data-platform-workflows/.github/workflows/get_charm_paths_and_track.yaml@v49.0.1 + lint: name: Lint runs-on: ubuntu-24.04 steps: - - name: Check out code - uses: actions/checkout@v4 + - name: Check out code + uses: actions/checkout@v4 - - name: Install dependencies - run: pipx install tox + - name: Install dependencies + run: pipx install tox - - name: Lint code - run: tox -vve lint + - name: Lint code + run: tox -vve lint - unit-test: + unit: name: Unit runs-on: ubuntu-24.04 steps: - name: Check out code uses: actions/checkout@v4 + - name: Install dependencies run: pipx install tox @@ -46,10 +53,41 @@ jobs: with: charm-path: . - integration-test: + build: + name: Build charm + needs: + - get-charm-paths-track + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v49.0.1 + with: + cache: true + path-to-charm-directory: ${{ needs.get-charm-paths-track.outputs.path }} + charmcraft-snap-channel: 3.x/stable + + release: + name: Release to CharmHub + needs: + - build + - lint + - unit + - terraform-checks + if: ${{ !github.event.pull_request.head.repo.fork }} + uses: canonical/data-platform-workflows/.github/workflows/release_charm_pr.yaml@v49.0.1 + with: + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + path-to-charm-directory: . + track: ${{ needs.get-charm-paths-track.outputs.track }} + secrets: inherit + permissions: + contents: write + pull-requests: write + + integration: name: Integration + needs: + - build runs-on: ubuntu-24.04 strategy: + fail-fast: false matrix: tox-environment: - integration @@ -61,6 +99,7 @@ jobs: - name: Check out code uses: actions/checkout@v4 + - name: Install dependencies run: pipx install tox @@ -78,11 +117,12 @@ jobs: # See https://canonical-service-mesh-documentation.readthedocs-hosted.com/en/latest/how-to/use-charmed-istio-with-canonical-kubernetes/ kubectl -n kube-system patch configmap cilium-config --type merge --patch '{"data":{"bpf-lb-sock-hostns-only":"true"}}' kubectl -n kube-system rollout restart daemonset cilium - + - name: Fetch charm - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v4 with: - name: built-charm + pattern: ${{ needs.build.outputs.artifact-prefix }}-* + merge-multiple: true path: built/ - name: Get charm path diff --git a/.github/workflows/get-charm-paths.sh b/.github/workflows/get-charm-paths.sh deleted file mode 100644 index 1110d59c..00000000 --- a/.github/workflows/get-charm-paths.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -x - -# Finds the charms in this repo, outputting them as JSON -# Will return one of: -# * the relative paths of the directories listed in `./charms`, if that directory exists -# * "./", if the root directory has a "metadata.yaml" file -# * otherwise, error -# -# Modified from: https://stackoverflow.com/questions/63517732/github-actions-build-matrix-for-lambda-functions/63736071#63736071 -CHARMS_DIR="./charms" -if [ -d "$CHARMS_DIR" ]; -then - CHARM_PATHS=$(find $CHARMS_DIR -maxdepth 1 -type d -not -path '*/\.*' -not -path "$CHARMS_DIR") -else - if [ -f "./metadata.yaml" ] - then - CHARM_PATHS="./" - else - echo "Cannot find valid charm directories - aborting" - exit 1 - fi -fi - -# Convert output to JSON string format -# { charm_paths: [...] } -CHARM_PATHS_LIST=$(echo "$CHARM_PATHS" | jq -c --slurp --raw-input 'split("\n")[:-1]') - -echo "Found CHARM_PATHS_LIST: $CHARM_PATHS_LIST" - -echo "::set-output name=CHARM_PATHS_LIST::$CHARM_PATHS_LIST" diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml deleted file mode 100644 index a59378ad..00000000 --- a/.github/workflows/on_pull_request.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: On Pull Request - -# On pull_request, we: -# * always publish to charmhub at latest/edge/branchname -# * always run tests - -on: - pull_request: - -jobs: - build-charm: - name: Build charm - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup LXD - uses: canonical/setup-lxd@main - with: - channel: 5.21/stable - - - name: Install charmcraft - run: sudo snap install charmcraft --classic - - - name: Build charm under test - run: charmcraft pack --verbose - - - name: Archive charm - uses: actions/upload-artifact@v4 - with: - name: built-charm - path: "*.charm" - retention-days: 5 - - tests: - name: Run Tests - needs: - - build-charm - uses: ./.github/workflows/integrate.yaml - secrets: inherit - - # publish runs in parallel with tests, as we always publish in this situation - publish-charm: - name: Publish Charm - needs: - - build-charm - uses: ./.github/workflows/publish.yaml - secrets: inherit - diff --git a/.github/workflows/on_push.yaml b/.github/workflows/on_push.yaml deleted file mode 100644 index fae1e5a7..00000000 --- a/.github/workflows/on_push.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: On Push - -# On push to a "special" branch, we: -# * always publish to charmhub at latest/edge/branchname -# * always run tests -# where a "special" branch is one of main or track/**, as -# by convention these branches are the source for a corresponding -# charmhub edge channel. - -on: - push: - branches: - - main - - track/** - -jobs: - build-charm: - name: Build charm - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup LXD - uses: canonical/setup-lxd@main - with: - channel: 5.21/stable - - - name: Install charmcraft - run: sudo snap install charmcraft --classic - - - name: Build charm under test - run: charmcraft pack --verbose - - - name: Archive charm - uses: actions/upload-artifact@v4 - with: - name: built-charm - path: "*.charm" - retention-days: 5 - - tests: - name: Run Tests - needs: - - build-charm - uses: ./.github/workflows/integrate.yaml - secrets: inherit - - # publish runs in series with tests, and only publishes if tests passes - publish-charm: - name: Publish Charm - needs: tests - uses: ./.github/workflows/publish.yaml - secrets: inherit diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml new file mode 100644 index 00000000..bd09d06c --- /dev/null +++ b/.github/workflows/promote.yaml @@ -0,0 +1,26 @@ +name: Promote charm + +on: + workflow_dispatch: + inputs: + destination-channel: + description: 'Destination Channel' + required: true + origin-channel: + description: 'Origin Channel' + required: true + +jobs: + promote-charm: + name: Promote charm + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + - name: Release charm to channel + uses: canonical/charming-actions/release-charm@2.6.2 + with: + credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} + github-token: ${{ secrets.GITHUB_TOKEN }} + destination-channel: ${{ github.event.inputs.destination-channel }} + origin-channel: ${{ github.event.inputs.origin-channel }} + base-channel: "24.04" diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 6a3414fa..00000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,112 +0,0 @@ -# reusable workflow for publishing all charms in this repo -name: Publish - -on: - workflow_call: - inputs: - source_branch: - description: Github branch from this repo to publish. If blank, will use the default branch - default: '' - required: false - type: string - secrets: - CHARMCRAFT_CREDENTIALS: - required: true - workflow_dispatch: - inputs: - destination_channel: - description: CharmHub channel to publish to - required: false - default: 'latest/edge' - type: string - source_branch: - description: Github branch from this repo to publish. If blank, will use the default branch - required: false - default: '' - type: string - -jobs: - get-charm-paths: - name: Generate the Charm Matrix - runs-on: ubuntu-24.04 - outputs: - charm_paths_list: ${{ steps.get-charm-paths.outputs.CHARM_PATHS_LIST }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ inputs.source_branch }} - - name: Get paths for all charms in repo - id: get-charm-paths - run: bash .github/workflows/get-charm-paths.sh - - - publish-charm: - name: Publish Charm - runs-on: ubuntu-24.04 - needs: get-charm-paths - strategy: - fail-fast: false - matrix: - charm-path: ${{ fromJson(needs.get-charm-paths.outputs.charm_paths_list) }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - ref: ${{ inputs.source_branch }} - - - name: Select charmhub channel - uses: canonical/charming-actions/channel@2.6.2 - id: select-channel - if: ${{ inputs.destination_channel == '' }} - - # Combine inputs from different sources to a single canonical value so later steps don't - # need logic for picking the right one - - name: Parse and combine inputs - id: parse-inputs - run: | - # destination_channel - destination_channel="${{ inputs.destination_channel || steps.select-channel.outputs.name }}" - echo "setting output of destination_channel=$destination_channel" - echo "::set-output name=destination_channel::$destination_channel" - - # tag_prefix - # if charm_path = ./ --> tag_prefix = '' (null) - # if charm_path != ./some-charm (eg: a charm in a ./charms dir) --> tag_prefix = 'some-charm' - if [ ${{ matrix.charm-path }} == './' ]; then - tag_prefix='' - else - tag_prefix=$(basename ${{ matrix.charm-path }} ) - fi - echo "setting output of tag_prefix=$tag_prefix" - echo "::set-output name=tag_prefix::$tag_prefix" - - # Required to charmcraft pack in non-destructive mode - - name: Setup lxd - uses: canonical/setup-lxd@v0.1.2 - with: - channel: latest/stable - - - name: Fetch charm - uses: actions/download-artifact@v5 - with: - name: built-charm - path: built/ - - - name: Get charm path - id: charm-path - run: echo "charm_path=$(find built/ -name '*.charm' -type f -print)" >> $GITHUB_OUTPUT - - - name: Upload charm to charmhubpip-tools - uses: canonical/charming-actions/upload-charm@2.6.2 - with: - credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} - github-token: ${{ secrets.GITHUB_TOKEN }} - charm-path: ${{ matrix.charm-path }} - built-charm-path: ${{ steps.charm-path.outputs.charm_path }} - channel: ${{ steps.parse-inputs.outputs.destination_channel }} - tag-prefix: ${{ steps.parse-inputs.outputs.tag_prefix }} - charmcraft-channel: 3.x/stable - destructive-mode: false diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9d3752b6..664b130e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,27 +1,24 @@ -# reusable workflow triggered manually -name: Release charm to other tracks and channels +name: Release to CharmHub on: workflow_dispatch: - inputs: - destination-channel: - description: 'Destination Channel' - required: true - origin-channel: - description: 'Origin Channel' - required: true jobs: - promote-charm: - name: Promote charm - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - name: Release charm to channel - uses: canonical/charming-actions/release-charm@2.6.2 - with: - credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} - github-token: ${{ secrets.GITHUB_TOKEN }} - destination-channel: ${{ github.event.inputs.destination-channel }} - origin-channel: ${{ github.event.inputs.origin-channel }} - base-channel: "24.04" + build: + name: Build charm + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v49.0.1 + with: + cache: true + charmcraft-snap-channel: 3.x/stable + + release: + name: Release to CharmHub + needs: + - build + uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v49.0.1 + with: + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + path-to-charm-directory: . + secrets: inherit + permissions: + contents: write diff --git a/.github/workflows/weekly_ci.yaml b/.github/workflows/weekly_ci.yaml index 71a3c788..978609ac 100644 --- a/.github/workflows/weekly_ci.yaml +++ b/.github/workflows/weekly_ci.yaml @@ -7,6 +7,5 @@ on: jobs: tests: name: Run Tests - uses: ./.github/workflows/integrate.yaml - secrets: - charmcraft-credentials: '${{ secrets.CHARMCRAFT_CREDENTIALS }}' + uses: ./.github/workflows/ci.yaml + secrets: inherit From 3bfab3fd152e51d12f33c56b3a4abf89d9739d1d Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 10:43:37 +0300 Subject: [PATCH 02/13] Add back on_pull_request.yaml for backport label population --- .github/workflows/on_pull_request.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/on_pull_request.yaml diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml new file mode 100644 index 00000000..b64e8087 --- /dev/null +++ b/.github/workflows/on_pull_request.yaml @@ -0,0 +1,19 @@ +name: On Pull Request + +# On pull_request, we: +# * create backport labels if it is against main, only when the PR is opened/reopened + +on: + pull_request: + +jobs: + + populate-labels: + name: Populate labels + if: github.base_ref == 'main' && (github.event.action == 'opened' || github.event.action == 'reopened') + uses: canonical/charmed-kubeflow-workflows/.github/workflows/populate-labels.yaml@main + secrets: inherit + with: + track_file_path: ".github/automatic_backport_tracks.yaml" + label_prefix: "backport " + From f4be1038baf8b9d31aaf5b9beb4ed69dd57a13c5 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 11:20:38 +0300 Subject: [PATCH 03/13] Fix CI: replace non-existent reusable workflow with inline job --- .github/workflows/ci.yaml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c6e4f36f..94847b08 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -11,8 +11,38 @@ on: jobs: get-charm-paths-track: - name: Get charm paths / track - uses: canonical/data-platform-workflows/.github/workflows/get_charm_paths_and_track.yaml@v49.0.1 + name: Get charm paths and track + runs-on: ubuntu-latest + outputs: + path: ${{ steps.get-charm-paths.outputs.charm-paths }} + track: ${{ steps.determine-track.outputs.track }} + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Get paths for all charms in this repo + id: get-charm-paths + uses: canonical/kubeflow-ci/actions/get-charm-paths@main + - name: Determine track + id: determine-track + shell: python + run: | + import os + + if "${{ github.event_name }}" == "pull_request": + ref = "${{ github.base_ref }}" + else: + ref = "${{ github.ref_name }}" + + if ref.startswith("track/"): + track = ref.removeprefix("track/") + else: + track = "latest" + + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"track={track}\n") + + print(f"Track: {track}") lint: name: Lint @@ -66,6 +96,7 @@ jobs: release: name: Release to CharmHub needs: + - get-charm-paths-track - build - lint - unit From 1742c7017cb2c671374731a5c19f56dc0aa3a67b Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 11:46:57 +0300 Subject: [PATCH 04/13] Fix release.yaml: use release_charm_edge.yaml which exists at v49.0.1 --- .github/workflows/release.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 664b130e..7c49d2e5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,10 +15,12 @@ jobs: name: Release to CharmHub needs: - build - uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v49.0.1 + uses: canonical/data-platform-workflows/.github/workflows/release_charm_edge.yaml@v49.0.1 with: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} path-to-charm-directory: . - secrets: inherit + secrets: + charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }} permissions: + actions: read contents: write From 6b3cf344709ca0be87d1773a3821d7462334b3ec Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 13:37:23 +0300 Subject: [PATCH 05/13] Fix release.yaml: add required track input --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7c49d2e5..0c5b7535 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -18,6 +18,7 @@ jobs: uses: canonical/data-platform-workflows/.github/workflows/release_charm_edge.yaml@v49.0.1 with: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + track: latest path-to-charm-directory: . secrets: charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }} From 0acb5926355633e046e92a2b61082a39e96a808e Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 13:42:34 +0300 Subject: [PATCH 06/13] Fix CI: add required permissions and inputs for reusable workflows --- .github/workflows/ci.yaml | 3 +++ pyrightconfig.json | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 pyrightconfig.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 94847b08..d9d225f7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -92,6 +92,9 @@ jobs: cache: true path-to-charm-directory: ${{ needs.get-charm-paths-track.outputs.path }} charmcraft-snap-channel: 3.x/stable + permissions: + actions: read + contents: read release: name: Release to CharmHub diff --git a/pyrightconfig.json b/pyrightconfig.json new file mode 100644 index 00000000..6551306a --- /dev/null +++ b/pyrightconfig.json @@ -0,0 +1,3 @@ +{ + "extraPaths": ["lib"] +} From c02e47b2455ce0b4ee7eff3b624f00f515d215f5 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 17:51:48 +0300 Subject: [PATCH 07/13] Use DPW build/release workflows with get-charm-paths-track pattern - Remove pyrightconfig.json - Remove weekly_ci.yaml, add schedule cron to ci.yaml - Add concurrency, workflow_call outputs, get-charm-paths-track job - Use dynamic matrix for build/release jobs - Fix release.yaml: on push trigger, ci-tests pattern, dynamic track - Remove on_pull_request.yaml (backport labels) --- .github/workflows/ci.yaml | 55 +++++++++++++++++--------- .github/workflows/on_pull_request.yaml | 19 --------- .github/workflows/release.yaml | 31 ++++++++------- .github/workflows/weekly_ci.yaml | 11 ------ pyrightconfig.json | 3 -- 5 files changed, 53 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/on_pull_request.yaml delete mode 100644 .github/workflows/weekly_ci.yaml delete mode 100644 pyrightconfig.json diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d9d225f7..f0cd6d9a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,20 +1,33 @@ # reusable workflow triggered by other actions name: CI +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + on: - workflow_call: pull_request: - push: - branches: - - main - - track/** + schedule: + - cron: '0 8 * * TUE' + # Triggered on push by .github/workflows/release.yaml + workflow_call: + outputs: + artifact-prefix: + description: build_charm.yaml `artifact-prefix` output + value: ${{ jobs.build.outputs.artifact-prefix }} + charm-paths: + description: paths for all charms in this repo + value: ${{ jobs.get-charm-paths-track.outputs.charm-paths }} + track: + description: Charmhub track determined from branch name + value: ${{ jobs.get-charm-paths-track.outputs.track }} jobs: get-charm-paths-track: name: Get charm paths and track runs-on: ubuntu-latest outputs: - path: ${{ steps.get-charm-paths.outputs.charm-paths }} + charm-paths: ${{ steps.get-charm-paths.outputs.charm-paths }} track: ${{ steps.determine-track.outputs.track }} steps: - uses: actions/checkout@v4 @@ -84,36 +97,40 @@ jobs: charm-path: . build: - name: Build charm + strategy: + matrix: + charm: ${{ fromJSON(needs.get-charm-paths-track.outputs.charm-paths) }} + name: Build charm | ${{ matrix.charm }} needs: - get-charm-paths-track uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v49.0.1 with: + path-to-charm-directory: ${{ matrix.charm }} cache: true - path-to-charm-directory: ${{ needs.get-charm-paths-track.outputs.path }} charmcraft-snap-channel: 3.x/stable permissions: - actions: read + actions: read # Needed for GitHub API call to get workflow version (for private repositories) contents: read release: - name: Release to CharmHub + strategy: + matrix: + charm: ${{ fromJSON(needs.get-charm-paths-track.outputs.charm-paths) }} + name: Release charm to Charmhub branch | ${{ matrix.charm }} + if: ${{ github.event_name == 'pull_request' }} needs: - get-charm-paths-track - build - - lint - - unit - - terraform-checks - if: ${{ !github.event.pull_request.head.repo.fork }} uses: canonical/data-platform-workflows/.github/workflows/release_charm_pr.yaml@v49.0.1 with: - artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} - path-to-charm-directory: . track: ${{ needs.get-charm-paths-track.outputs.track }} - secrets: inherit + artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} + path-to-charm-directory: ${{ matrix.charm }} + secrets: + charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }} permissions: - contents: write - pull-requests: write + actions: read # Needed for GitHub API call to get workflow version (for private repositories) + contents: read integration: name: Integration diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml deleted file mode 100644 index b64e8087..00000000 --- a/.github/workflows/on_pull_request.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: On Pull Request - -# On pull_request, we: -# * create backport labels if it is against main, only when the PR is opened/reopened - -on: - pull_request: - -jobs: - - populate-labels: - name: Populate labels - if: github.base_ref == 'main' && (github.event.action == 'opened' || github.event.action == 'reopened') - uses: canonical/charmed-kubeflow-workflows/.github/workflows/populate-labels.yaml@main - secrets: inherit - with: - track_file_path: ".github/automatic_backport_tracks.yaml" - label_prefix: "backport " - diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c5b7535..840c8f94 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,27 +1,30 @@ -name: Release to CharmHub +name: Release to Charmhub on: - workflow_dispatch: + push: + branches: + - main + - track/** jobs: - build: - name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v49.0.1 - with: - cache: true - charmcraft-snap-channel: 3.x/stable + ci-tests: + uses: ./.github/workflows/ci.yaml + secrets: inherit release: - name: Release to CharmHub + strategy: + matrix: + charm: ${{ fromJSON(needs.ci-tests.outputs.charm-paths) }} + name: Release charm | ${{ matrix.charm }} needs: - - build + - ci-tests uses: canonical/data-platform-workflows/.github/workflows/release_charm_edge.yaml@v49.0.1 with: - artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} - track: latest - path-to-charm-directory: . + track: ${{ needs.ci-tests.outputs.track }} + artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }} + path-to-charm-directory: ${{ matrix.charm }} secrets: charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }} permissions: actions: read - contents: write + contents: write # Needed to create git tags diff --git a/.github/workflows/weekly_ci.yaml b/.github/workflows/weekly_ci.yaml deleted file mode 100644 index 978609ac..00000000 --- a/.github/workflows/weekly_ci.yaml +++ /dev/null @@ -1,11 +0,0 @@ -name: Run weekly tests - -on: - schedule: - - cron: '0 8 * * TUE' - -jobs: - tests: - name: Run Tests - uses: ./.github/workflows/ci.yaml - secrets: inherit diff --git a/pyrightconfig.json b/pyrightconfig.json deleted file mode 100644 index 6551306a..00000000 --- a/pyrightconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extraPaths": ["lib"] -} From 7a7defec70d8c57ca5ee26cd1ba2bc68f23f1c4d Mon Sep 17 00:00:00 2001 From: mvlassis Date: Mon, 25 May 2026 17:58:18 +0300 Subject: [PATCH 08/13] Fix promote.yaml: use charmcraft promote with standard flags --- .github/workflows/promote.yaml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/promote.yaml b/.github/workflows/promote.yaml index bd09d06c..45c2882d 100644 --- a/.github/workflows/promote.yaml +++ b/.github/workflows/promote.yaml @@ -1,4 +1,5 @@ -name: Promote charm +# reusable workflow triggered manually +name: Promote charm to other tracks and channels on: workflow_dispatch: @@ -9,18 +10,23 @@ on: origin-channel: description: 'Origin Channel' required: true + charm-name: + description: 'Charm subdirectory name' + required: true jobs: promote-charm: name: Promote charm runs-on: ubuntu-24.04 + env: + CHARMCRAFT_AUTH: ${{ secrets.CHARMCRAFT_CREDENTIALS }} steps: - - uses: actions/checkout@v4 - - name: Release charm to channel - uses: canonical/charming-actions/release-charm@2.6.2 - with: - credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }} - github-token: ${{ secrets.GITHUB_TOKEN }} - destination-channel: ${{ github.event.inputs.destination-channel }} - origin-channel: ${{ github.event.inputs.origin-channel }} - base-channel: "24.04" + - name: Install charmcraft + run: | + sudo snap install charmcraft --classic --channel latest/stable + - name: Run charmcraft promote + run: | + charmcraft promote --name ${{ github.event.inputs.charm-name }} \ + --from-channel ${{ github.event.inputs.origin-channel }} \ + --to-channel ${{ github.event.inputs.destination-channel }} \ + --yes From 6fa2af31fc984c89d5a061748d32731623acb3fd Mon Sep 17 00:00:00 2001 From: mvlassis Date: Tue, 26 May 2026 14:21:02 +0300 Subject: [PATCH 09/13] ci: always collect juju status --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f0cd6d9a..6fac48d8 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -193,7 +193,7 @@ jobs: - name: Get juju status run: juju status - if: failure() + if: always() - name: Get validatingwebhookconfigurations run: kubectl get validatingwebhookconfigurations validator.training-operator.kubeflow.org -oyaml From edbbfc9bb61aa90df1069c81a8c74a726763e4a0 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Tue, 26 May 2026 17:22:16 +0300 Subject: [PATCH 10/13] Update Cilium config: add cni-exclusive patch and update comment URL --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6fac48d8..74160975 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -164,9 +164,9 @@ jobs: - name: Configure Cilium for Canonical K8s if: matrix.tox-environment == 'integration-ambient' run: | - # Configure Cilium for Canonical K8s to work with Charmed Istio (Ambient mode) - # See https://canonical-service-mesh-documentation.readthedocs-hosted.com/en/latest/how-to/use-charmed-istio-with-canonical-kubernetes/ + # for context, see https://docs.cilium.io/en/stable/network/servicemesh/istio/ kubectl -n kube-system patch configmap cilium-config --type merge --patch '{"data":{"bpf-lb-sock-hostns-only":"true"}}' + kubectl -n kube-system patch configmap cilium-config --type merge --patch '{"data":{"cni-exclusive":"false"}}' kubectl -n kube-system rollout restart daemonset cilium - name: Fetch charm From 4aebee65b541a315ff1388aa1232bf1e00357d47 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Wed, 27 May 2026 11:18:51 +0300 Subject: [PATCH 11/13] fix: Grant actions: read to ci-tests job in release workflow The ci.yaml reusable workflow's build and release jobs request 'actions: read' (needed by charmcraftcache), but the caller job in release.yaml did not grant this permission, causing a startup failure. Add permissions: actions: read to the ci-tests job. --- .github/workflows/release.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 840c8f94..17db1b4f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,6 +10,8 @@ jobs: ci-tests: uses: ./.github/workflows/ci.yaml secrets: inherit + permissions: + actions: read release: strategy: From 7e151bbf5eab079e3c43d6bd8c6eda9021d233cb Mon Sep 17 00:00:00 2001 From: mvlassis Date: Thu, 28 May 2026 00:45:22 +0300 Subject: [PATCH 12/13] fix: Grant contents: read to ci-tests job in release workflow --- .github/workflows/release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 17db1b4f..069eb562 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,6 +12,7 @@ jobs: secrets: inherit permissions: actions: read + contents: read release: strategy: From f443a720f76a6fcc8d3dadbe21a802734afddaf8 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Thu, 28 May 2026 11:36:29 +0300 Subject: [PATCH 13/13] Remove unused jobs in on_pull_request.yaml --- .github/workflows/on_pull_request.yaml | 43 +------------------------- 1 file changed, 1 insertion(+), 42 deletions(-) diff --git a/.github/workflows/on_pull_request.yaml b/.github/workflows/on_pull_request.yaml index e55eba96..e61df83e 100644 --- a/.github/workflows/on_pull_request.yaml +++ b/.github/workflows/on_pull_request.yaml @@ -1,8 +1,7 @@ name: On Pull Request # On pull_request, we: -# * always publish to charmhub at latest/edge/branchname -# * always run tests +# * create backport labels if it is against main, only when the PR is opened/reopened on: pull_request: @@ -17,43 +16,3 @@ jobs: with: track_file_path: ".github/automatic_backport_tracks.yaml" label_prefix: "backport " - build-charm: - name: Build charm - runs-on: ubuntu-24.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup LXD - uses: canonical/setup-lxd@main - with: - channel: 5.21/stable - - - name: Install charmcraft - run: sudo snap install charmcraft --classic - - - name: Build charm under test - run: charmcraft pack --verbose - - - name: Archive charm - uses: actions/upload-artifact@v4 - with: - name: built-charm - path: "*.charm" - retention-days: 5 - - tests: - name: Run Tests - needs: - - build-charm - uses: ./.github/workflows/integrate.yaml - secrets: inherit - - # publish runs in parallel with tests, as we always publish in this situation - publish-charm: - name: Publish Charm - needs: - - build-charm - uses: ./.github/workflows/publish.yaml - secrets: inherit -