Make sure you have Python >= 3.6
installed in your development environment,
Install virtualenv
, activate it and then install project dependencies
pip install -r requirements.txt
Run API server,
gunicorn --pythonpath . -k sync -b localhost:5000 main:app --reload
Swagger/OpenAPI based documentation can be obtained by accessing the following URL,
http://localhost:5000/api/swagger
Run unittest,
pip install -r requirements-test.txt
pytest
- Build container image (e.g. docker)
- Push container image to registry (e.g. quay.io)
- use
oc
to deploy it on OpenShift,
docker build --no-cache -t <image_name:tag> .
docker push <registry>/<image_name:tag>
oc process -f openshift/template.yaml -p DOCKER_REGISTRY=<registry> -p DOCKER_IMAGE=<image_name> -p GREMLIN_DEFAULT_HOST=<gremlin_host> -p GREMLIN_DEFAULT_PORT=<gremlin_port> | oc create -f -
A command tool has been created to ingest historical data into database through API server,
Make sure dependencies of command tool has been installed in your development virtualenv
,
pip install -r tools/requirements.txt
python tools/ingest_historical_csv.py <path_to_csv_file> --insert
python tools/ingest_historical_csv.py <path_to_csv_file> --feedback
A documentation has been created with details on how we can use QA scripts.