Michelangelo is an end-to-end model lifecycle management system at large scale
Project description
Michelangelo SDK
User Guide
Install core packges only
pip install michelangelo
Install with bundle plugins
pip install michelangelo[plugin]
User Guide
Michelangelo Python Client
- Set Michelangelo API server address using environment variable
MICHELANGELO_API_SERVER
. e.g.
export MICHELANGELO_API_SERVER="localhost:12345"
- Access API resources using Michelangelo Python client.
from michelangelo.api.v2.client import APIClient
from michelangelo.gen.api.v2.project_pb2 import Project
APIClient.set_caller('my-client') # initialize client with caller name
# If not specified in Python code, the client will use the Michelangelo API server
# address from MICHELANGELO_API_SERVER environment variable.
# list existing projects
projects = APIClient.ProjectService.list_project(namespace='default')
print("Existing projects:")
print(projects)
# create a new project
proj = Project()
proj.metadata.namespace = "default"
proj.metadata.name = "demo-project"
proj.spec.tier = 2
proj.spec.description = "demo project"
proj.spec.owner.owning_team = "8D8AC610-566D-4EF0-9C22-186B2A5ED793"
proj.spec.git_repo = "https://github.com/michelangelo-ai/michelangelo"
proj.spec.root_dir = "/demo-project"
APIClient.ProjectService.create_project(proj)
# get the new project
project = APIClient.ProjectService.get_project(namespace='default', name='demo-project')
print(project)
Developer Guide
Preprequisites
- Python 3.9
- Poetry: https://python-poetry.org
Cheat Sheet
- Install dependencies:
poetry install
- Install dependencies with plugins:
poetry install -E plugin
- Install dependencies with plugins:
- Add a new dependency:
poetry add <package-name>
- Run tests:
poetry run pytest
- Run examples:
- Install dependencies for example (ML libs for BERT model):
poetry install -E example
- Run example:
$ PYTHONPATH="." poetry run python ./examples/bert_cola/bert_cola.py
- Install dependencies for example (ML libs for BERT model):
- Format code:
poetry run ruff format .
- Run Michelangelo CLI:
poetry run ma --help
Environment Setup: Mac
- Install Python 3.9:
brew install python@3.9
- Install Poetry:
curl -sSL https://install.python-poetry.org | python3.9 -
- Create Python virtual environment and install packages:
poetry install
The last step will create a .venv
directory if it doesn't already exist.
This directory contains a Python virtual environment with all the dependencies installed.
You can activate this virtual environment and use it like any other Python virtual environment,
or you can run commands via the Poetry CLI, e.g., poetry run python
, poetry run pytest
, etc.
Dockerfile
If you experience issues with the Python environment, you can use the Dockerfile to build a Docker image with the necessary dependencies. We recommend to setup your local environment with the instructions above (with poetry), but you can use the Dockerfile as a fallback.
$ cd $REPO_ROOT/python
$ docker build -t $IMAGE_NAME -f ./examples/bert_cola/Dockerfile .
$ docker run $IMAGE_NAME
Regenerate Python gRPC client code
After protobuf file changes, use the following script to regenerate the Python gRPC client code. tools/gen-grpc-client.sh --clients python
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 michelangelo-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: michelangelo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
6947c85c0b9180dff2bbad39f0105d8068203bf07ae7b4e923121ba02bd826ac
|
|
MD5 |
457626056fa09098ffeff5370f5fa83b
|
|
BLAKE2b-256 |
c070d837b53de5e0f371e3fa4deb0b9ffbca6b5283707fc231369922d28d129b
|