Skip to content

open-component-model/delivery-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Delivery-Service

REUSE status

tests release

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.

Local Development

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.

Getting Started using Kind

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.

Getting Started

  1. Install development dependencies
pip3 install -r requirements-dev.txt --upgrade --break-system-packages
  1. Obtain secrets and configuration (tbd)

  2. Start delivery-service with (delivery) database

Run with local database

Currently SQLite3 and PostgreSQL 16 are supported.

SQLite3

adev runserver --port 5000 . -- --delivery-db-url sqlite+aiosqlite:///test.db

SQLite3 hints

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.

PostgreSQL

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

Run with remote database

Kubernetes

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

Hint: Enable caching

Optionally enable caching using the --cache-dir parameter.

REST-API-Documentation

Delivery-Service exposes generated documentation through the following route: /api/v1/doc