Quickstart: mantik CLI (pyenv)

Note

For this quickstart, we assume that you went through the First steps. For the next steps you need a mantik project with an experiment. We further assume that you have the following installed:

This section guides you through the process of executing your first run using the Mantik CLI. This tutorial is designed as a step-by-step walkthrough to help you successfully submit a run. To help you get started quickly, we’ve provided sample tutorial code: https://gitlab.com/mantik-ai/tutorials.

You will learn the following:

  • Set up a local environment to use mantik.

  • Submit and bookkeep a run in a virtual python environment with mantik.

Alternatively, you can also use the following notebook and execute the quickstart in google colab:

Quickstart notebook

Bookkeep a run with mantik

We will start a run with mantik by using manik CLI. The run will be tracked by mantik and be visible as part of your mantik project on the mantik web page.

Install dependencies

For the rest, we will work in a terminal. Open a terminal. First install the mantik package as well as mlflow.

pip install mantik
pip install mlflow

Note

Mlflow is a framework for machine learning experiment tracking. mantik supports this framework. In the demo code provided, mlflow is used, however, more details are not needed for now. You can familiarize with mlflow later on.

Authentication with mantik

Define your mantik credentials.

export MANTIK_USERNAME=<MANTIK USERNAME>
export MANTIK_PASSWORD=<MANTIK PASSWORD>

Initialize your local mantik session.

eval $(mantik init)

Submit run with mantik

Define which project the run belongs to and from which git repository the code for the execution should be taken.

export MANTIK_PROJECT_ID="YOUR_PROJECT_ID"
export MANTIK_EXPERIMENT_REPOSITORY_ID="YOUR_EXPERIMENT_ID"
export MANTIK_CODE_REPOSITORY_ID="YOUR_CODE_REPOSITORY_ID"

The different IDs can be found in your mantik project.

  • Project ID: Project -> Settings -> General

  • Experiment repository ID: Project -> Experiments -> Details (Action column)

  • Code repository ID: Project -> Experiments -> Details

With the following command you can submit a run

cd tutorials

mantik runs local "./wine-quality-estimator/mlproject-pyenv/MLProject" \
    --name "Wine Quality Estimator Test Run" \
    --branch main \
    --parameter alpha=0.1

This will execute the project locally meaning on your machine. The run is bookkept in the mantik platform, so when navigating in the GUI to Projects -> <PROJECT NAME> -> Runs -> Submissions you will see the run.

In the run’s table navigate to the Details view. Note that the used code repository and used infrastructure information is shown.