Legion product contains 5 main development parts:
- Python packages
- Executes the
make install-all
command to downloads all dependencies and install Legion python packages. - Verifies that the command finished successfully, for example:
legionctl --version
- Main entrypoints:
- Legion sdk -
legion/sdk
- Legion cli -
legion/cli
- Legion sdk -
- Executes the
- Legion Jupiterlab plugin
- Workdir is
legion/jupyterlab-plugin
- Executes the
yarn install
command to downloads all Javascripts dependencies. - Executes the
npm run build && jupyter labextension install
command to build the Jupiterlab plugin. - Starts the Jyputerlab server using
jupyter lab
command. - Or you can perform all actions above using docker, for example:
make docker-build-jupyterlab && make run-sandbox
- Workdir is
- Golang services:
- Executes the
dep ensure
command in thelegion/operator
directory to downloads all dependencies. - Executes the
make build-all
command in thelegion/operator
to build all Golang services. - Main entrypoints:
- API Gateway service -
legion/operator/cmd/edi/main.go
- Kubernetes operator -
legion/operator/cmd/operator/main.go
- AI Trainer -
legion/operator/cmd/trainer/main.go
- AI Packager -
legion/operator/cmd/packager/main.go
- Service catalog -
legion/operator/cmd/service_catalog/main.go
- API Gateway service -
- Executes the
- Legion Mlflow integration
- Executes the
pip install -e .
command in thelegion-mlflow
repository.
- Executes the
- Legion Airflow plugin
- Executes the
pip install -e .
command in thelegion-airflow-plugins
repository.
- Executes the
-
Python
. Update dependencies in aPipfile
. Executemake update-python-deps
command. -
Golang
. Update dependencies in aGopkg.toml
. Executedep ensure
command inlegion/operator
directory. -
Typescript
. Legion uses theyarn
to manipulate the typescript dependencies.
All API entities are located in legion/operator/pkg/api
directory.
To generate swagger documentation execute make generate-all
in legion/operator
directory.
Important for Mac users: Makefile uses GNU sed
tool, but MacOS uses BSD sed
by default. They are not fully
compatible. So you need install and use GNU sed
on your Mac for using Makefile.
After previous action you can update python and typescript clients using the following command: make generate-clients
.
Make sure you have done the following actions before a pull request:
- for python packages:
make unittest
- Run the python unit tests.make lint
- Run the python linters.
- for golang services in the
legion/operator
directory:make test
- Run the golang unit tests.make lint
- Run the golang linters.make build-all
- Compile all golang legion services
- for typescript code in the
legion/jupyterlab-plugin
directory:yarn lint
- Run the typescript linter.jlpm run build
- Compile the jupyterlab plugin.
During development, you often have to change the helm chart, to test the changes you can use the following command
quickly: make helm-install
.
Optionally, you can create the variables helm file and specify it using the HELM_ADDITIONAL_PARAMS
Makefile option.
You always can download real variables file from a Terraform state.