Skip to content
Snippets Groups Projects
Commit 9df0f04b authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

Update instructions to use meta's docker-compose

parent 46ee71d8
No related branches found
No related tags found
No related merge requests found
......@@ -2,79 +2,43 @@
AURA Steering: Program Scheduler
================================
AURA Steering is the scheduling module, where the actual program schedule of the
whole station is stored as well as all infos regarding single shows and
AURA Steering is the scheduling module, where the actual program schedule of
the whole station is stored as well as all infos regarding single shows and
emissions.
It also acts as an OpenID Connect provider for `dashboard` and `tank`.
It also acts as an OpenID Connect provider for ``dashboard`` and ``tank``.
Requirements
Installation
------------
- Docker Engine 20.10+
- Docker Compose 2.2+
Follow the instructions to deploy AURA Web from the `Docker Compose
Installation`_.
Quickstart
----------
First build the services::
$ docker compose build
Then, you can setup the database::
$ docker compose run django ./manage.py migrate
You can the load all the fixtures. This loads data for the authentication
(users, groups and permissions) and for the program app (categories, funding
categories, hosts, languages, music focus, recurrence rules, shows, topics and
types).
If you just want to try ``steering`` locally, use the provided compose setup
and be sure to put put ``AURA_PROTO=http`` in the ``.env`` file.
This provides enough data to get started::
A better development setup for ``steering``, that pulls the docker images for
``dashboard`` and ``tank`` from Docker Hub, builds the image for ``steering``
locally and exposes the ports can be achieved with the
``docker-compose.steering.yml`` by adding this lines to the end of the ``.env``
file::
$ docker compose run django ./manage.py loaddata fixtures/*/*.json
Alternatively, if you prefer, you can just create a super user after setting up
the database::
$ docker compose run django python manage.py createsuperuser
The only required fixtures are the recurrence rules, these are needed to create
schedules::
$ docker compose run django ./manage.py loaddata fixtures/program/rrule.json
.. warning:: Currently, if you only create a supert user and load the recurrence rules, you will need to create at least one show using the API in order to use the dashboard.
Then, you can create a RSA Key and the clients for `dashboard` and `tank`::
$ docker compose run django ./manage.py creatersakey
$ docker compose run django ./manage.py create_oidc_client dashboard public -r "id_token token" -u http://localhost:8080/oidc_callback.html -u http://localhost:8080/oidc_callback_silentRenew.html -p http://localhost:8080/
$ docker compose run django ./manage.py create_oidc_client tank confidential -r "code" -u http://localhost:8040/auth/oidc/callback
If you prefer to use the admin interface for this, refer to the [OpenID Client
Configuration](https://gitlab.servus.at/aura/meta/-/blob/master/docs/administration/oidc-client-config.md#registering-oidc-clients-via-the-admin-interface).
Finally, you can start the services::
$ docker compose up
You can then login into the admin interface at http://localhost:8000/admin or
use the API at http://localhost:8000/api/v1/
STEERING_VERSION=latest
COMPOSE_FILE=docker-compose.yml:docker-compose.steering.yml
Testing
-------
If you want to run the test suite, you can run `pytest` in the container::
If you want to run the test suite, you can run ``pytest`` in the container::
$ docker compose run django pytest
$ docker compose run steering pytest
venv
----
.. warning:: This is not the recommended way: it uses SQLite instead of Postgres and you may run into other issues.
.. warning:: This is not the recommended way: it uses SQLite instead of Postgres and will be deprecated soon
If you really don't want to use Docker, you can install `steering` using a
If you really don't want to use Docker, you can install ``steering`` using a
virtual environment.
Create and activate a virtual environment::
......@@ -118,14 +82,12 @@ Finally, you can start the development server::
Data Model
----------
You can generate a visualization of the data model using the Django extensions.
First, install GraphViz globally:
apt-get install graphviz
Then, run following to generate an image out of the models:
A visualization of the data model can be generated using the `Graph Models
Django Extensions`_
(venv) $ ./manage.py graph_models --pydot -g -o steering_data_model.png program profile
The following command will generate an image out of the models::
(venv) $ docker compose steering run ./manage.py graph_models --pydot -g -o steering_data_model.png program profile
.. _Docker Compose Installation: https://docs.aura.radio/en/latest/administration/install-docker-compose.html
.. _Graph Models Django Extensions: https://django-extensions.readthedocs.io/en/latest/graph_models.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment