Skip to main content

Quick Start - Classic ML

Overview

Now that you have done the configurations and installed the required tools, we can start initializing your first project using a CD4ML template that Connected AI Platform provides.

The idea behind the template is that it allows you to create your project's source code by running a sequence of commands. This allows you to spend less time to configure boilerplates, install required packages, or initializing CI/CD workflows. Since the Connected AI Platform constantly evolves, this template also allows you to update your existing project with minimum overhead.

You can find detailed instructions about how to use the CD4ML-Pipeline in GitHub: connected-ai / caip-examples.

What This Guide Covers

  1. Setting up a GitHub repository
  2. Creating your project code with the template
  3. Video Tutorial: Getting started with the Example Pipeline

1. Setting up a GitHub repository

If you already have a repository, then you can clone it to your local machine by following these guidelines: Cloning a repository.

2. Creating your project code with the template

2.1 Create new project

To create a new project you should follow the instructions written in the connected-ai / caip-examples repository as they are the most up to date.

📝 This is not needed on a Connected AI VS Code Server - here everything is already installed

To get started, ensure you have the required tools ( eg, AWS CLI, Poetry, and Python).

  1. Get authenticated in AWS with your central credentials.

  2. Generate a GitHub Personal Access Token ( PAT) with the full Workflow and Repo scopes and store it in a safe place, eg, Keyring.

  3. Clone this repository:

    git clone https://bmw.ghe.com/<your_github_organisation>/<your_github_repository>.git # (for HTTPS with PAT)
    git clone git@bmw.ghe.com:<your_github_organisation>/<your_github_repository.git # (for SSH)
  4. Configure Poetry to use virtual environments from your project's folder:

    poetry config virtualenvs.in-project true
  5. Install the project dependencies in a virtual environment:

    poetry install
  6. Activate your virtual environment:

    source .venv/bin/activate # (for Linux and macOS)
    .venv\Scripts\activate # (for Windows)

To briefly summarize that information, you need to have copier installed on your local environment. Then you can use the copier to pull connected-ai / caip-examples from GitHub with the most recent version.

> git clone https://bmw.ghe.com/conn-ai-demo/caip-examples.git

2.2 Install your project's dependencies

Next install all necessary dependencies and activate the created virtual environment. Pay attention to the password as you might get asked to provide your GitHub PAT again.

> uv sync
> source .venv/bin/activate # (for Linux and macOS)
> .venv\Scripts\activate # (for Windows)

2.3 Update the configuration to match your environment and namespace

To update the configuration just run the following command. You will be asked to provide the details of your environment. When working on a CAIP vs code environment, again we make your life easier and your configuration will be automatically loaded and provided as default values. Just confirm all prompts.

> caip update-config
? What's your 'aws_account_id'? 493239015811
? What's your 'product_name'? conn-ai
? What's your 'namespace'? ai-hworld
? What's your 'region'? eu-central-1
? What's your 'stage'? test
? Do you want to store the updated config? Yes

2.4 Run the examples

Now you are ready and you can run those examples on your environment. We recommend the following command to be able to interactively select the pipeline. Naturally, you can still run an individual pipeline by passing the config alias as parameter to the run command like this caip pipeline run <config-alias>.

> caip pipeline run
? Select a pipeline to run (Use arrow keys)
batch-inference: Example Batch Inference
» custom-base-image: Example Custom Base Image
custom-run-parameter: Example Runtime Parameter

⚠️ Prerequisites
To utilize Github actions ensure that the Orbit Spaceship offering CI-Trust is set up by creating a service request through the landing page.

3. Video Tutorial: Getting started with the Example Pipeline

⚠️ REVIEW REQUIRED
Video tutorial content will be added here