-
Notifications
You must be signed in to change notification settings - Fork 1
Deployment Guide
Follow instructions here
Suggested to use journald
to store all the logs locally.
Update the docker daemon file to set the Logging Driver to use journald
instead of storing in json files. The daemon.json file can be found in /etc/Docker/
directory, if it doesn't exist then create it.
{
"log-driver": "journald"
}
Restart Docker
Logs can now be accessed using the following command, for example. You can replace backend-api with any container name
sudo journalctl CONTAINER_NAME=backend-api
Liquibase is a tool that allows for easy creation and updating of databases via some chargelog files. It can automatically migrate a database to the latest version.
To install liquibase, copy across and run the install_liquibase.sh
script found in deployment/database
This will also install the dependencies required to install liquibase to work with mongoDb if required
- Java
- cUrl
- mongoDb plugins
This is the webserver that controls access to the various container run services
Run the following commands to install NGINX on Ubuntu
sudo apt update
sudo apt install nginx
When finished you should be able to hit port 80 on the server and see a template NGINX page, if you do NGINX has been successfully installed.
Create a file to config the reverse proxy. Call the file vairify
and create it in /etc/nginx/sites-available/
Copy the following into the file
server {
server_name vairify;
listen 80;
location /api/ {
proxy_pass http://localhost:8000/;
}
location / {
proxy_pass http://localhost:8001/;
}
}
This opens up two endpoints to the outside world on port 80.
The first listed is /api/ which is where the API endpoints will be hosted that the main UI requires. These requests get re-directed to port 8000 locally The second is for the UI, anything that hits the base URI will get directed to port 8001 locally and will return the UI.
Run the following commands to install python
sudo apt update && sudo apt upgrade
sudo apt install python3-pip
sudo apt install python3-venv
Create directory
mkdir /usr/config/
Run the github action deploy
ssh on to the server and run in /usr/config
sudo docker compose stop
sudo docker compose up db -d
The mongo database should now be running in a container
Copy liquibase directory found at deployment/database
Create file liquibase.properties
and add url property
i.e. url: mongodb://localhost:27017/air_quality_dashboard_db
Run liquibase update --changelog-file master_changelog.xml
Copy from deployment/database
to the server the files
add_cities_to_locations.py
CAMS_locations_V1.csv
seed_database_locations.sh
Run the seed_database_locations.sh
shell script
in /usr/config
run to start the remaining services
sudo docker compose up -d
When a change has been made to one of the services and it needs deploying to server run the following github actions
- run the relavant github action to create new image of updated service
- run deploy github action
Getting Started and Overview
- Product Description
- Roles and Responsibilities
- User Roles and Goals
- Architectural Design
- Iterations
- Decision Records
- Summary Page Explanation
- Deployment Guide
- Working Practices
- Q&A
Investigations and Notebooks
- CAMs Schema
- Exploratory Notebooks
- Forecast ETL Process
- In Situ air pollution data sources
- Notebook: OpenAQ data overview
- Notebook: Unit conversion
- Data Archive Considerations
Manual Test Charters
- Charter 1 (Comparing ECMWF forecast to database values)
- Charter 2 (Backend performance)
- Charter 3 (Forecast range implementation)
- Charter 4 (In situ bad data)
- Charter 5 (Filtering ppm units)
- Charter 7 (Forecast API input validation)
- Charter 8 (Forecast API database sizes)
- Charter 9 (Measurements summary API input validation)
- Charter 10 (Seeding bad data)
- Charter 11 ()Measurements API input validation
- Charter 12 (Validating echart plot accuracy)
- Charter 13 (Explore UI after data outage)
- Charter 14 (City page address)
- Charter 15 (BugFix diff 0 calculation)
- Charter 16 (City page chart data mocking)
- Charter 17 (Summary table logic)
- Charter 18 (AQI chart colour banding)
- Charter 19 (City page screen sizes)
- Charter 20 (Date picker)
- Charter 21 (Graph consistency)
- Charter 22 (High measurement values)
- Charter 23 (ppm -> µg m³)
- Charter 24 (Textures API input validation)
- Charter 25 (Graph line colours)
- Charter 26 (Fill in gaps in forecast)
- Charter 27 (Graph behaviour with mock data)
- Charter 28 (Summary table accuracy)
- Re‐execute: Charter 28
- Charter 29 (Fill in gaps in situ)
- Charter 30 (Forecast window)
- Charter 31 (UI screen sizes)