Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Gateway API support, instructions on how to integrate with new Istio charms #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 48 additions & 44 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ name: CI

on:
workflow_call:
secrets:
CHARMCRAFT_CREDENTIALS:
required: true
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
# secrets:
# CHARMCRAFT_CREDENTIALS:
# required: true

jobs:
lib-check:
name: Check libraries
uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
secrets: inherit
with:
charm-path: "."
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
# Commented so we don't need CHARMCRAFT_CREDENTIALS
# lib-check:
# name: Check libraries
# uses: canonical/charmed-kubeflow-workflows/.github/workflows/_quality-checks.yaml@main
# secrets: inherit
# with:
# charm-path: "."

lint:
name: Lint Code
Expand Down Expand Up @@ -72,38 +75,39 @@ jobs:
- uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
if: always()

integration-observability:
name: Observability Integration Test
runs-on: ubuntu-20.04

steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Setup operator environment
uses: charmed-kubernetes/actions-operator@main
with:
provider: microk8s
channel: 1.26-strict/stable
juju-channel: 3.4/stable
charmcraft-channel: latest/candidate

- name: Run integration tests
run: |
sg snap_microk8s -c "juju add-model cos-test"
sg snap_microk8s -c "tox -vve cos-integration -- --model cos-test --destructive-mode"

- run: kubectl get pod/prometheus-k8s-0 -n knative-test -o=jsonpath='{.status}'
if: failure()

- run: kubectl get pod/knative-operator-0 -nknative-test -o=jsonpath='{.status}'
if: failure()

- run: kubectl get all -A
if: failure()

- run: juju status
if: failure()

- uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
if: always()
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
# integration-observability:
# name: Observability Integration Test
# runs-on: ubuntu-20.04
#
# steps:
# - name: Check out repo
# uses: actions/checkout@v3
#
# - name: Setup operator environment
# uses: charmed-kubernetes/actions-operator@main
# with:
# provider: microk8s
# channel: 1.26-strict/stable
# juju-channel: 3.4/stable
# charmcraft-channel: latest/candidate
#
# - name: Run integration tests
# run: |
# sg snap_microk8s -c "juju add-model cos-test"
# sg snap_microk8s -c "tox -vve cos-integration -- --model cos-test --destructive-mode"
#
# - run: kubectl get pod/prometheus-k8s-0 -n knative-test -o=jsonpath='{.status}'
# if: failure()
#
# - run: kubectl get pod/knative-operator-0 -nknative-test -o=jsonpath='{.status}'
# if: failure()
#
# - run: kubectl get all -A
# if: failure()
#
# - run: juju status
# if: failure()
#
# - uses: canonical/kubeflow-ci/actions/dump-charm-debug-artifacts@main
# if: always()
11 changes: 6 additions & 5 deletions .github/workflows/on_pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ jobs:
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
uses: ./.github/workflows/publish.yaml
secrets: inherit
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
# # publish runs in parallel with tests, as we always publish in this situation
# publish-charm:
# name: Publish Charm
# uses: ./.github/workflows/publish.yaml
# secrets: inherit
13 changes: 7 additions & 6 deletions .github/workflows/on_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ jobs:
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
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
# # 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
189 changes: 95 additions & 94 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,94 +1,95 @@
# 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-20.04
outputs:
charm_paths_list: ${{ steps.get-charm-paths.outputs.CHARM_PATHS_LIST }}
steps:
- uses: actions/checkout@v3
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-20.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@v3
with:
fetch-depth: 0
ref: ${{ inputs.source_branch }}

- name: Select charmhub channel
uses: canonical/charming-actions/[email protected]
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"

- name: Upload charm to charmhub
uses: canonical/charming-actions/[email protected]
with:
credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
github-token: ${{ secrets.GITHUB_TOKEN }}
charm-path: ${{ matrix.charm-path }}
channel: ${{ steps.parse-inputs.outputs.destination_channel }}
tag-prefix: ${{ steps.parse-inputs.outputs.tag_prefix }}
charmcraft-channel: latest/candidate
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
## 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-20.04
# outputs:
# charm_paths_list: ${{ steps.get-charm-paths.outputs.CHARM_PATHS_LIST }}
# steps:
# - uses: actions/checkout@v3
# 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-20.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@v3
# with:
# fetch-depth: 0
# ref: ${{ inputs.source_branch }}
#
# - name: Select charmhub channel
# uses: canonical/charming-actions/[email protected]
# 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"
#
# - name: Upload charm to charmhub
# uses: canonical/charming-actions/[email protected]
# with:
# credentials: ${{ secrets.CHARMCRAFT_CREDENTIALS }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# charm-path: ${{ matrix.charm-path }}
# channel: ${{ steps.parse-inputs.outputs.destination_channel }}
# tag-prefix: ${{ steps.parse-inputs.outputs.tag_prefix }}
# charmcraft-channel: latest/candidate
63 changes: 32 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
# reusable workflow triggered manually
name: Release 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
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}}
# TODO: Uncomment this if we pull this PR into canonical/knative-operators
## reusable workflow triggered manually
#name: Release 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
# 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}}
Loading