Skip to content

Add comment to Dockerfile #19

Add comment to Dockerfile

Add comment to Dockerfile #19

Workflow file for this run

name: Parser CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: [ "main" ]
tags: [ "v*" ]
pull_request:
branches: [ "main" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11"]
services:
# Label used to access the service container
kafka:
# Docker Hub image
image: bitnami/kafka:3.4
# Provide the password for postgres
env:
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "true"
# Set health checks to wait until postgres has started
options: >-
--health-cmd "kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --create --if-not-exists && kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --describe"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Tests run directly on the runner so we have to map the port
- 9092:9092
endpoint:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-endpoint:latest
env:
ALLOWED_IP_ADDRESSES: "127.0.0.1"
AUTH_TOKEN: "abcd1234"
DATA_SOURCE_NAME: "digita.thingpark.http"
ENDPOINT_PATH: "/digita/v2"
HTTP_REQUESTHANDLER: "endpoints.digita.aiothingpark"
KAFKA_HOST: "kafka"
KAFKA_PORT: 9092
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
KAFKA_GROUP_ID: "digita_dev"
KAFKA_PARSED_DATA_TOPIC_NAME: "digita.parseddata"
KAFKA_RAW_DATA_TOPIC_NAME: "digita.rawdata"
LOG_LEVEL: "DEBUG"
DEBUG: 1
options: >-
--health-cmd "curl --fail http://localhost:8000"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Tests run directly on the runner so we have to map the port
- 8000:8000
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install ruff pytest requests
pip install -r requirements.txt
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff check --output-format=github --select=E9,F63,F7,F82 .
# default set of ruff rules with GitHub Annotations
ruff check --output-format=github .
- name: Test with pytest
env:
PYTEST_ADDOPTS: "--color=yes"
ALLOWED_IP_ADDRESSES: "127.0.0.1"
AUTH_TOKEN: "abcd1234"
DATA_SOURCE_NAME: "digita.thingpark.http"
ENDPOINT_PATH: "/digita/v2"
HTTP_REQUESTHANDLER: "endpoints.digita.aiothingpark"
KAFKA_HOST: "localhost"
KAFKA_PORT: 9092
KAFKA_BOOTSTRAP_SERVERS: "localhost:9092"
KAFKA_GROUP_ID: "digita_dev"
KAFKA_PARSED_DATA_TOPIC_NAME: "digita.parseddata"
KAFKA_RAW_DATA_TOPIC_NAME: "digita.rawdata"
LOG_LEVEL: "DEBUG"
DEBUG: 1
UVICORN_LOG_LEVEL: "DEBUG"
run: |
tests/70B3D50123456789.sh
python app.py &
pytest -v tests/test_digita_sensornode.py