Lab Orchestrator Lib
This package contains the lab orchestrator library.
Installation
pip3 install lab-orchestrator-lib
Documentation
Check out the developer documentation at laborchestratorlib.readthedocs.io.
Adapter
To use this library you need adapter classes. Adapter classes are used to connect the lab orchestrator lib to your database. How to write them is described in the adapter documentation
Adapter Libraries:
There is already one library that contains all adapters to use the lab orchestrator lib with django: LabOrchestratorLib-DjangoAdapter. This library also contains an example Django API.
The LabOrchestratorLib-FlaskSQLAlchemyAdapter project is not maintained and not working, but if you need an adapter for Flask-SQLAlchemy you can base them on this project.
Resources
The library contains two types of resources. The first is Kubernetes resources. This type contains NetworkPolicy, VirtualMachineInstance and Namespace objects. These are resources from Kubernetes that doesn't need to be saved.
The second type is database resources. They are saved in the database. For every database resource an adapter needs to be added. This type contains user, DockerImage, Lab and LabInstance objects.
A DockerImage is a link to a docker image that contains the VM image. A Lab contains one or multiple (currently not supported) VMs, each one is linked to a DockerImage. A lab can be started which results into a LabInstance. A LabInstance contains some VirtualMachineInstances running in a Namespace that can be accessed with VNC. The LabInstances are separated from other LabInstances with NetworkPolicys.
Controller
This library makes use of something called controllers. A controller is a class that controls one resource. The controllers can (and should) be used to create, get and update resources.
A controller collection is a collection of all controllers. You can create one with the lab_orchestrator_lib.controllers.controller_collection.create_controller_collection(...) function. This function takes all adapters, one api registry and a secret key for creating JWT tokens as parameter. The api registry is needed for the Kubernetes controllers and the adapters are injected into the database controllers.
Usage
To use this library create a APIRegistry and a controller collection. Than you can use the controllers in the controller collection to create new DockerImages, Labs and LabInstances.
For detailed information take a look at the developer documentation at laborchestratorlib.readthedocs.io.
Examples
An example of the implementation of the adapters and an example of how to used the controllers can be found in the LabOrchestratorLib-DjangoAdapter.
Contributing
Issues
Feel free to open issues.
Project Structure
The src folder contains the source code of the library. The tests folder contains the test cases. There is a makefile that contains some shortcuts for example to run the test cases and to make a release. Run make help to see all targets. The docs folder contains rst docs that are used in read the docs. Kubernetes yaml templates are placed in src/lab_orchestrator_lib/templates/.
Developer Dependencies
- Python 3.8
- Make
pip install -r requirements.txtpip install -r requirements-dev.txt
Releases
Your part:
- Create branch for your feature (
issue/ISSUE_ID-SHORT_DESCRIPTION) - Code
- Make sure test cases are running and add new ones for your feature
- Create MR into master
- Increase version number in
src/lab_orchestrator_lib/__init__.py(semantic versioning)
Admin part:
- Check and accept MR
- Merge MR
- Run
make release
Docs
To generate the docs run: cd docs && make html.
Metadata
Release files for lab-orchestrator-lib 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lab-orchestrator-lib-1.0.1.tar.gz | 24.6 kB | Without provenance | Details for lab-orchestrator-lib-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lab_orchestrator_lib-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for lab_orchestrator_lib-1.0.1-py3-none-any.whl |
Total release size: 52.8 kB
Release files / lab-orchestrator-lib-1.0.1.tar.gz
| Download URL | lab-orchestrator-lib-1.0.1.tar.gz |
|---|---|
| Size | 24.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
424a5b1a3b3742c5b6f0bfed45d0ac166bfcd996e064af059a577ac7346ec5dd
|
|
BLAKE2b-256 checksum How to use checksums |
50e5edd301cc0cf8534646b2846e8ea3b7709b98537384e5e01b6f3fa35b8829
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.10
|
Release files / lab_orchestrator_lib-1.0.1-py3-none-any.whl
| Download URL | lab_orchestrator_lib-1.0.1-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47f8e6ceebc78fe8c4a749deedb4474ab57d155c90fcc2e994b77d029d322b9e
|
|
BLAKE2b-256 checksum How to use checksums |
96fb75c3fbfed30723ec62610bd3f799785e63b90519d951196fb28be32173de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.10
|
Security for lab-orchestrator-lib 1.0.1
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.