Home

Awesome

Application Programming Interface for CTSM

DOI

This repository contains an API and Dockerfile for containerised CTSM applications.

Setup and Run the Dev Server

To run the services locally or with docker, first you need to create a .env file in your project root directory. You can use env-example as a template and adjust the variables accordingly. See the Variable section below for more information.

Cases are supposed to run in docker, though you can also run them locally. To see what dependencies are needed for a local run, check out docker/Dockerfile.

Run locally

We recommend using a virtual environment for your project.

You can either use Conda or Python venv to create a virtual environment, though conda is not tested.

Run in Docker

Install docker and docker-compose first.

The current configs and commands are tested with docker 20.10.13 and docker-compose 1.29.2.

In order to avoid permission issues on folders handled by docker, you can set HOST_USER and HOST_UID variables to their respective values for the host user under which you are running the docker commands.

You can do this either in your .env file or by exporting them in your environment. THe following command is an example of how to set the variables: HOST_USER=$(whoami) HOST_UID=$(id -u) docker-compose -f docker-compose.dev.yaml up

See docker/entrypoint.sh to see how permissions are updated when running the docker services.

Variables

Adjustable Variables in .env:

VariableRequiredDescriptionDefaultScope
MODEL_REPONoThe model repository to usehttps://github.com/ESCOMP/CTSM/API/Docker
MODEL_VERSIONYesThe model repository tag to use-API/Docker
PORTNoThe port to use for API service in docker8000Docker
HOST_USERNoDocker host user. If specified for a docker container, ownership of all folders within resources will be changed to the container host user<br/>It must be used with HOST_UID-Docker
HOST_UIDNoUID of docker host user. See HOST_ID above and the docker section for more info-Docker

Resources

TODO: describe the resources and how they must be set up.