Skip to content

Commit 7048560

Browse files
authored
[DPE-6296] Add CI support + git ignore update (#10)
1 parent fe51cdc commit 7048560

12 files changed

+278
-258
lines changed

.github/.jira_sync_config.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Sync GitHub issues to Jira issues
2+
3+
# Configuration syntax:
4+
# https://github.com/canonical/gh-jira-sync-bot/blob/main/README.md#client-side-configuration
5+
settings:
6+
# Repository specific settings
7+
components: # Jira components that will be added to Jira issue
8+
- kafka-benchmark-operator
9+
10+
# Settings shared across Data Platform repositories
11+
label_mapping:
12+
# If the GitHub issue does not have a label in this mapping, the Jira issue will be created as a Bug
13+
enhancement: Story
14+
jira_project_key: DPE # https://warthogs.atlassian.net/browse/DPE
15+
status_mapping:
16+
opened: untriaged
17+
closed: done # GitHub issue closed as completed
18+
not_planned: rejected # GitHub issue closed as not planned
19+
add_gh_comment: true
20+
sync_description: false
21+
sync_comments: false

.github/ISSUE_TEMPLATE/bug_report.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
name: Bug report
3+
about: File a bug report
4+
labels: bug
5+
6+
---
7+
8+
<!-- Thank you for submitting a bug report! All fields are required unless marked optional. -->
9+
10+
## Steps to reproduce
11+
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
12+
1.
13+
14+
## Expected behavior
15+
16+
17+
## Actual behavior
18+
<!-- If applicable, add screenshots -->
19+
20+
21+
## Versions
22+
23+
<!-- Run `lsb_release -sd` -->
24+
Operating system:
25+
26+
<!-- Run `juju version` -->
27+
Juju CLI:
28+
29+
<!-- Model version from `juju status` -->
30+
Juju agent:
31+
32+
<!-- App revision from `juju status` or (advanced) commit hash -->
33+
Charm revision:
34+
35+
<!-- Run `lxd version` -->
36+
LXD:
37+
38+
## Log output
39+
<!-- Please enable debug logging by running `juju model-config logging-config="<root>=INFO;unit=DEBUG"` (if possible) -->
40+
<!-- Then, run `juju debug-log --replay > log.txt` and upload "log.txt" file here -->
41+
Juju debug log:
42+
43+
<!-- (Optional) Copy the logs that are relevant to the bug & paste inside triple backticks below -->
44+
45+
46+
## Additional context
47+
<!-- (Optional) Add any additional information here -->

.github/workflows/ci.yaml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copyright 2025 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
name: Tests
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
on:
10+
pull_request:
11+
schedule:
12+
- cron: "53 0 * * *" # Daily at 00:53 UTC
13+
# Triggered on push to branch "main" by .github/workflows/release.yaml
14+
workflow_call:
15+
16+
jobs:
17+
lint:
18+
name: Lint
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
- name: Install tox
25+
run: pipx install tox
26+
- name: Run linters
27+
run: tox run -e lint
28+
29+
unit-test:
30+
name: Unit tests
31+
runs-on: ubuntu-latest
32+
timeout-minutes: 10
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: Install tox
37+
run: pipx install tox
38+
- name: Run tests
39+
run: tox run -e unit
40+
41+
lib-check:
42+
name: Check libraries
43+
runs-on: ubuntu-22.04
44+
timeout-minutes: 5
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v4
48+
with:
49+
fetch-depth: 0
50+
- run: |
51+
# Workaround for https://github.com/canonical/charmcraft/issues/1389#issuecomment-1880921728
52+
touch requirements.txt
53+
- name: Check libs
54+
uses: canonical/charming-actions/[email protected]
55+
with:
56+
charmcraft-channel: latest/beta/data-platform # TODO: remove after charmcraft 3.3 stable release
57+
credentials: ${{ secrets.CHARMHUB_TOKEN }}
58+
github-token: ${{ secrets.GITHUB_TOKEN }}
59+
use-labels: false
60+
fail-build: ${{ github.event_name == 'pull_request' }}
61+
62+
build:
63+
name: Build charms
64+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
65+
with:
66+
charmcraft-snap-channel: latest/beta/data-platform # TODO: remove after charmcraft 3.3 stable release
67+
path-to-charm-directory: .
68+
cache: false # TODO: change this to true once we are in charmcraftcache-hub

.github/workflows/release.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2023 Canonical Ltd.
2+
# See LICENSE file for licensing details.
3+
name: Release to Charmhub
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
10+
jobs:
11+
ci-tests:
12+
uses: ./.github/workflows/ci.yaml
13+
secrets: inherit
14+
permissions:
15+
contents: write # Needed to login to Discourse
16+
pull-requests: write # Need to create PR
17+
actions: write
18+
19+
build:
20+
name: Build charm
21+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
22+
with:
23+
charmcraft-snap-channel: latest/beta/data-platform # TODO: remove after charmcraft 3.3 stable release
24+
cache: false # TODO: change this to true once we are in charmcraftcache-hub
25+
26+
release:
27+
name: Release to Charmhub
28+
needs:
29+
- ci-tests
30+
- build
31+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
32+
with:
33+
charmcraft-snap-channel: latest/beta/data-platform # TODO: remove after charmcraft 3.3 stable release
34+
channel: latest/edge
35+
artifact-prefix: ${{ needs.build.outputs.artifact-prefix }}
36+
secrets:
37+
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}
38+
permissions:
39+
contents: write # Needed to create GitHub release

.gitignore

+6-159
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,9 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
1+
venv/
112
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
38-
39-
# Unit test / coverage reports
40-
htmlcov/
3+
*.charm
414
.tox/
42-
.nox/
435
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# poetry
98-
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99-
# This is especially recommended for binary packages to ensure reproducibility, and is more
100-
# commonly ignored for libraries.
101-
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102-
#poetry.lock
103-
104-
# pdm
105-
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106-
#pdm.lock
107-
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108-
# in version control.
109-
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
110-
.pdm.toml
111-
.pdm-python
112-
.pdm-build/
113-
114-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
115-
__pypackages__/
116-
117-
# Celery stuff
118-
celerybeat-schedule
119-
celerybeat.pid
120-
121-
# SageMath parsed files
122-
*.sage.py
123-
124-
# Environments
125-
.env
126-
.venv
127-
env/
128-
venv/
129-
ENV/
130-
env.bak/
131-
venv.bak/
132-
133-
# Spyder project settings
134-
.spyderproject
135-
.spyproject
136-
137-
# Rope project settings
138-
.ropeproject
139-
140-
# mkdocs documentation
141-
/site
142-
143-
# mypy
144-
.mypy_cache/
145-
.dmypy.json
146-
dmypy.json
147-
148-
# Pyre type checker
149-
.pyre/
150-
151-
# pytype static type analyzer
152-
.pytype/
153-
154-
# Cython debug symbols
155-
cython_debug/
156-
157-
# PyCharm
158-
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
159-
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
160-
# and can be added to the global gitignore or merged into this file. For a more nuclear
161-
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162-
#.idea/
6+
__pycache__/
7+
*.py[cod]
8+
.idea
9+
.vscode/

charmcraft.yaml

+14-9
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
# Copyright 2024 Canonical Ltd.
1+
# Copyright 2025 Canonical Ltd.
22
# See LICENSE file for licensing details.
33

44
type: charm
55

6-
bases:
7-
- build-on:
8-
- name: "ubuntu"
9-
channel: "22.04"
10-
run-on:
11-
- name: "ubuntu"
12-
channel: "22.04"
6+
platforms:
7+
138

149
parts:
1510
files:
1611
plugin: dump
1712
source: .
1813
override-build: |
1914
# Ship the charm contents
20-
curl -sSL https://code.launchpad.net/~pguimaraes/openmessaging-benchmark/+git/openmessaging-benchmark/+artifact/280249/+files/openmessaging-benchmark-0.0.1-ubuntu0-20241119152607-linux-x64.tar.gz | tar -zxvf -
15+
# curl -sSL https://code.launchpad.net/~pguimaraes/openmessaging-benchmark/+git/openmessaging-benchmark/+artifact/280249/+files/openmessaging-benchmark-0.0.1-ubuntu0-20241119152607-linux-x64.tar.gz | tar -zxvf -
16+
17+
# For some reason, getting 23 write error in this curl command.
18+
# moving away to wget
19+
apt update
20+
apt install -y wget
21+
wget https://code.launchpad.net/~pguimaraes/openmessaging-benchmark/+git/openmessaging-benchmark/+artifact/280249/+files/openmessaging-benchmark-0.0.1-ubuntu0-20241119152607-linux-x64.tar.gz
22+
tar -zxvf openmessaging-benchmark-*.tar.gz
23+
2124
mv openmessaging-benchmark-0.0.1-SNAPSHOT/ openmessaging-benchmark/
2225
craftctl default
2326
prime:
2427
- openmessaging-benchmark
28+
- LICENSE
2529
charm:
30+
plugin: charm
2631
override-build: |
2732
rustup default stable
2833

0 commit comments

Comments
 (0)