Package: lab-orchestrator-lib
Lab Orchestrator LibThis package contains the lab orchestrator library.GithubPyPiRead The DocsInstallationpip3 install lab-orchestrator-libDocumentationCheck out the developer documentation atlaborchestratorlib.readthedocs.io.AdapterTo 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 theadapter documentationAdapter Libraries:There is already one library that contains all adapters to use the lab orchestrator lib withdjango:LabOrchestratorLib-DjangoAdapter. This library also contains an example Django API.TheLabOrchestratorLib-FlaskSQLAlchemyAdapterproject is not maintained and not working, but if you need an adapter for Flask-SQLAlchemy you can base them on this project.ResourcesThe library contains two types of resources. The first is Kubernetes resources. This type containsNetworkPolicy,VirtualMachineInstanceandNamespaceobjects. 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 containsuser,DockerImage,LabandLabInstanceobjects.ADockerImageis a link to a docker image that contains the VM image. ALabcontains one or multiple (currently not supported) VMs, each one is linked to aDockerImage. A lab can be started which results into aLabInstance. ALabInstancecontains someVirtualMachineInstances running in aNamespacethat can be accessed with VNC. TheLabInstancesare separated from otherLabInstanceswithNetworkPolicys.ControllerThis 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 thelab_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.UsageTo use this library create a APIRegistry and a controller collection. Than you can use the controllers in the controller collection to create newDockerImages,Labs andLabInstances.For detailed information take a look at the developer documentation atlaborchestratorlib.readthedocs.io.ExamplesAn example of the implementation of the adapters and an example of how to used the controllers can be found in theLabOrchestratorLib-DjangoAdapter.ContributingIssuesFeel free to openissues.Project StructureThesrcfolder contains the source code of the library. Thetestsfolder contains the test cases. There is a makefile that contains some shortcuts for example to run the test cases and to make a release. Runmake helpto see all targets. Thedocsfolder contains rst docs that are used inread the docs. Kubernetes yaml templates are placed insrc/lab_orchestrator_lib/templates/.Developer DependenciesPython 3.8Makepip install -r requirements.txtpip install -r requirements-dev.txtReleasesYour part:Create branch for your feature (issue/ISSUE_ID-SHORT_DESCRIPTION)CodeMake sure test cases are running and add new ones for your featureCreate MR into masterIncrease version number insrc/lab_orchestrator_lib/__init__.py(semantic versioning)Admin part:Check and accept MRMerge MRRunmake releaseDocsTo generate the docs run:cd docs && make html.