Provides core components of the Oasis platform, specifically:
- Flask application that provides the Oasis REST API
- Celery worker for running a model
A simple environment for the testing the API and worker can be created using Docker compose.
First make sure that you have Docker running. Then build the images for the API server, model execution worker and API runner:
docker build -f Dockerfile.oasis_api_server -t oasis_api_server .
docker build -f Dockerfile.model_execution_worker -t model_execution_worker .
docker build -f Dockerfile.api_runner -t api_runner .
Start the docker network:
docker-compose up -d
Check that the server is running:
curl localhost:8001/healthcheck
(For the Rabbit management application browse to http://localhost:15672, for Flower, the Celery management application, browse to http://localhost:5555.)
To run a test analysis using the worker image and example model data, run the following command:
docker exec oasisplatform_runner_1 sh run_api_test_analysis.sh
The API server provides a REST interface which is described here. You can use any suitable command line client such as curl
or httpie
to make individual API calls, but a custom Python client may be a better option - for this you can use the api_client
repository withing the oasislmf Python package.
We use the GitFlow model described here .
The main idea is that the central repo holds two main branches with an infinite lifetime:
- master: main branch where the source code of HEAD always reflects a production-ready state
- develop: main branch where the source code of HEAD always reflects a state with the latest delivered development changes for the next release. This is where our automatic builds are built from.
When the source code in the develop branch reaches a stable point and is ready to be released, all of the changes should be merged back into master. Feature branchs should be used for new features and fixes, then a Pull Request isues to merge into develop.
Dependencies are controlled by pip-tools
. To install the development dependencies, first install pip-tools
using:
pip install pip-tools
and run:
pip-sync
To add new dependencies to the development requirements add the package name to requirements.in
or to add a new dependency to the installed package add the package name to requirements-package.in
.
Version specifiers can be supplied to the packages but these should be kept as loose as possible so that all packages can be easily updated and there will be fewer conflict when installing.
After adding packages to either *.in
file, the following command should be ran ensuring the development dependencies are kept up to date:
pip-compile && pip-sync
To test the code style run::
flake8
To test against all supported python versions run::
tox
To test against your currently installed version of python run::
py.test
To run the full test suite run::
./runtests.sh
The Oasis CI system builds and deploys the following Docker images to DockerHub:
Note that the Dockerfiles cannot be used directly as there are version stubs that get substitued at build time by the CI system.
- Issues
- Releases
- General Oasis documentation
- Oasis API documentation
- Oasis Platform module documentation
The code in this project is licensed under BSD 3-clause license.