Skip to content

ImperialCollegeLondon/drunc_ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub pre-commit.ci status Test and build codecov

DUNE Run Control User Interface (drunc-ui)

This README contains a short summary on getting started with the project. For more details see the documentation.

This repo defines the web interface for various drunc tools. Including:

Running the Project Locally

The DUNE control system comprises multiple services working in concert (see the drunc repository for an overview). Whilst it is possible to manually run the individual services as required it is strongly recommended to use the Docker setup provided.

Docker Setup

This repository provides a Docker Compose configuration providing the requisite services suitable for development of the interfaces using realistic test data. Working with the full docker stack requires building a very larger docker base image and has heavy resource requirements when running. For this reason a "lite" stack is also provided that can be used for development of the Process Manager UI.

The full and lite stack are defined using Docker Compose profiles. It is recommended to set the COMPOSE_PROFILES environment variable to select which stack you are working with. Use the value drunc for the full stack or drunc-lite for the lite stack.

You can also use the --profile flag when invoking docker compose however the instructions in this file assume you are using the environment variable.

Process Manager UI

You can use either the full or lite Docker Compose profiles when working with the Process Manager UI.

Getting Started with the Process Manager UI

Check you have a value set for COMPOSE_PROFILES (see above). Start the docker stack with:

docker compose up

It can take a few moments for the services to boot but the UI should then be available in the browser at http://localhost:8000/process_manager/.

Note that if you have the Process Manager UI already open in a browser you may see backtraces from unsuccessful requests generated by the UI. These should stop once drunc has finished starting up.

Authentication is required to work with the application so you need to create a user account to work with:

docker compose exec app python manage.py createsuperuser

and follow the prompts. You should then be able to use the details you supplied to pass the login screen. You can use the "boot" button on the main page to create simple processes to experiment with.

Take the services down with docker compose down or by pressing Ctrl+C in the corresponding terminal.

Controller UI

You must use the full Docker Compose profile when working with the Controller UI. The controller UI will not function correctly with the lite profile.

Getting Started with the Controller UI

Check you have value of the COMPOSE_PROFILES variable set to drunc (see above). As with the Process Manager UI start the Docker Compose services and create a user account if not already done. You can then boot a full test session:

docker compose exec drunc /boot_test_session.sh

Note that the above consumes several Gb of memory.

The test session boots a full set of processes and controllers suitable for UI testing and development. Once booted you can view the status of the root controller with the UI at http://localhost:8000/controller.

For details of working with the controller see the drunc wiki. You should also be able to see the booted processes in the Process Manager UI.

Note for MacOS users

The above boot_test_session.sh will not work on M-series Macs because of limitations with the x86 architecture emulation used by MacOS. There is a simpler configuration that can be used instead. To use this, set the following environment variables before starting the docker containers:

  • CSC_SESSION=lr-session
  • CSC_URL=drunc:25000

Not Using Docker

Brief instructions are provided below on how to manually run the various services required to work with the Drunc UIs. These are only meant to be indicative however and are not regularly tested or maintained.

  1. Start Kafka - See Running drunc with pocket kafka.

  2. Start the drunc shell: drunc-unified-shell --log-level debug ./data/process-manager-pocket-kafka.json

  3. Start the application server: python manage.py runserver

  4. Start the Kafka consumer: python manage.py kafka_consumer --debug

You may then need to perform subsequent actions such as booting test session data.