API aiming to make Human Brain Project's Medical Informatics Platform's developped apps deployment on Mesos Marathon easier.
- PostgreSQL
- Python 3.6+
The docker images you want to enter into the database must be indexed on the MicroBadger platform as Maracker depends on this API.
Here's a guide explaining how to keep your container's metadatas up-to-date in MicroBadger using a webhook.
Assuming you already have a working instance of PostgreSQL and Python 3.6 or later installed and your operating system is GNU/Linux, you can install the API by doing the following actions:
python -m venv venvto create a virtual environment.source venv/bin/activateto activate the environement.pip install -r requirements.txtto install the project's dependencies.- Create a database named
marackerin PostgreSQL or choose another name. - If you choose another database name and your database user is not
postgres, set the following environment variables usingexportso that Django will have the right database connection information:DB_NAMEDB_USERDB_PASSWORDDB_HOSTDB_PORT
cd maracker && python manage.py migrateto create the database.python manage.py runserverto run the API.- You can test the API and query it with
curl http://localhost:8000/mipappswhich lists the available MIP applications in the database. - If you want to add a new application, you can test it using the
test.jsonfile which adds the MIP's woken container's data in the database. Just runcurl -X POST http://localhost:8000/mipapps -d @test.json -H "Content-Type: application/json".
If you want to run the unit tests, use the manage.py script and run
python manage.py test.
The infrastructure (Mesos, Marathon, Chronos and Traefik) can be launched
by executing the run.sh script. This launches docker containers and
restarts the traefik container 50 seconds after the others have been started
so that it connects to Marathon correctly. This amount of time can be set
by modifying the run.sh script.
The following UIs are accessible after the script executed:
- Marathon: http://marathon.localhost
- Chronos: http://chronos.localhost
- Traefik: http://traefik.localhost
- Maracker: https://localhost:8000
You can then try to deploy applications on Marathon using either the examples
in tests/deployable-marathon-apps or yours.
If you want to test the developped API, you can try to send the JSON files
in tests/maracker-use-cases (docker-nginx.json, docker-webapp.json or
docker-webapp2.json) to the API.
If you you want to stop the stack, launch
docker-compose -f stack-compose.yml stop.