Skip to content
This repository has been archived by the owner on Feb 6, 2025. It is now read-only.

Commit

Permalink
Feat/app (#4)
Browse files Browse the repository at this point in the history
* try snap

* feat: initial application

* small change

* small change

* comment fixes

* integration test

* ci name for different archs

* install tox via pipx

* fix mount step

* add python version

* update setup python actions version

* matricize py

* use avail versions for arm64 py

* add comment for avail arm64 py versions

* run on jammy builders

* remove py matrix

* clean build state before compress

* use private endpoint runners (openstack integration test)

* run on prv endpoint

* capture log outputs

* log subprocess run outputs

* test coverage

* address comments

* make script executable

* refactor args

* add checksum checking

* delete test file

* execute callback script

* checksum validation bytes

* add defensive exceptions for subprocess errors

* raise on delete fail

* test disconnect cleanup

* separate disconnect

* failure recovery

* chore: add retry to network related funcs

* fix: unit tests

* feat: arm build w/ no kvm

* feat: platform independent compression

* non-vm test

* lxd use virtual machine

* test: openstack runner test (arm64 cannot launch lxd due to kvm)

* test: move markers to pyproject.toml

* test: add network name fixture

* test: add flavor name fixture

* test: fix typo

* test: fix typo

* test: fix typo

* chore: add proxy configs

* catch tiemout for retry

* openstack image upload arch

* increase ssh timeout

* add server info logging on exception

* debug

* callback script abs pathing

* callback script abs pathing

* pin versions

* reload shell

* lint fix

* add path

* test: increase server create timeout

* test: wait for snapd

* test: async wait for

* test: unexpected exit code
  • Loading branch information
yanksyoon authored Jun 19, 2024
1 parent d76804f commit f9f1c74
Show file tree
Hide file tree
Showing 43 changed files with 4,881 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
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 app. 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. pipx install .
2. github-runner-image-builder install
3. github-runner-image-builder build
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 app.
- Are you running the application locally, on lxd, in multipass or on some other platform?
- Version of any applicable components, like the pipx/pip lxd, 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 `github-runner-image-builder &> logs.txt`
render: shell
validations:
required: true
- type: textarea
id: additional-context
attributes:
label: Additional context

17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement_proposal.yml
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
26 changes: 26 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Applicable spec: <link>

### Overview

<!-- A high level overview of the change -->

### Rationale

<!-- The reason the change is needed -->


### Module Changes

<!-- Any high level changes to modules and why (Service, Observer, helper) -->

### Library/Dependency Changes

<!-- Any changes to libraries -->

### Checklist

- [ ] The [contributing guide](https://github.com/canonical/is-charms-contributing-guide) was applied
- [ ] The documentation is generated using `src-docs`
- [ ] The PR is tagged with appropriate label (`urgent`, `trivial`, `complex`)

<!-- Explanation for any unchecked items above -->
12 changes: 12 additions & 0 deletions .github/workflows/comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Comment on the pull request

on:
workflow_run:
workflows: ["Tests"]
types:
- completed

jobs:
comment-on-pr:
uses: canonical/operator-workflows/.github/workflows/comment.yaml@main
secrets: inherit
49 changes: 49 additions & 0 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Integration tests

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
integration-tests-arm:
name: Integration test (ARM64)
runs-on: [self-hosted, ARM64, jammy, stg-private-endpoint]
strategy:
matrix:
image: [jammy, noble]
steps:
- uses: actions/checkout@v4.1.7
- uses: canonical/setup-lxd@v0.1.1
- name: Install tox
run: |
sudo apt-get update
sudo apt-get install pipx -y
pipx ensurepath
pipx install tox
# need to run in sudo mode due to chroot
- name: Run integration tests
run: sudo $(which tox) -e integration -- -m arm64 --image=${{ matrix.image }} ${{ secrets.INTEGRATION_TEST_ARGS }}
- name: Tmate
if: ${{ failure() }}
uses: canonical/action-tmate@main
integration-tests-amd:
name: Integration test (X64)
runs-on: [self-hosted, X64, jammy, stg-private-endpoint]
strategy:
matrix:
image: [jammy, noble]
steps:
- uses: actions/checkout@v4.1.7
- uses: canonical/setup-lxd@v0.1.1
- name: Install tox
run: |
sudo apt-get update
sudo apt-get install pipx -y
pipx ensurepath
pipx install tox
# need to run in sudo mode due to chroot
- name: Run integration tests
run: sudo $(which tox) -e integration -- -m amd64 --image=${{ matrix.image }} ${{ secrets.INTEGRATION_TEST_ARGS }}
11 changes: 11 additions & 0 deletions .github/workflows/issues.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Sync issues to Jira

on:
issues:
# available via github.event.action
types: [opened, reopened, closed]

jobs:
issues-to-jira:
uses: canonical/operator-workflows/.github/workflows/jira.yaml@main
secrets: inherit
11 changes: 11 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Tests

on:
pull_request:

jobs:
unit-tests:
uses: canonical/operator-workflows/.github/workflows/test.yaml@main
secrets: inherit
with:
self-hosted-runner: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# development cofig files
.vscode
.tox
**/__pycache__
.coverage
# build artefacts
build
*.img
**/*.egg-info
30 changes: 30 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
header:
license:
spdx-id: Apache-2.0
copyright-owner: Canonical Ltd.
content: |
Copyright [year] [owner]
See LICENSE file for licensing details.
paths:
- '**'
paths-ignore:
- '.github/**'
- '**/*.j2'
- '**/*.json'
- '**/*.md'
- '**/*.txt'
- '.codespellignore'
- '.copier-answers.yml'
- '.flake8'
- '.jujuignore'
- '.gitignore'
- '.licenserc.yaml'
- 'CODEOWNERS'
- 'icon.svg'
- 'LICENSE'
- '.pylintrc'
- '.woke.yaml'
- 'lib/**'
- 'tests/integration/testdata/**'
- 'tests/integration/data/**'
comment: on-failure
3 changes: 3 additions & 0 deletions .woke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rules:
# Ignore blacklist - we are using it to ignore bandit check
- name: blacklist
Loading

0 comments on commit f9f1c74

Please sign in to comment.