Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
title: Manage the ML lifecycle with MLflow on Google Cloud C4A Axion VM

draft: true
cascade:
draft: true

minutes_to_complete: 30

who_is_this_for: This is an introductory topic for DevOps engineers, ML engineers, and software developers who want to manage the machine learning lifecycle using MLflow on SUSE Linux Enterprise Server (SLES) Arm64, track experiments, version models, and deploy models as scalable APIs.

learning_objectives:
- Install and configure MLflow on Google Cloud C4A Axion processors for Arm64
- Track experiments, log metrics, and compare runs using MLflow Tracking
- Manage and version models using the MLflow Model Registry
- Deploy models as APIs and validate end-to-end ML workflows

prerequisites:
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
- Basic familiarity with Python and machine learning concepts

author: Pareena Verma

##### Tags
skilllevels: Introductory
subjects: ML
cloud_service_providers:
- Google Cloud

armips:
- Neoverse

tools_software_languages:
- MLflow
- Python
- scikit-learn

operatingsystems:
- Linux

# ================================================================================
# FIXED, DO NOT MODIFY
# ================================================================================

further_reading:
- resource:
title: MLflow official documentation
link: https://mlflow.org/docs/latest/index.html
type: documentation

- resource:
title: MLflow GitHub repository
link: https://github.com/mlflow/mlflow
type: documentation

- resource:
title: Scikit-learn documentation
link: https://scikit-learn.org/stable/
type: documentation

weight: 1
layout: "learningpathall"
learning_path_main_page: yes
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Get started with MLflow on Google Axion C4A
weight: 2

layout: "learningpathall"
---

## Explore Axion C4A Arm instances in Google Cloud

Google Axion C4A is a family of Arm-based virtual machines built on Google’s custom Axion CPU, which is based on Arm Neoverse-V2 cores. Designed for high-performance and energy-efficient computing, these virtual machines offer strong performance for modern cloud workloads such as CI/CD pipelines, microservices, media processing, and general-purpose applications.

The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.

To learn more, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).

## Explore MLflow on Google Axion C4A (Arm Neoverse V2)

MLflow is an open-source platform designed to manage the end-to-end machine learning lifecycle. It is widely used for experiment tracking, model management, reproducibility, and deployment.

MLflow provides a unified platform with components such as:

* **MLflow Tracking** for logging parameters, metrics, and artifacts
* **MLflow Projects** for packaging and reproducible execution
* **MLflow Models** for standardized model formats and deployment
* **MLflow Model Registry** for versioning, lifecycle management, and model governance

Running MLflow on Google Axion C4A Arm-based infrastructure enables efficient execution of machine learning workflows by leveraging multi-core CPUs and optimized memory performance. This results in improved performance per watt, reduced infrastructure costs, and better scalability for ML experimentation and deployment pipelines.

Common use cases include experiment tracking, model versioning, reproducible ML workflows, CI/CD integration for ML pipelines, and deploying models as scalable APIs for real-time inference.

To learn more, visit the [MLflow documentation](https://mlflow.org/docs/latest/index.html) and explore the [MLflow GitHub repository](https://github.com/mlflow/mlflow).

## What you've accomplished and what's next

In this section, you:

* Explored Google Axion C4A Arm-based VMs and their performance advantages for ML workflows
* Reviewed MLflow components, including Tracking, Projects, Models, and Model Registry
* Understood how Arm architecture improves efficiency and scalability for ML lifecycle management

Next, you'll create a firewall rule to enable remote access to the MLflow UI and model serving APIs used in this Learning Path.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Create a firewall rule for MLflow
weight: 3

### FIXED, DO NOT MODIFY
layout: learningpathall
---

Create a firewall rule in Google Cloud Console to expose required ports for the MLflow UI and model serving API.

{{% notice Note %}}
For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).
{{% /notice %}}

## Configure the firewall rule

Navigate to the [Google Cloud Console](https://console.cloud.google.com/), go to **VPC Network > Firewall**, and select **Create firewall rule**.

![Google Cloud Console VPC Network Firewall page showing the Create firewall rule button in the top menu bar alt-txt#center](images/firewall-rule.png "Create a firewall rule in Google Cloud Console")

Next, create the firewall rule that exposes required ports for Ray.

Set the **Name** of the new rule to "allow-mlflow-ports". Select the network that you intend to bind to your VM.

Set **Direction of traffic** to "Ingress". Set **Allow on match** to "Allow" and **Targets** to "Specified target tags". Enter "allow-ray-ports" in the **Target tags** text field. Set **Source IPv4 ranges** to "0.0.0.0/0".

![Google Cloud Console Create firewall rule form with Name set to allow-mlflow-ports and Direction of traffic set to Ingress alt-txt#center](images/network-rule.png "Configuring the allow-ray-ports firewall rule")

Finally, select **Specified protocols and ports** under the **Protocols and ports** section. Select the **TCP** checkbox and enter:

```text
5000,6000
```

* **5000** → MLflow Tracking UI
* **6000** → MLflow Model Serving API

Then select **Create**.

![Google Cloud Console Protocols and ports section with TCP ports configured alt-txt#center](images/network-port.png "Setting Mlflow ports in the firewall rule")

## What you've accomplished and what's next

In this section, you:

* Created a firewall rule to expose MLflow UI and model serving API
* Enabled external access to monitor experiments and access deployed models

Next, you'll run MLflow workloads and serve models on your Arm-based virtual machine.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Create a Google Axion C4A Arm virtual machine on GCP
weight: 4

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Provision a Google Axion C4A Arm VM

In this section, you'll create a Google Axion C4A Arm-based virtual machine on Google Cloud Platform. You'll use the `c4a-standard-4` machine type, which provides 4 vCPUs and 16 GB of memory. This VM will host your Ray application.

{{% notice Note %}}
For help with GCP setup, see the Learning Path [Getting started with Google Cloud Platform](/learning-paths/servers-and-cloud-computing/csp/google/).
{{% /notice %}}

## Provision a Google Axion C4A Arm VM in Google Cloud Console

To create a virtual machine based on the C4A instance type:

- Navigate to the [Google Cloud Console](https://console.cloud.google.com/).
- Go to **Compute Engine** > **VM Instances** and select **Create Instance**.
- Under **Machine configuration**:
- Populate fields such as **Instance name**, **Region**, and **Zone**.
- Set **Series** to `C4A`.
- Select `c4a-standard-4` for machine type.

![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console")

- Under **OS and storage**, select **Change**, and then choose an Arm64-based operating system image.
- For this Learning Path, select **SUSE Linux Enterprise Server**.
- For the license type, choose **Pay as you go**.
- Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space.
- Select **Choose** to apply the changes.
- Select **Create** to launch the virtual machine.

After the instance starts, select **SSH** next to the VM in the instance list to open a browser-based terminal session.

![Google Cloud Console VM instances page displaying running instance with green checkmark and SSH button in the Connect column alt-txt#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH")

A new browser window opens with a terminal connected to your VM.

![Browser-based SSH terminal window with black background showing Linux command prompt and Google Cloud branding at top#center](images/gcp-shell.png "Terminal session connected to the VM")

## What you've accomplished and what's next

In this section, you provisioned a Google Axion C4A Arm VM and connected to it using SSH.

Next, you'll install MLflow and the required dependencies on your VM.
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
---
title: Deploy MLflow on GCP SUSE Arm64 (Model Registry & Serving)
weight: 6

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Model Registry and Deployment

This section covers model versioning, alias assignment, and serving the model as an API.


## Terminal usage (Important)

We continue using the same terminals:

- **Terminal A** → Run scripts and test API
- **Terminal B** → MLflow server (already running)
- **Optional Terminal C** → Model serving (if you want a separate terminal)

If you want simplicity, you can use only **Terminal A + B**

## Set tracking URI

In **Terminal A**, run:

```bash
export MLFLOW_TRACKING_URI=http://127.0.0.1:5000
```

- This tells MLflow to use your running server.
- Without this, MLflow will not find your models.

## Create alias script

```bash
cd ~/mlflow-learning-path/demo
```

Create a script to select the best model automatically:

```bash
cat > set_prod.py <<'EOF'
import os
from mlflow import MlflowClient

tracking_uri = os.environ.get("MLFLOW_TRACKING_URI", "http://127.0.0.1:5000")
client = MlflowClient(tracking_uri=tracking_uri)

versions = client.search_model_versions("name='iris-model'")

best_v = None
best_acc = -1

for v in versions:
run = client.get_run(v.run_id)
acc = run.data.metrics.get("accuracy", -1)
if acc > best_acc:
best_acc = acc
best_v = v.version

client.set_registered_model_alias("iris-model", "production", best_v)
print("Production version:", best_v)
EOF
```

## Assign production model

**Run the script:**

```bash
python set_prod.py
```

**What this does:**

- checks all model versions.
- finds the best accuracy.
- marks it as production.

## Serve model

Now we deploy the model as an API.

You can run this in **Terminal A** or open **Terminal C**.

```bash
cd ~/mlflow-learning-path
source mlflow-env/bin/activate
```

```bash
export MLFLOW_TRACKING_URI=http://127.0.0.1:5000
```

```bash
mlflow models serve \
-m "models:/iris-model@production" \
-p 6000 \
--no-conda
```

## View registered models

Go to:

- Model training → Models

![MLflow Model Registry showing model versions#center](images/mlflow-model.png "MLflow Model Registry with versions")

You should see:

- multiple versions (v1, v2, v3…)
- one marked as production

## Test inference from the Free Terminal ( A or C)

```bash
curl -X POST http://127.0.0.1:6000/invocations \
-H "Content-Type: application/json" \
-d '{
"dataframe_records": [
{
"sepal length (cm)": 5.1,
"sepal width (cm)": 3.5,
"petal length (cm)": 1.4,
"petal width (cm)": 0.2
}
]
```

You will get a prediction output like:

```output
[0]
```

## What you've learned

You have successfully:

- Selected the best model from experiments
- Assigned a production alias
- Deployed the model as an API
- Performed inference using curl
Loading
Loading