-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into kf-6654-bump-libraries
- Loading branch information
Showing
50 changed files
with
2,413 additions
and
452 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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() |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.