-
Notifications
You must be signed in to change notification settings - Fork 0
BecomingMaintainer
Through a series of tasks, this article aims to bring you up to speed with how to run ViEWS 3, how to fix common issues, and how to contribute new functionality to the system. After completing these tasks, you will have the competence to run and admin ViEWS 3.
- Azure SP credentials
Prerequisites:
- docker => 19.03.8
- docker-compose >= 1.28.6
ViEWS 3 is a [system of services][Architecture]. Each service runs in a separate process, and communicates with other services over HTTP. Services are all Docker containers, and can easily be put up using Docker Compose.
- Clone the prio-data/views3 repository.
ViEWS 3 uses Azure for storing Docker images, settings and secrets, and caching. The Azure resources are not generally accessible, and require authentication to reach. You authenticate to Azure by providing an auth-file to the running containers, and by authenticating with the Docker cli. To be able to authenticate, you must be given a file with the proper credentials by an administrator.
- Log in to ACR with Docker
Since the ViEWS 3 images are contained in a private registry, you must authenticate with the ViEWS Docker repository before you can download the images and run the composition. Information on how to do that is located here.
- Point to the authentication file
To pass the information from the authentication file to the Docker containers
spun up by Docker compose, create a file named .env
in the directory
containing the views 3 repo containing the following line:
AUTH_FILE={PATH_TO_AUTH_FILE}
replacing {PATH_TO_AUTH_FILE}
with the path to the authentication file on
your system. This passes the authentication information on to each container,
allowing them to communicate with Azure.
- Pull the images
docker-compose pull
This fetches the latest version of the images for each of the services.
- Put up the composition
Once you have these, you can run
docker-compose up
Congratulations! You now have ViEWS3 running locally on your computer.
To develop on the services comprising ViEWS 3, you need to rebuild and replace services with changes. First of all, you need the code for all of the services. If you have already cloned the prio-data/views3 meta-repository, enter it and run:
git submodule init
git pull --recurse-submodules
This downloads the repository for each service. You make changes to a service by editing the code within one of the repositories. Once you have edited some code, and want to see how it works in concert with the other services, run:
docker-compose build
Then to start the composition, you run
docker-compose up
A very practical one-liner that rebuilds and restarts only the services that have changed is:
docker-compose build && docker-compose up --no-deps -d
This lets you quickly iterate on services, seeing how they work after a quick compile-step.