-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from canonical/repo-structure
Create initial Repo structure
- Loading branch information
Showing
25 changed files
with
853 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# reusable workflow triggered by other actions | ||
name: Continuous Integration | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
charmcraft-credentials: | ||
required: true | ||
|
||
jobs: | ||
|
||
lib-check: | ||
name: Check libraries | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Check libs | ||
uses: canonical/charming-actions/[email protected] | ||
with: | ||
credentials: "${{ secrets.charmcraft-credentials }}" | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
|
||
lint: | ||
name: Lint Code | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
charm: [kserve-web-app] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo apt update && sudo apt install tox | ||
- run: tox -e ${{ matrix.charm }}-lint | ||
|
||
unit: | ||
name: Unit Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
charm: [kserve-web-app] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- run: sudo apt update && sudo apt install tox | ||
- run: tox -e ${{ matrix.charm }}-unit | ||
|
||
integration: | ||
name: Integration Test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
charm: [kserve-web-app] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup operator environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: microk8s | ||
channel: 1.21/stable | ||
charmcraft-channel: latest/candidate | ||
|
||
- name: Build and test | ||
working-directory: ./charms/${{ matrix.charm }} | ||
run: | | ||
sg microk8s -c "tox -vve integration -- --model testing" | ||
# On failure, capture debugging resources | ||
- name: Get all | ||
run: kubectl get all -A | ||
if: failure() | ||
|
||
- name: Describe deployments | ||
run: kubectl describe deployments -A | ||
if: failure() | ||
|
||
- name: Describe replicasets | ||
run: kubectl describe replicasets -A | ||
if: failure() | ||
|
||
- name: Get juju status | ||
run: juju status | ||
if: failure() | ||
|
||
- name: Get application logs | ||
run: kubectl logs -n testing --tail 1000 -ljuju-app=${{ matrix.charm }} | ||
if: failure() | ||
|
||
- name: Get argo-controller operator logs | ||
run: kubectl logs -n testing --tail 1000 -ljuju-operator=${{ matrix.charm }} | ||
if: failure() |
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,23 @@ | ||
name: Test and publish to branch | ||
|
||
# On pull_request, we: | ||
# * always publish to charmhub at latest/edge/branchname | ||
# * always run tests | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
|
||
tests: | ||
name: Run Tests | ||
uses: ./.github/workflows/integration.yaml | ||
secrets: | ||
charmcraft-credentials: "${{ secrets.CHARMCRAFT_CREDENTIALS }}" | ||
|
||
# publish runs in parallel with tests, as we always publish in this situation | ||
publish-charm: | ||
name: Publish Charm | ||
uses: ./.github/workflows/publish.yaml | ||
secrets: | ||
charmcraft-credentials: "${{ secrets.CHARMCRAFT_CREDENTIALS }}" |
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,31 @@ | ||
name: Publish to edge if tests passed | ||
|
||
# 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/master or track/**, as | ||
# by convention these branches are the source for a corresponding | ||
# charmhub edge channel. | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- track/** | ||
|
||
jobs: | ||
|
||
tests: | ||
name: Run Tests | ||
uses: ./.github/workflows/integration.yaml | ||
secrets: | ||
charmcraft-credentials: "${{ secrets.CHARMCRAFT_CREDENTIALS }}" | ||
|
||
# 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: | ||
charmcraft-credentials: "${{ secrets.CHARMCRAFT_CREDENTIALS }}" |
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,35 @@ | ||
# reusable workflow triggered by other actions | ||
name: Publish | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
charmcraft-credentials: | ||
required: true | ||
|
||
jobs: | ||
|
||
publish-charm: | ||
name: Publish Charm | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
charm: | ||
- kserve-web-app | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Select charmhub channel | ||
uses: canonical/charming-actions/[email protected] | ||
id: channel | ||
- name: Upload charm to charmhub | ||
uses: canonical/charming-actions/[email protected] | ||
with: | ||
credentials: ${{ secrets.charmcraft-credentials }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
charm-path: charms/${{ matrix.charm }} | ||
channel: ${{ steps.channel.outputs.name }} | ||
tag-prefix: ${{ matrix.charm }} |
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,31 @@ | ||
# 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-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- 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}} |
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,4 @@ | ||
*.charm | ||
*__pycache__ | ||
*.tox | ||
build/ |
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 @@ | ||
@canonical/kubeflow |
57 changes: 57 additions & 0 deletions
57
charms/kserve-web-app/.github/ISSUE_TEMPLATE/bug_report.yml
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,57 @@ | ||
name: Bug Report | ||
description: File a bug report | ||
labels: ["Type: Bug", "Status: Triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this bug report! Before submitting your issue, please make | ||
sure you are using the latest version of the charm. If not, please switch to this image prior to | ||
posting your report to make sure it's not already solved. | ||
- type: textarea | ||
id: bug-description | ||
attributes: | ||
label: Bug Description | ||
description: > | ||
If applicable, add screenshots to help explain the problem you are facing. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: reproduction | ||
attributes: | ||
label: To Reproduce | ||
description: > | ||
Please provide a step-by-step instruction of how to reproduce the behavior. | ||
placeholder: | | ||
1. `juju deploy ...` | ||
2. `juju relate ...` | ||
3. `juju status --relations` | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: environment | ||
attributes: | ||
label: Environment | ||
description: > | ||
We need to know a bit more about the context in which you run the charm. | ||
- Are you running Juju locally, on lxd, in multipass or on some other platform? | ||
- What track and channel you deployed the charm from (ie. `latest/edge` or similar). | ||
- Version of any applicable components, like the juju snap, the model controller, lxd, microk8s, and/or multipass. | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: logs | ||
attributes: | ||
label: Relevant log output | ||
description: > | ||
Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. | ||
Fetch the logs using `juju debug-log --replay` and `kubectl logs ...`. Additional details available in the juju docs | ||
at https://juju.is/docs/olm/juju-logs | ||
render: shell | ||
validations: | ||
required: true | ||
- type: textarea | ||
id: additional-context | ||
attributes: | ||
label: Additional context | ||
|
17 changes: 17 additions & 0 deletions
17
charms/kserve-web-app/.github/ISSUE_TEMPLATE/enhancement_proposal.yml
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,17 @@ | ||
name: Enhancement Proposal | ||
description: File an enhancement proposal | ||
labels: ["Type: Enhancement", "Status: Triage"] | ||
body: | ||
- type: markdown | ||
attributes: | ||
value: > | ||
Thanks for taking the time to fill out this enhancement proposal! Before submitting your issue, please make | ||
sure there isn't already a prior issue concerning this. If there is, please join that discussion instead. | ||
- type: textarea | ||
id: enhancement-proposal | ||
attributes: | ||
label: Enhancement Proposal | ||
description: > | ||
Describe the enhancement you would like to see in as much detail as needed. | ||
validations: | ||
required: true |
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,45 @@ | ||
name: Tests | ||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: python3 -m pip install tox | ||
- name: Run linters | ||
run: tox -e lint | ||
unit-test: | ||
name: Unit tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Install dependencies | ||
run: python -m pip install tox | ||
- name: Run tests | ||
run: tox -e unit | ||
integration-test-microk8s: | ||
name: Integration tests (microk8s) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup operator environment | ||
uses: charmed-kubernetes/actions-operator@main | ||
with: | ||
provider: microk8s | ||
- name: Run integration tests | ||
# set a predictable model name so it can be consumed by charm-logdump-action | ||
run: tox -e integration -- --model testing | ||
- name: Dump logs | ||
uses: canonical/charm-logdump-action@main | ||
if: failure() | ||
with: | ||
# TEMPLATE-TODO: Replace the application name | ||
app: operator-template | ||
model: testing |
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,8 @@ | ||
name: Tests | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
run-tests: | ||
name: Run Tests | ||
uses: ./.github/workflows/ci.yaml |
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,12 @@ | ||
name: Tests | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
- track/** | ||
|
||
jobs: | ||
run-tests: | ||
name: Run Tests | ||
uses: ./.github/workflows/ci.yaml |
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,8 @@ | ||
venv/ | ||
build/ | ||
*.charm | ||
.tox/ | ||
.coverage | ||
__pycache__/ | ||
*.py[cod] | ||
.idea |
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,3 @@ | ||
/venv | ||
*.py[cod] | ||
*.charm |
Oops, something went wrong.