This repository is used for developing the Delivery Service
+ Extensions, which are part of the
OCM (Delivery) Gear. It exposes a RESTful API useful for delivery- and compliance-related tasks
for OCM-based software deliveries.
Both delivery service and (optional) extensions are intended to be deployed into a common kubernetes cluster.
Delivery Service and Extensions require a python runtime environment (see setup*.py for details) to run. Typically, the python3 version from greatest released version of alpine linux is used/tested (see Dockerfile.*). Greater or smaller versions may work, but are typically untested.
For delivery-service, use app.py
as entry point. Check online-help (app.py --help) for further
instructions. Note that most features of delivery-service are optional (features are disabled by
default unless explicitly enabled through additional configuration).
To benefit from a number of tools useful for development (e.g. hot-reloading or enhanced request information upon errors), you can install aiohttp-devtools and follow the Getting Started guide below.
If you wish to deploy the OCM-Gear (Delivery-Service, Delivery-Dashboard, Delivery-DB, Extensions) in a local kubernetes cluster using kind, please refer to this guide.
- Install development dependencies
pip3 install -r requirements-dev.txt --upgrade --break-system-packages
-
Obtain secrets and configuration (tbd)
-
Start delivery-service with (delivery) database
Currently SQLite3
and PostgreSQL 16
are supported.
adev runserver --port 5000 . -- --delivery-db-url sqlite+aiosqlite:///test.db
Valid SQLite URL forms are:
sqlite+aiosqlite:///:memory: (or, sqlite://)
sqlite+aiosqlite:///relative/path/to/file.db
sqlite+aiosqlite:////absolute/path/to/file.db
Note: Four slashes for abs-path.
Instantiate a local PostgreSQL 16 database, e.g. as OCI Container.
docker run -dit \
--name postgres \
-e POSTGRES_USER=postgres \
-e POSTGRES_PASSWORD=MyPassword \
-p 5432:5432 postgres:16
Start the delivery-service
adev runserver --port 5000 . -- --delivery-db-url postgresql+psycopg://postgres:[email protected]:5432
Port-forward the delivery-db service
kubectl port-forward service/delivery-db --namespace=database 5431:5432
Start the delivery-service
adev runserver --port 5000 . -- --delivery-db-url postgresql+psycopg://postgres:[email protected]:5431
Optionally enable caching using the --cache-dir
parameter.
Delivery-Service exposes generated documentation through the following route: /api/v1/doc