Skip to content

Commit

Permalink
chore: Update CI for Python 3.11 and add docs + catalog entry (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
hairmare authored Jun 12, 2023
1 parent c974331 commit 12f3feb
Show file tree
Hide file tree
Showing 13 changed files with 441 additions and 99 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ on:

jobs:
release-container:
uses: radiorabe/actions/.github/workflows/release-container.yaml@v0.11.1
uses: radiorabe/actions/.github/workflows/release-container.yaml@v0.13.1
with:
image: ghcr.io/radiorabe/acringest
name: acringest
display-name: Ingest daily ACRCloud data dumps
tags: minimal rhel9 ubi9 rabe minio kafka cloudevents acrcloud
cosign-base-image-only: false
mkdocs:
uses: radiorabe/actions/.github/workflows/release-mkdocs.yaml@v0.13.1
2 changes: 1 addition & 1 deletion .github/workflows/schedule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ on:

jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/schedule-trivy.yaml@v0.11.1
uses: radiorabe/actions/.github/workflows/schedule-trivy.yaml@v0.13.1
with:
image-ref: 'ghcr.io/radiorabe/acringest:latest'
2 changes: 1 addition & 1 deletion .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ on:

jobs:
call-workflow:
uses: radiorabe/actions/.github/workflows/semantic-release.yaml@v0.11.1
uses: radiorabe/actions/.github/workflows/semantic-release.yaml@v0.13.1
secrets:
RABE_ITREAKTION_GITHUB_TOKEN: ${{ secrets.RABE_ITREAKTION_GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ on:

jobs:
test-python-poetry:
uses: radiorabe/actions/.github/workflows/test-python-poetry.yaml@v0.11.1
uses: radiorabe/actions/.github/workflows/test-python-poetry.yaml@v0.13.1
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM ghcr.io/radiorabe/s2i-python:2.0.0-alpha.13 AS build
FROM ghcr.io/radiorabe/s2i-python:2.0.0 AS build

COPY --chown=1001:0 ./ /opt/app-root/src/

RUN python -mbuild


FROM ghcr.io/radiorabe/python-minimal:2.0.0-alpha.19 AS app
FROM ghcr.io/radiorabe/python-minimal:2.0.0 AS app

COPY --from=build /opt/app-root/src/dist/*.whl /tmp/dist/

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Run the container to see all available configuration options and their
corresponding environment variables.

```bash
podman run --rm ghcr.io/radiorabe/acringest:latest --help
podman run --rm ghcr.io/radiorabe/acringest:latest acringest --help
```

## Development
Expand Down
2 changes: 1 addition & 1 deletion acringest.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def on_sigint(*_): # pragma: no cover
changes = diff(minio_data, music)
if changes:
put_data(mc, minio_bucket_music, acrid, json.dumps(music))
logger.info(f"Applied changes {changes}")
logger.info(f"Applied changes to {acrid=}: {changes}")


def main(): # pragma: no cover
Expand Down
25 changes: 25 additions & 0 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: acr-ingest
title: ACR Ingest
description: |
Takes care of ingesting daily ACRCloud Broadcast Monitoring data dumps.
annotations:
backstage.io/techdocs-ref: dir:.
github.com/project-slug: radiorabe/acr-ingest
links:
- url: https://minio.service.int.rabe.ch/browser/acrcloud.music
title: MinIO Raw Bucket
- url: https://minio.service.int.rabe.ch/browser/acrcloud.music
title: MinIO Music Bucket
spec:
type: service
lifecycle: experimental
owner: it-reaktion
dependsOn:
- component:default/python-minimal
- component:default/s2i-python-minimal
- component:default/minio
- component:default/kafka
10 changes: 10 additions & 0 deletions docs/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* set primary color */
:root {
--md-primary-fg-color: #00C9BF;
--md-accent-fg-color: #00C9BF;
}

/* make code selectable on main */
.highlight .o {
user-select: none;
}
33 changes: 33 additions & 0 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Generate the code reference pages and navigation.
From https://mkdocstrings.github.io/recipes/
"""

from pathlib import Path

import mkdocs_gen_files

nav = mkdocs_gen_files.Nav()

path = Path("acringest.py")
module_path = path.relative_to(".").with_suffix("")
doc_path = path.relative_to(".").with_suffix(".md")
full_doc_path = Path("reference", doc_path)

parts = tuple(module_path.parts)

nav[parts] = doc_path.as_posix()

full_doc_path.parent.mkdir(parents=True, exist_ok=True)
with mkdocs_gen_files.open(full_doc_path, "w") as fd:
ident = ".".join(parts)
fd.write(f"::: {ident}")

mkdocs_gen_files.set_edit_path(full_doc_path, path)

with mkdocs_gen_files.open("reference/SUMMARY.md", "w") as nav_file:
nav_file.writelines(nav.build_literate_nav())

readme = Path("README.md").open("r")
with mkdocs_gen_files.open("index.md", "w") as index_file:
index_file.writelines(readme.read())
54 changes: 54 additions & 0 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
site_name: RaBe ACR Ingest
repo_url: https://github.com/radiorabe/acr-ingest
repo_name: radiorabe/acr-ingest

theme:
name: "material"
palette:
# Palette toggle for dark mode
- scheme: slate
toggle:
icon: material/brightness-4
name: Switch to light mode
# Palette toggle for light mode
- scheme: default
toggle:
icon: material/brightness-7
name: Switch to dark mode
icon:
repo: fontawesome/brands/git-alt
features:
- content.code.copy
- toc.integrate

markdown_extensions:
- pymdownx.highlight:
anchor_linenums: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences

extra_css:
- css/style.css

plugins:
- search
- autorefs
- gen-files:
scripts:
- docs/gen_ref_pages.py
- literate-nav:
nav_file: SUMMARY.md
- section-index
- mkdocstrings:
handlers:
python:
paths: [acringest]

nav:
- README: index.md
- Python Reference: reference/

watch:
- README.md
- acringest.py
Loading

0 comments on commit 12f3feb

Please sign in to comment.