Predictive Models in Production
If you ever find yourself with a "no space left on device" error when building the Docker image, try
docker rm $(docker ps -q -f 'status=exited')
docker rmi $(docker images -q -f "dangling=true")
bash scripts/build_training_image.sh
ENVIRONMENT=dev bash scripts/run_training_container.sh -c "jupyter notebook notebooks/ --allow-root --ip=0.0.0.0 --port=8888 --no-browser"
Then open http://localhost:8888 to run Jupyter.
If you need to enter into the container's shell, do this.
ENVIRONMENT=dev bash scripts/run_training_container.sh -
ENVIRONMENT=dev bash scripts/run_training_container.sh scripts/train.sh
If this is your first or only ECR repo, then run
bash scripts/push_training_image.sh $(aws ecr describe-repositories | jq -r '.repositories[0].repositoryUri')
You have have multiple ECR repos you'll have to change the argument so that it points to the one you want to push to.
bash scripts/build_api_image.sh
ENVIRONMENT=dev bash scripts/run_api_container.sh "python -m pmip.routes"
Run the API locally.
ENVIRONMENT=dev bash scripts/run_api_container.sh
Drop into the container.
ENVIRONMENT=dev bash scripts/run_api_container.sh -