Automated Reservation in Your Local Environment¶
This is a step-by-step guide on how to setup the automated reservation and network access lab in your local environment using containers.
To be able to run the scenario you need to start up the following containers:
- NetBox
- use a standard NetBox container based on the Docker image provided by the NetBox development community
- follow the guide in the provided link to setup and run your NetBox container using Docker
- (Optional) Uptime Kuma + API
- follow the guide on how to Launch Uptime Kuma & Uptime Kuma API with Docker in a production setup
- the guide will help you start up two containers one for Uptime Kuma and another one for the API wrapper for Uptime Kuma
- make sure that instead of the latest version (louislam/uptime-kuma:latest), you use an Uptime Kuma version that is supported by the API (currently we are using v1.22)
Warning
Be careful when you setup the ports for the different containers so that they do not overlap.
- (Optional) Oxidized
- use the standard Docker image provided for Oxidized
- setup Oxidized to read its configuration, model and list of devices from a Git repo of your choice
- AirFlow
- Create an external network
- once you have these containers started create an external network in docker
- 'docker network create -d bridge your-network'
- add all of the running containers in the network you created
- 'docker network connect your-network container-name'
- once you have these containers started create an external network in docker
- Libre Booking + Bastion
- use the specially prepared containers by the team available on GitLab
- follow the readme file
- use the container name and internal port to provide the information about Airflow
- note that the APP_URL environment variable corresponds to Django's ALLOWED HOSTS
- this means that here you need to list all hosts that should be able to access the Bastion site and API
- for testing purposes it is recommended that you use *, which means all hosts
- add these containers in the network you created in the docker-compose file by
- adding the network definition in the bottom of the file
networks: netname: name: your_network external: true' - adding the network for each container that is created in the file
networks: - netname
- adding the network definition in the bottom of the file
- Camunda
- The latest image for the Camunda container that contains all processes needed to run the automated resource management is publicly available in the GP4L process management repo in the docker folder
- download the content of the docker folder
- update the docker-compose.yml and the .env files with the necessary information
- add the network you created in the same way as in the previous step
Parameters¶
Before you start up the container you need to setup the configuration parameters of the Camunda container. These are presented in the table below together with their description and their default values. The listed parameters can be edited in the environment file or the docker-compose file.
Warning
Pay attention that you need to use the correct names of the containers and their internal ports together with correct user credentials when configuring Camunda with the URL of the related components such as Netbox and Libre Booking.
Warning
You will need the Camunda server port value together with the name of the container when you configure webhooks in Netbox.
Note
For a test deployment you can use http everywhere.
Note
For the full list of available parameters take a look at the file. The ones listed are just the parameters that you will most probably need to adjust to your requirements for running the scenario.
| Parameter | Default value | Description |
|---|---|---|
| CAMUNDA_USER | admin | name of the Camunda user |
| CAMUNDA_SPRING_MAIL_HOST | smtp.live.com | SMTP email server that will send the email notifications |
| CAMUNDA_SPRING_MAIL_PORT | 587 | SMTP server port |
| CAMUNDA_SPRING_MAIL_USERNAME | user@domain.com | SMTP server account username |
| CAMUNDA_SPRING_MAIL_PASSWORD | ENC(password) | SMTP server account password |
| CAMUNDA_SPRING_MAIL_TO | user@domain.com | who should receive the email notifications, separate multiple email addresses with comma |
| CAMUNDA_SPRING_MAIL_TO_KEYS | user@domain.com | who should receive the ssh keys generated by Camunda when using Oxidized, separate multiple email addresses with comma |
| CAMUNDA_SPRING_MAIL_FROM_LIBRE | user@domain.com | the from email address when sending notifications related to Libre Booking |
| CAMUNDA_SPRING_MAIL_CREATION | True | should email notification be sent on Uptime Kuma monitor creation |
| CAMUNDA_SPRING_MAIL_MODIFY | True | should email notification be sent on Uptime Kuma monitor modification |
| CAMUNDA_SPRING_MAIL_REACTIVATION | True | should email notification be sent on Uptime Kuma monitor reactivation |
| CAMUNDA_SPRING_MAIL_PAUSED | True | should email notification be sent on Uptime Kuma monitor pausing |
| CAMUNDA_SERVER_PORT | 8080 | port for running the Camunda server |
| CAMUNDA_SERVICES_UPTIME_KUMA_EXISTS | true | Is Uptime Kuma used? If it is not used, then all related parameters should be left to default values |
| CAMUNDA_SERVICES_UPTIME_KUMA_IP | http://gp4lab-orch.qalab.geant.net:8000 | Uptime Kuma API URL |
| CAMUNDA_SERVICES_UPTIME_KUMA_USERNAME | admin | Uptime Kuma API username |
| CAMUNDA_SERVICES_UPTIME_KUMA_PASSWORD | ENC(kR0aexylg7CWLqae0OKo2ZkrRW8b092hQ7s4xJift5A=) | Uptime kuma API password |
| CAMUNDA_SERVICES_NETBOX_IP | https://netbox.rare.nmaas.eu/ | NetBox URL |
| CAMUNDA_SERVICES_NETBOX_TOKEN | ENC(tD64Frnu1Jy5ODEeY697HjjNaDuS0NxC) | NetBox token |
| CAMUNDA_SERVICES_OXIDIZED_EXISTS | true | Is Oxidized used? If not used, all related parameters should be left to default values |
| CAMUNDA_SERVICES_OXIDIZED_GIT | ssh://git@gitlab.nmaas.eu/groups-rare/rare-oxidized-1300.git | SSH path to Oxidized git repo |
| CAMUNDA_SERVICES_LIBRE_EXISTS | true | Is Libre Booking used? If not used, all related parameters should be left to default |
| CAMUNDA_SERVICES_LIBRE_BOOKING_IP | https://test-lb.rare.nmaas.eu/ | Libre Booking URL |
| CAMUNDA_SERVICES_LIBRE_BOOKING_USERNAME | admin | Libre Booking username |
| CAMUNDA_LIBRE_CONFIG_MIN_LENGTH | 1h0m | min duration for reservation |
| CAMUNDA_LIBRE_CONFIG_MAX_LENGTH | 90d0h0m | max duration for reservation |
| CAMUNDA_LIBRE_CONFIG_ALLOW_MULTIDAY | 1 | Is multiday reservation allowed? 0 if not. |
| CAMUNDA_LIBRE_CONFIG_REQUIRES_APPROVAL | 1 | Should reservations be authorised by Libre Booking admin? 0 if not. |
| CAMUNDA_LIBRE_CONFIG_MIN_REQUIRES_CHECK_IN | 1 | Is check-in required? 0 if not. |
| CAMUNDA_LIBRE_CONFIG_AUTO_RELEASE_MINUTES | 10 | After how many minutes resources should be released because there was no check-in |
| CAMUNDA_LIBRE_CONFIG_MAX_CONCURRENT_RESERVATIONS | 1 | How many reservations can be made simultaneously using the same resources |
| CAMUNDA_LIBRE_CONFIG_RESOURCE_TYPE_VALUE | GP4L device | name of the resource type parameter to be set in Libre Booking |
Starting the container¶
After setting up the parameters, you are ready to start up the container. You can simply use docker compose up using the provided docker-compose.yml.
Warning
Do not forget to set the port so that there is no clash with other containers you are running.
Danger
You need to start up the Camunda container last, after you have started all of the rest of the components for the scenario, as it will try to connect to each one on start up and fail to initialise if some are not available when you have set True in the parameters.
Once you have all containers running you are ready to go to configuration.