Manages Labs in your Kubernetes Cluster
Lab Orchestrator Lib
This package contains the lab orchestrator library.
pip3 install lab-orchestrator-lib
Check out the developer documentation at laborchestratorlib.readthedocs.io.
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
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.
The library contains two types of resources. The first is Kubernetes resources. This type contains
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
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 contains some
VirtualMachineInstances running in a
Namespace that can be accessed with VNC. The
LabInstances are separated from other
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.
To use this library create a APIRegistry and a controller collection. Than you can use the controllers in the controller collection to create new
For detailed information take a look at the developer documentation at laborchestratorlib.readthedocs.io.
An example of the implementation of the adapters and an example of how to used the controllers can be found in the LabOrchestratorLib-DjangoAdapter.
Feel free to open issues.
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
- Python 3.8
pip install -r requirements.txt
pip install -r requirements-dev.txt
- Create branch for your feature (
- Make sure test cases are running and add new ones for your feature
- Create MR into master
- Increase version number in
- Check and accept MR
- Merge MR
To generate the docs run:
cd docs && make html.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for lab-orchestrator-lib-1.0.1.tar.gz
Hashes for lab_orchestrator_lib-1.0.1-py3-none-any.whl