Code Challenge - Devops: Scenario
Code Challenge - Devops: Scenario
Scenario
Our development team has written an API to perform an airport search. We expect this API to get a high load which is why we need a more
performant (and secure) setup to expose the API. This setup should use Docker and the overall design should look like this. Your task is to
provide a docker compose file that fulfills the requirements given below.
Try to design and implement your solution as if it was a real production system.
Design the system for a high load and with fault tolerance.
Ensure the isolation of the subsystems according to the scheme given below.
It's OK to try something new (tell us if you do), but feel free to use something you're comfortable with.
Production Setup
Technical requirements
only the nginx container is accessible to users, via HTTP and HTTPS (self-signed)
3 instances of the application container have to run at all times
the database is only accessible to the application container
the application also features a initialisation script to setup the DB
this has to be run exactly once (on initial provisioning)
the PostGres container is only accessible to the APP containers
App container
For the challenge we provide an application image. It is available as a docker image from our AWS ECR. The repository can be found at: 217233
105762.dkr.ecr.eu-central-1.amazonaws.com/pxi/challenge/sandbox . The ACCESS_KEY is AKIAJRYLFB6C6YVV5I6Q the SECRET_KEY is
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.
The appliacation is configured via environment variables. The following set should be used:
DB_NAME= NAME_OF_DATABASE
DB_USER= NAME_OF_DB_USER
DB_PASS= PASSWORD_FOR_DB_USER
DB_SERVICE= HOSTNAME_OF_DB_SERVER
DB_PORT= PORT_OF_DB
Once the application is running it is available at port 5000. To setup the database the following command has to be run only once in an app
container:
python csv_import.py
For use during development the dev team and the DBA also need direct access to the application containers and the DB in the most convenient
form. Please provide a description how you would change the setup or how to use the production setup to easily debug problems with the DB or
the app containers.