Choose how to run Python workloads in MLOps Studio

Python workloads in MLOps Studio are usually run in one of three ways:

JupyterLab

Use JupyterLab when you want to write, test, debug, and run Python code directly in the browser.

Training job

Use a training job when your Python code is already prepared as a script and should run inside the cluster as a repeatable workload.

Local IDE

Use Visual Studio Code Remote Tunnels or kubectl port-forward when you want to edit code from your local machine while the runtime remains inside MLOps Studio.

Prerequisites

Before starting, make sure that the following requirements are met.

No. 1 Access to the MLOps Studio workspace

You can sign in to the MLOps Platform and open your workspace.

See Access the MLOps Studio workspace.

No. 2 Existing namespace

A namespace has already been created.

See Create and manage a MLOps Studio namespace.

No. 3 Available quota

Your namespace has enough CPU, memory, storage, and GPU quota for the workload you want to run.

No. 4 Required dependencies

You know which Python and system libraries your workload requires.

Use JupyterLab

Use JupyterLab when you are still developing the workload.

JupyterLab is the best choice when you need to:

  • write and run Python code in the browser,

  • test imports and dependencies,

  • inspect data,

  • use a terminal inside the running environment,

  • install packages and immediately verify them,

  • prepare code before turning it into a repeatable job.

Code executed in JupyterLab runs inside the MLOps Studio environment, not on your local computer.

Use a training job

Use a training job when the code is already prepared as a Python script and should run inside the cluster.

A training job is the better choice when you need to:

  • run the same script repeatedly,

  • request specific CPU, memory, storage, or GPU resources,

  • run the workload without keeping a browser session open,

  • package the script through a ConfigMap,

  • use PVCs for libraries, data, or temporary files,

  • monitor the workload as a Kubernetes job resource.

A typical workflow is:

  • create or prepare the Python script,

  • upload the script into a ConfigMap,

  • create a PVC if the workload needs persistent storage,

  • submit the training job manifest with kubectl,

  • monitor the job until it completes.

Use a local IDE

Use a local IDE when you want to keep your editor on your local machine but run the code inside MLOps Studio.

There are two common methods:

  • Visual Studio Code Remote Tunnels – use this when you want your local Visual Studio Code to connect directly to a running MLOps Studio environment.

  • kubectl port-forward – use this when you want to expose a running JupyterLab service locally and connect to it from an IDE that supports remote Jupyter servers.

Decision table

Workload type

Use this approach

Python code under active development

JupyterLab

Script that should run repeatedly

Training job

Local Visual Studio Code workflow

Visual Studio Code Remote Tunnels

Local IDE with remote Jupyter support

kubectl port-forward

ConfigMaps, PVCs, and job manifests

kubectl with kubeconfig

What to do next

For interactive Python work, create or open a notebook environment. See articles

For command-line workflows, download kubeconfig for the namespace and configure kubectl on your local machine. See Access a MLOps Studio notebook environment with kubectl port-forward