Skip to content

Commit

Permalink
Merge branch 'main' into kf-6654-bump-libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
orfeas-k authored Jan 30, 2025
2 parents 233d5bf + e59744f commit 4f47b78
Show file tree
Hide file tree
Showing 50 changed files with 2,413 additions and 452 deletions.
106 changes: 94 additions & 12 deletions .github/workflows/integrate.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# reusable workflow triggered by other actions
name: CI
name: Tests

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
schedule:
- cron: '0 8 * * TUE'
# Triggered on push by .github/workflows/release.yaml
workflow_call:
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
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-channel.outputs.charm-paths }}
channel:
description: Charmhub channel the charms are released to
value: ${{ jobs.get-charm-paths-channel.outputs.charm-channel }}

jobs:
lib-check:
Expand Down Expand Up @@ -86,9 +100,57 @@ jobs:
# So the model's name must be kubeflow
# See: https://github.com/kubeflow/kubeflow/issues/6136
model: kubeflow


get-charm-paths-channel:
name: Get charm paths and charmhub channel
runs-on: ubuntu-latest
outputs:
charm-paths: ${{ steps.get-charm-paths.outputs.charm-paths }}
charm-channel: ${{ steps.select-channel.outputs.name }}
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: Select charmhub channel
uses: canonical/charming-actions/[email protected]
id: select-channel

build:
strategy:
matrix:
charm: ${{ fromJSON(needs.get-charm-paths-channel.outputs.charm-paths) }}
name: Build charm | ${{ matrix.charm }}
needs:
- get-charm-paths-channel
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
path-to-charm-directory: ${{ matrix.charm }}

release:
strategy:
matrix:
charm: ${{ fromJSON(needs.get-charm-paths-channel.outputs.charm-paths) }}
name: Release charm to Charmhub branch | ${{ matrix.charm }}
if: ${{ github.event_name == 'pull_request' }}
needs:
- get-charm-paths-channel
- build
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
channel: ${{ needs.get-charm-paths-channel.outputs.charm-channel }}
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
path-to-charm-directory: ${{ matrix.charm }}
create-git-tags: false
secrets:
charmhub-token: ${{ secrets.CHARMCRAFT_CREDENTIALS }}

integration:
name: Integration tests (microk8s)
needs:
- build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand Down Expand Up @@ -119,22 +181,34 @@ jobs:
provider: microk8s
channel: 1.29-strict/stable
juju-channel: 3.6/stable
# Pinned to 3.x/stable due to https://github.com/canonical/charmcraft/issues/1845
charmcraft-channel: 3.x/stable

- name: Download packed charm(s)
id: download-charms
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.build.outputs.artifact-prefix }}-*
merge-multiple: true

- name: Integration tests
run: |
# Requires the model to be called kubeflow due to
# https://github.com/canonical/kfp-operators/issues/389
juju add-model kubeflow
sg snap_microk8s -c "tox -e ${{ matrix.charm }}-integration -- --model kubeflow"
# Pass the path where the charm artefact is downloaded to the tox command
# FIXME: Right now the complete path is half hardcoded to <charm name>[email protected]
# We need to find a better way to dynamically get this value
sg snap_microk8s -c "tox -e ${{ matrix.charm }}-integration -- --model kubeflow --charm-path=${{ github.workspace }}/charms/${{ matrix.charm }}/${{ matrix.charm }}[email protected]"
- name: Collect charm debug artifacts
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
with:
artifact-prefix: ${{ matrix.charm }}
if: always()

test-bundle:
name: Test the bundle
needs: build
runs-on: ubuntu-20.04
strategy:
fail-fast: false
Expand All @@ -161,15 +235,21 @@ jobs:
provider: microk8s
channel: 1.29-strict/stable
juju-channel: 3.6/stable
# Pinned to 3.x/stable due to https://github.com/canonical/charmcraft/issues/1845
charmcraft-channel: 3.x/stable
microk8s-addons: "dns hostpath-storage rbac metallb:10.64.140.43-10.64.140.49"

- name: Download packed charm(s)
id: download-charms
timeout-minutes: 5
uses: actions/download-artifact@v4
with:
pattern: ${{ needs.build.outputs.artifact-prefix }}-*
merge-multiple: true

- name: Run test
run: |
# Requires the model to be called kubeflow due to kfp-viewer
juju add-model kubeflow
sg snap_microk8s -c "tox -e bundle-integration-${{ matrix.sdk }} -- --model kubeflow --bundle=./tests/integration/bundles/kfp_latest_edge.yaml.j2" --charmcraft-clean
sg snap_microk8s -c "tox -e bundle-integration-${{ matrix.sdk }} -- --model kubeflow --charms-path=${{ github.workspace }}/charms/ --bundle=./tests/integration/bundles/kfp_latest_edge.yaml.j2"
- name: Get all
run: kubectl get all -A
Expand All @@ -183,4 +263,6 @@ jobs:
# in particular struggles with storage limitations.
- name: Collect charm debug artifacts
uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
with:
artifact-prefix: ${{ matrix.sdk }}
if: failure() || cancelled()
30 changes: 0 additions & 30 deletions .github/workflows/get-charm-paths.sh

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/on_pull_request.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/on_push.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# reusable workflow triggered manually
name: Promote charm to other tracks and channels

on:
workflow_dispatch:
inputs:
destination-channel:
description: 'Destination Channel'
required: true
origin-channel:
description: 'Origin Channel'
required: true
charm-name:
description: 'Charm subdirectory name'
required: true

jobs:
promote-charm:
name: Promote charm
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Release charm to channel
# TODO: use canonical/charming-actions/promote-charm?
uses: canonical/charming-actions/[email protected]
with:
credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
github-token: ${{ secrets.GITHUB_TOKEN }}
destination-channel: ${{ github.event.inputs.destination-channel }}
origin-channel: ${{ github.event.inputs.origin-channel }}
tag-prefix: ${{ github.event.inputs.charm-name }}
charm-path: charms/${{ github.event.inputs.charm-name}}
95 changes: 0 additions & 95 deletions .github/workflows/publish.yaml

This file was deleted.

Loading

0 comments on commit 4f47b78

Please sign in to comment.