Skip to main content

Status Version License Issues Downloads Dependencies Docs

Lab Orchestrator Lib Django Adapter

This package implements the adapters to use the lab orchestrator library in django projects. That means that some data of the lab orchestrator library will be saved in the django database.

Github
PyPi
Read The Docs

Setup

Installation

Install this library with: pip install lab-orchestrator-lib-django-adapter.

Project setup

Assuming you have a django application, first define the following variables in your settings.py:

  • DEVELOPMENT (bool): If this is true the development mode is activated. This means, that no cacert is used and insecure certs are allowed. If false this assumes you are running this inside a Kubernetes cluster.
  • SECRET_KEY (str): This key is used to create jwt tokens. Create a random key for this and keep this key safe.

After that add lab_orchestrator_lib_django_adapter to the INSTALLED_APPS variable in your settings.py.

Environment Variables

The library makes use of some environment variables that you need to set:

  • KUBERNETES_SERVICE_HOST (str): Host of your Kubernetes API (if you run kubectl proxy: localhost)
  • KUBERNETES_SERVICE_PORT (int): Port of your Kubernetes API (if you run kubectl proxy: 8001)
  • DEVELOPMENT (bool): If this is true the development mode is activated. This means, that no cacert is used and insecure certs are allowed. If false this assumes you are running this inside a Kubernetes cluster.

Usage

You have three Model classes:

  • DockerImageModel
  • LabModel
  • LabInstanceModel

Those three models are used to save data from the library in the django database and those can all be used safely in read only view sets. The DockerImageModel and LabModel can also be used safely in a delete, update and create view sets. To create and delete a LabInstanceModel you need to use the lab instance controller. Updating a LabInstanceModel is not allowed.

To get extra information from Kubernetes resources you need to use the controllers.

A default ControllerCollection can be got with the get_default_cc method in lab_orchestrator_lib_django_adapter.controller_collection module. The controllers are part of the lab orchestrator lib and there you can find documentation about how to use this.

An example on how to use this library in ViewSets can be found in the views.py.

Metadata

Release files for lab-orchestrator-lib-django-adapter 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lab-orchestrator-lib-django-adapter 1.0.0
File Size Uploaded Provenance Actions
lab-orchestrator-lib-django-adapter-1.0.0.tar.gz 16.9 kB Without provenance Details for lab-orchestrator-lib-django-adapter-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lab-orchestrator-lib-django-adapter 1.0.0
File Interpreter ABI Platform Actions
lab_orchestrator_lib_django_adapter-1.0.0-py3-none-any.whl Python 3 none any Details for lab_orchestrator_lib_django_adapter-1.0.0-py3-none-any.whl

Total release size: 36.6 kB

Release files / lab-orchestrator-lib-django-adapter-1.0.0.tar.gz

Download URL lab-orchestrator-lib-django-adapter-1.0.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6d14fa76e693c23b7d0667b2f67cdc3bb424593a685bad2036d72dbc9b7afa42
BLAKE2b-256 checksum
How to use checksums
a4ac1773d14d61882638d431463b6f4948b62f23ffaf9a35e21939438a284038
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

Release files / lab_orchestrator_lib_django_adapter-1.0.0-py3-none-any.whl

Download URL lab_orchestrator_lib_django_adapter-1.0.0-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01ea624afff301446f6722235deb5562fb8739c437cde1a1ab045a758acc43a2
BLAKE2b-256 checksum
How to use checksums
dedda7150d96b61306ffca0d5057a70ceb92d4b74a95f639a60a45eea1ed2ed3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.8.10

Security for lab-orchestrator-lib-django-adapter 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page