UpGrade + AdapComp (Mooclet) in Docker
Using Upgrade with Mooclet-Engine Django API
You will need docker
and docker-compose
. I recommend using the docker UI app once you have it launched the first time.
Clone the mooclet-engine project from the open source fork here:
https://github.com/Simon-Initiative/mooclet-engine/tree/feature/dockerized-local-mooclet-engine
Switch to my branch with dockerized local setup:
Create a docker_local.env
docker_local.env
no modification should be necessary, but this is where to fiddle with your specific docker config needs if necessary
Create a secure.py
file
secure.py
fileNote: uncomment the line with SECRET_KEY
in your secure.py
and replace the value with some valid string (for this dev server any string is fine, but you can google how to get a proper key if you want)
Modify the PostGres port in docker_local.docker-compose.yml
to avoid port conflict (optional, but probably necessary)
docker_local.docker-compose.yml
to avoid port conflict (optional, but probably necessary)If running UpGrade backend, port 5432
will conflict as the postgres default port. The quick modification to allow running both is to change ports
value in docker_local.docker-compose.yml
from 5432:5432
to 5433:5432
like so:
Launch the container
If that is successful, you will see this in the mooclet-api logs, this is the API up and ready for business:
Use the generated API token in upgrade .env
.env
Plunk that token in your Upgrade .env
file for MOOCLETS_API_TOKEN
. If you don't have the other values your env, you will need these, they will not need modified:
Note also that if UpGrade is also running in a container, you will need to modify MOOCLETS_HOST_URL
as well to help docker map to it's internal "localhost":
MOOCLETS_HOST_URL=http://host.docker.internal:8000/
Test it out
Launch/restart UpGrade. If both applications can start up, you should be able to test out the connection by sending this via postman request. This will use UpGrade's API to proxy a call to Mooclet API (may likely need to set the Upgrade Authorization Bearer token). If success, you're up and running. π
POST http://localhost:3030/api/experiments
Last updated