Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • aura/engine
  • hermannschwaerzler/engine
  • sumpfralle/aura-engine
3 results
Show changes
Commits on Source (1704)
[codespell]
exclude-file = .gitignore
skip = *.log,.git,*.png,*.db,*.pyc,Makefile,tests/*
count =
quiet-level = 1
ignore-regex = \b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b
\ No newline at end of file
[run]
branch = True
omit =
tests/*
\ No newline at end of file
.travis.yaml
.swagger-codegen-ignore
tox.ini
git_push.sh
test-requirements.txt
setup.py
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.python-version
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints
# VirtualEnv
python
#Testing
.noseids
# Configurations
config/engine.docker.yaml
env.list
# Socket
socket/engine.sock
\ No newline at end of file
PYTHONPATH=src
\ No newline at end of file
[flake8]
max-line-length = 99
max-doc-length = 99
docstring-convention=google
exclude = .venv, .cache, .local, .build, python, tests/*, __init__.py, src/aura_engine_api/*, src/aura_steering_api/*, src/aura_tank_api/*
ignore = E121,E123,E126,E203,E226,E24,E704,W503,N802,D105,D107,D200,D202,D212,D417,S301
*.pyc
*.log
tmp
env.list
python
__pycache__
*.db
.env
docker.env
/.idea/
/.vscode/tags
/.local
/.cache
/.build
/.bash_history
/config/engine.yaml
/config/systemd/dev/
/audio
/config/docker.engine.yaml
/config/engine.docker.yaml
.coverage
coverage.xml
image: python:3.11
stages:
- test
- release
.install_requirements: &install_requirements
- apt-get -qq update
- apt-get -y install curl pip
- python3 -m pip install --upgrade pip
- pip install poetry
- poetry install --no-interaction
.release-rules: &release-rules
# rule to run job on a tag-reference which has the form number.number.number (semantic versioning)
# or number.number.number-text (semantic versioning + release-name)
# and where a Dockerfile exists
- if: $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+$/ || $CI_COMMIT_TAG =~ /^\d+[.]\d+[.]\d+[-]\S+$/
exists:
- Dockerfile
run_test_cases:
stage: test
before_script:
- *install_requirements
- cp config/engine-tests.yaml config/engine.yaml
- mkdir -p .cache
- export TZ=Europe/Vienna
script:
- make coverage
coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage.xml
check_style:
stage: test
before_script:
- *install_requirements
script:
- make lint
- make spell
docker-push:
# Use the official docker image.
image: docker:latest
stage: release
variables:
# the name of the image without version
AURA_IMAGE_NAME: "autoradio/engine"
services:
- docker:dind
before_script:
# on a feature branch will login to gitlab registry
# else to docker hub
# hint: feature branches must begin with "feat"
- |
if expr "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" : ^feat > /dev/null
then docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
else docker login -u "$DOCKER_ID" -p "$DOCKER_HUB_AUTH"
fi
script:
# every commit on main branch should build and push image as main
# elseif its a feature branch build and push to gitlab registry
# else it is from a tag (enforced by gitlab-ci rules)
# hint: tags are references independent of branches
# hint: feature branches must begin with "feat"
- |
if [ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]
then docker build -t $AURA_IMAGE_NAME:main .
docker push $AURA_IMAGE_NAME:main
elif expr "$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME" : ^feat > /dev/null
then docker build -t $AURA_IMAGE_NAME -t $CI_REGISTRY_IMAGE:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME .
docker push $CI_REGISTRY_IMAGE:$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
else docker build -t $AURA_IMAGE_NAME -t $AURA_IMAGE_NAME:$CI_COMMIT_TAG .
docker push $AURA_IMAGE_NAME --all-tags
fi
rules:
- *release-rules
# every commit on master/main or feature branch should trigger a push
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^feat/
exists:
- Dockerfile
release_job:
stage: release
needs:
- docker-push
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules: *release-rules
script:
- echo "this will be a release when there is a tag, but tags should be protected to be only createable by maintainers."
release:
name: "Release $CI_COMMIT_TAG"
description: ./CHANGELOG.md
tag_name: "$CI_COMMIT_TAG"
ref: "$CI_COMMIT_TAG"
Summary describing the defect.
## Steps to Reproduce
1. ...
2. ...
3. ...
## Expected Result
...
## Actual Result
...
## Logs & configuration
If applicable, please provide:
- Contents of your `.env` or other configuration files. Keep in mind to remove any sensitive data like password, as the report will be visible publicly.
- Logs: Any errors in your browser console. In Firefox you can reach it by pressing `CTRL + SHIFT + K`, in Chrome or Chromium via `CTRL + SHIFT + J`. If available, extracts of relevant server log files found under `aura/logs`.
- The output of `docker compose ps --all`, ensuring all services are started successfully.
## Environment
Operating system and browser version.
Parent:
---
Abstract of the goal.
## Proposal
Specification on implementation.
## Sub Tasks
- [ ] ...
- [ ] ...
## Dependencies
- ...
- ...
Gottfried Gaisbauer <gogo@servus.at> Gottfried <gogo@servus.at>
Ingo Leindecker <ingo.leindecker@fro.at> ingo <ingo.leindecker@fro.at>
David Trattnig <david@subsquare.at> <david.trattnig@o94.at>
David Trattnig <david@subsquare.at> <david.trattnig@gmail.com>
Christian Pointner <equinox@helsinki.at> Christian Pointner <equinox@spreadspace.org>
Ernesto Rico Schmidt <ernesto@helsinki.at> <e.rico.schmidt@gmail.com>
Ernesto Rico Schmidt <ernesto@helsinki.at> <ernesto@ontolabs.com>
Hermann Schwärzler <hermann.schwaerzler@freirad.at> Hermann <hermann@laptop>
jackie / Andrea Ida Malkah Klaura <jackie@diebin.at> <jackie@o94.at>
jackie / Andrea Ida Malkah Klaura <jackie@diebin.at> Andrea Ida Malkah Klaura
Roman Brendler <roman@jointech.org> Roman <roman@jointech.org>
\ No newline at end of file
project_name_override: .build
package_name_override: aura_steering_api
\ No newline at end of file
project_name_override: .build
package_name_override: aura_tank_api
\ No newline at end of file
repos:
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
hooks:
- id: codespell
args: [""]
- repo: https://github.com/PyCQA/flake8
rev: 7.1.1
hooks:
- id: flake8
args: ["--config=.flake8"]
additional_dependencies: [
"flake8-docstrings"
]
\ No newline at end of file
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Start Engine",
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}",
"env": {
"PYTHONPATH": "${workspaceFolder}/src"
},
"module": "aura_engine.app",
"args": [],
"console": "integratedTerminal",
"justMyCode": false
}
]
}
\ No newline at end of file
{
"search.exclude": {
"**/.git": true,
"**/tmp": true,
"python/**": true,
"logs/**": true,
},
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"python.testing.pytestEnabled": false,
"python.testing.unittestEnabled": true,
}
\ No newline at end of file
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.0-alpha5] - 2024-11-04
### Added
- Ability to handle virtual timeslots. Such timeslots are generated by the fallback program feature.
- added error handling if no matching channel type is found
### Changed
- **BREAKING**: New API URL to retrieve the calendar information from steering is `/api/v1/program/playout`.
- Schema and implementation of the Steering API client matching the new response.
- Media sources holding some M3U playlist, now expect a `m3u://...` prefix instead of `playlist://`.
- Better handling for broken or invalid stream media sources.
- Changed the aura user and group ID from 2872 to 872.
- Renamed `in_line_x` to `aura_engine_line_in_x` and `lineout_` to `aura_engine_line_out_`.
- Improved test coverage further.
### Removed
- Removed `max_retries` and `retry_delay` from config (#74)
## [1.0.0-alpha4] - 2024-04-16
### Added
- Lots of test cases.
### Changed
- Engine now requires at least Python 3.11.
- Major refactoring of the scheduling mechanices. As a consequence the database dependency for caching is removed. Instead caching is performed in form of `json` files located in the configured `cache_dir` folder.
### Removed
- All database related settings and dependencies. When updating from an existing deployment, remember to compare the new config files and remove relevant entries.
### Fixed
- Issue where the configuration values for `retry_delay` and `max_retries` are mixed up.
### Security
- The codebase is now audited using the security tool [Bandit](https://bandit.readthedocs.io/).
## [1.0.0-alpha3] - 2024-02-23
### Added
- Additional logging while loading playlist entries (#136)
### Changed
- Configuration using yaml instead of ini files (#120)
- Change default database password to string to avoid parsing errors (#120)
- Use datatype float instead of int for `trackDuration` (#132)
### Fixed
- Fix redundant logging while loading playlist entry (#136)
- Fix line-in source selection (#141)
## [1.0.0-alpha2] - 2023-06-19
### Added
- API responses from Steering and Tank are now cached in `cache_dir`
### Changed
- Provide properties in API schemas in CamelCase notation (aura#141)
### Removed
- Remove mail service as it will be replaced by Prometheus monitoring (engine#109)
### Fixed
- Fix an issue where the Engine version is displayed in the logs wrongly
## [1.0.0-alpha1] - 2023-02-22
Initial release.
# Contributing
When contributing to this repository, please first read about [contributing to AURA](https://docs.aura.radio/en/latest/contribute/contributions.html). Then discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note we have a [code of conduct](https://docs.aura.radio/en/latest/contribute/code_of_conduct.html), please follow it in all your interactions with the project.
FROM python:3.11-slim AS base
LABEL maintainer="Christoph Pastl <christoph.pastl@fro.at>"
ENV AURA_UID=872
ENV AURA_GID=872
# Configure Poetry
ENV POETRY_VERSION=1.3.2
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VENV=/opt/poetry-venv
ENV POETRY_CACHE_DIR=/opt/.cache
# System Dependencies
RUN apt-get update && apt-get -y install \
apt-utils \
build-essential \
libpq-dev \
pip
# Setup Poetry
RUN python3 -m venv $POETRY_VENV \
&& $POETRY_VENV/bin/pip install -U pip setuptools \
&& $POETRY_VENV/bin/pip install poetry==${POETRY_VERSION}
ENV PATH="${PATH}:${POETRY_VENV}/bin"
# Base Structure
RUN mkdir -p /srv/src /srv/config /srv/logs /var/audio /etc/aura
COPY pyproject.toml poetry.lock README.md Makefile .env /srv/
WORKDIR /srv
# Init Application
COPY ./src /srv/src
COPY config/sample.engine.docker.yaml /srv/config/engine.yaml
RUN poetry install --no-interaction --no-ansi
# Update Permissions
RUN groupadd --gid ${AURA_GID} aura && \
useradd --gid ${AURA_GID} --no-user-group --uid ${AURA_UID} --home-dir /srv --no-create-home aura && \
chown -R ${AURA_UID}:${AURA_GID} /srv /etc/aura /var/audio
ENTRYPOINT ["make"]
CMD ["run"]
This diff is collapsed.