A package for authoring and deploying machine learning workflows
Project description
Apache Liminal
Apache Liminal is an end-to-end platform for data engineers & scientists, allowing them to build, train and deploy machine learning models in a robust and agile way.
The platform provides the abstractions and declarative capabilities for data extraction & feature engineering followed by model training and serving. Liminal's goal is to operationalize the machine learning process, allowing data scientists to quickly transition from a successful experiment to an automated pipeline of model training, validation, deployment and inference in production, freeing them from engineering and non-functional tasks, and allowing them to focus on machine learning code and artifacts.
Basics
Using simple YAML configuration, create your own schedule data pipelines (a sequence of tasks to perform), application servers, and more.
Getting Started Documentation
A simple getting stated guide for Liminal can be found here
Example YAML config file
---
name: MyLiminalStack
owner: Bosco Albert Baracus
volumes:
- volume: myvol1
local:
path: /Users/me/myvol1
pipelines:
- pipeline: my_pipeline
start_date: 1970-01-01
timeout_minutes: 45
schedule: 0 * 1 * *
metrics:
namespace: TestNamespace
backends: [ 'cloudwatch' ]
tasks:
- task: my_python_task
type: python
description: static input task
image: my_python_task_img
source: write_inputs
env_vars:
NUM_FILES: 10
NUM_SPLITS: 3
mounts:
- mount: mymount
volume: myvol1
path: /mnt/vol1
cmd: python -u write_inputs.py
- task: my_parallelized_python_task
type: python
description: parallelized python task
image: my_parallelized_python_task_img
source: write_outputs
env_vars:
FOO: BAR
executors: 3
mounts:
- mount: mymount
volume: myvol1
path: /mnt/vol1
cmd: python -u write_inputs.py
services:
- service:
name: my_python_server
type: python_server
description: my python server
image: my_server_image
source: myserver
endpoints:
- endpoint: /myendpoint1
module: my_server
function: myendpoint1func
Installation
- Install this repository (HEAD)
pip install git+https://github.com/apache/incubator-liminal.git
- Optional: set LIMINAL_HOME to path of your choice (if not set, will default to ~/liminal_home)
echo 'export LIMINAL_HOME=</path/to/some/folder>' >> ~/.bash_profile && source ~/.bash_profile
Authoring pipelines
This involves at minimum creating a single file called liminal.yml as in the example above.
If your pipeline requires custom python code to implement tasks, they should be organized like this
If your pipeline introduces imports of external packages which are not already a part of the liminal framework (i.e. you had to pip install them yourself), you need to also provide a requirements.txt in the root of your project.
Testing the pipeline locally
When your pipeline code is ready, you can test it by running it locally on your machine.
- Ensure you have The Docker engine running locally, and enable a local Kubernetes cluster:
And allocate it at least 3 CPUs (under "Resources" in the Docker preference UI).
If you want to execute your pipeline on a remote kubernetes cluster, make sure the cluster is configured using :
kubectl config set-context <your remote kubernetes cluster>
- Build the docker images used by your pipeline.
In the example pipeline above, you can see that tasks and services have an "image" field - such as "my_static_input_task_image". This means that the task is executed inside a docker container, and the docker container is created from a docker image where various code and libraries are installed.
You can take a look at what the build process looks like, e.g. here
In order for the images to be available for your pipeline, you'll need to build them locally:
cd </path/to/your/liminal/code>
liminal build
You'll see that a number of outputs indicating various docker images built.
- Deploy the pipeline:
cd </path/to/your/liminal/code>
liminal deploy
Note: after upgrading liminal, it's recommended to issue the command
liminal deploy --clean
This will rebuild the airlfow docker containers from scratch with a fresh version of liminal, ensuring consistency.
- Start the server
liminal start
- Stop the server
liminal stop
- Display the server logs
liminal logs --follow/--tail
Number of lines to show from the end of the log:
liminal logs --tail=10
Follow log output:
liminal logs --follow
-
Navigate to http://localhost:8080/admin
-
You should see your The pipeline is scheduled to run according to the
json schedule: 0 * 1 * *
field in the .yml file you provided. -
To manually activate your pipeline: Click your pipeline and then click "trigger DAG" Click "Graph view" You should see the steps in your pipeline getting executed in "real time" by clicking "Refresh" periodically.
Running Tests (for contributors)
When doing local development and running Liminal unit-tests, make sure to set LIMINAL_STAND_ALONE_MODE=True
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file apache_liminal-0.0.1.post1-py3-none-any.whl
.
File metadata
- Download URL: apache_liminal-0.0.1.post1-py3-none-any.whl
- Upload date:
- Size: 126.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e285b07aba3524aecf39a41d2720631a9791d1fc079552ac992519435f3c7f45 |
|
MD5 | 69782bf9739809067d0a22c2a44fc4a1 |
|
BLAKE2b-256 | 6e5a538881b39c19fa3e741eedd2d236ee4ff9dadb90bd445b1628cf962e726d |