generated from Hochfrequenz/python_template_repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
111 additions
and
10 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,30 @@ | ||
name: Publish Docker image to Github Container Registry GHCR | ||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
push_to_registry: | ||
name: Push Docker image to GHCR | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
# with: # we don't need this | ||
# submodules: "recursive" | ||
- name: get version tag | ||
run: | | ||
VERSION=$(echo ${GITHUB_REF#refs/tags/}) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Log in to GHCR | ||
# the token has repo:write and package scope and expires on 2025-10-08 | ||
# https://github.com/Hochfrequenz/ebd_toolchain/settings/secrets/actions/GHCR_PUSH_TOKEN | ||
run: echo "${{ secrets.GHCR_PUSH_TOKEN }}" | docker login ghcr.io -u hf-kklein --password-stdin | ||
|
||
- name: Build and push | ||
run: | | ||
docker build -t ebd_toolchain:$VERSION . | ||
docker tag ebd_toolchain:$VERSION ghcr.io/hochfrequenz/ebd_toolchain:$VERSION | ||
docker push ghcr.io/hochfrequenz/ebd_toolchain:$VERSION |
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,10 @@ | ||
FROM python:3.12-slim | ||
|
||
WORKDIR /app | ||
|
||
COPY requirements.txt . | ||
RUN pip install -r requirements.txt | ||
|
||
COPY src . | ||
|
||
CMD ["python", "ebd_toolchain/main.py", "-i", "/container/ebd.docx", "-o", "/container/output", "-t", "json", "-t", "dot", "-t", "svg", "-t", "puml"] |
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
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 |
---|---|---|
@@ -1,7 +1,23 @@ | ||
version: "3.8" | ||
|
||
services: | ||
kroki: # see https://docs.kroki.io/kroki/setup/use-docker-or-podman/#_run_multiple_kroki_containers_together | ||
kroki: | ||
image: yuzutech/kroki:0.24.1 | ||
ports: | ||
- "8126:8000" | ||
- "8125:8000" | ||
# hardcoded 8125 because: https://github.com/Hochfrequenz/rebdhuhn/issues/205 | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://localhost:8000/health" ] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 3 | ||
|
||
scrape-and-plot: | ||
build: . | ||
depends_on: | ||
kroki: | ||
condition: service_healthy | ||
volumes: | ||
- ${EBD_DOCX_FILE}:/container/ebd.docx | ||
- ${OUTPUT_DIR}:/container/output | ||
network_mode: host # Allow the container to use the host's network | ||
# this is also a side effect of https://github.com/Hochfrequenz/rebdhuhn/issues/205 | ||
# this prevents: requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8125): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fddfb8c9430>: Failed to establish a new connection: [Errno 111] Connection refused')) |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
#Environment for Kroki | ||
KROKI_HOST=http://localhost:8126/ | ||
EBD_DOCX_FILE=./edi_energy_mirror/edi_energy_de/FV2410/Entscheidungsbaum-DiagrammeundCodelisten-informatorischeLesefassung3.5KonsolidierteLesefassungmitFehlerkorrekturenStand31.07.2024_20250403_20240403.docx | ||
OUTPUT_DIR=./ebd_toolchain/machine-readable_entscheidungsbaumdiagramme/FV2404 |