Skip to content

Latest commit

 

History

History
119 lines (77 loc) · 6 KB

File metadata and controls

119 lines (77 loc) · 6 KB

Open Delivery Gear - Core

This repository is the home of the core API and feature extensions for the Open Delivery Gear.

REUSE status tests release

Index

Technology

The core API implements a Python HTTP web server, intended for deployment into a Kubernetes cluster. It features compliance-related automation for software built with the Open Component Model.

Getting Started

There are multiple ways to run ODG-Core locally.

Standalone

The ODG-Core Python HTTP web server can be started locally as a standalone application. It is loosely coupled to the database and Kubernetes-specific components, therefore this option is considered best if you intend to run web server-only features (e.g. adding new endpoints).

Dependencies and Setup

First, you need to prepare your local environment. The Makefile implements convenient commands for setup, but makes certain assumptions (e.g. it does not use virtual environments). If you have a strong opinion on how to set up your local development environment, please review the Makefile in detail.

If you are fine with installing the Python packages globally, please run:

make setup

Running the Web Server

The Makefile features a convenient command to run the ODG-Core web server in a lightweight fashion. This naturally has limitations, as most features will be turned off. If you want to run specific features, please review the Makefile and build your custom run command.

To run ODG-Core in a simple configuration, please use:

make run

Kubernetes in Docker

To run the ODG-Core web server alongside dependencies and feature extensions, you need to deploy it to a Kubernetes environment. You can use Kubernetes-in-Docker (KinD) to deploy such a setup locally.

Please refer to this guide to deploy ODG to KinD.

Dev Container

You can also develop ODG in a Dev Container. Install the Dev Containers extension and choose Reopen in Container in VS Code.

The Dev Container provides:

  • Run & debug:
    • To run the core service, run Debug: core service
    • To run an extension, run Debug: extension and select the extension
  • Pytest integration
  • PostgreSQL browser (password: MyPassword, see .devcontainer/compose.yml)
  • Auto-format & lint on save

To work with a KinD cluster:

  1. Create the KinD cluster on the host: kind create cluster --config .devcontainer/kind-config.yml, which includes host.docker.internal as SAN
  2. Open the Dev Container (Reopen in Container in VS Code)
  3. Open a terminal session. The kubeconfig is refreshed on every shell startup, with 127.0.0.1 replaced by host.docker.internal
  4. Run .devcontainer/prepare-kind.py in the Dev Container to apply ODG CRDs and create src/secrets/kubernetes/devcontainers-cluster.yaml
  5. Update your local configuration and secrets

If you use Kubeconfig with multiple files, flatten first: kubectl config view --raw --flatten > ~/.kube/config.

To clean up the KinD cluster: kind delete clusters odg-devcontainer-cluster

Documentation

The documentation is hosted here.

Quicklinks

Open-API Specification

Additionally, each ODG-Core instance hosts an Open-API specification. It is available at: https://<odg-core>/api/v1/doc/

You can also checkout the documentation hosted by the public demo instance, but please be aware that the running version might differ from your installation.

-> Public ODG Demo Open-API

Packages

ODG-Core publishes multiple software artefacts. This list provides an overview.

Name Type Description Location
odg-core-libs Python Package Core APIs and functionalities. Contains the ODG web server. PyPi
odg-client Python Package Python HTTP client library to interact with the ODG-Core API PyPi
bdba-client Python Package Python HTTP client library to interact with BlackDuck Binary Analysis PyPi
odg-core OCI Image Filesystem to run ODG-Core and ODG extensions in cloud environments GCP
odg-core OCM Component Software component referencing all delivery artefacts and metadata OCM Repo

Bundesministerium für Wirtschaft und Energie (BMWE)-EU funding logo