a standalone context recommendation module from Askcos rewritten as a web service in FastAPI for ASPIRE project
- (if necessary) install git LFS:
git lfs install
- clone this repo:
git clone THIS_REPO
- pull the files from git LFS:
git lfs pull
Automatic (via docker compose
)
-
docker compose up -d
.- the
-d
flag starts the container in the background so you can go about your business.
- the
Manual
-
docker build -t TAG_NAME .
.- we usually supply
-t ASKCOS_CONTEXT
- By default, all commands are run under the
mambauser
user. If you feeled compelled, you can change this value by supplying--build-arg MAMBA_USER=USERNAME
todocker build
.
- we usually supply
-
docker run -d --name NAME -p 8000:8000 TAG_NAME
TAG_NAME
should be same as the above command-p 8000:8000
means (roughly) "expose port8000
on the host machine to port8000
on the container." It's standard for web services to be mapped to a port in the range [8000, 9000)
Note: all steps should be run from the top-level directory of this repo
- (if necessary) install (micro)conda
- build the conda environment:
conda env create -f env.yaml -n NAME
- activate the environment:
conda activate NAME
- install the
app
package:pip install . --no-deps
- run the service:
uvicorn app.main:app --host localhost --port 8000
- to check if the service is running:
$ curl -X GET localhost:8000/health {"message":"Alive!"}