Integrate ML platforms with Harness CI
Run training, evaluation, and deployment jobs on Azure ML, AWS SageMaker, Databricks, Google Vertex AI, or MLflow from a Harness CI pipeline.
Harness CI runs your machine learning workload on the platform that already hosts it. A Plugin step submits the training job, deployment, or tracking call to Azure ML, AWS SageMaker, Databricks, Google Vertex AI, or MLflow, so the model moves through the same governed pipeline as the rest of your software.
This page covers the Harness side of each integration. The data science work stays on your ML platform, and each section links to the vendor documentation for the platform-specific detail.
What you will learn from this topic
Plugin configuration: The plugin image and settings for each supported ML platform.
Pipeline placement: Where the training step sits relative to evaluation, packaging, and deployment.
Credential handling: How to pass cloud credentials to a plugin without writing them into YAML.
Evaluation and promotion: How to turn model metrics into a pipeline gate.
Before you begin
Harness CI project access: Permission to create and run pipelines. Go to RBAC in Harness to configure roles.
CI pipeline familiarity: Go to CI pipeline components to review stages and steps.
Docker connector: Each plugin runs as a container image. Go to Docker connector settings to create one.
ML platform account: An active account on your chosen platform, with a prepared workspace or project.
Training dataset: Prepare and store training datasets according to your model type and ML framework, and record an immutable path or version identifier for the dataset you train against.
Secrets: Store every credential as a text secret before you configure a plugin.
Plugin settings accept Harness expressions. Reference a stage variable with <+stage.variables.trackingUri>, and reference a text secret with <+secrets.getValue("secret_id")>. Use expressions for every credential and for any value that differs between environments.
Prepare your ML platform
Complete the platform setup before you add a step to Harness. Each platform needs a workspace or project, compute, and credentials that the plugin can use.
Go to Create Azure ML resources to set up your workspace and compute instance.
Note your subscription ID, resource group, and workspace name. The plugin requires all three.
Go to Data concepts in Azure ML to register your dataset as a data asset.
Go to Set up SageMaker Studio to create an AWS account, onboard a SageMaker domain and user, and add Studio permissions.
Create an execution role with SageMaker and S3 permissions, and note its ARN.
Upload your prepared dataset to S3 so the training job can reach it:
Go to Prepare your Databricks Runtime environment to configure a cluster.
Go to Create a notebook in your Databricks workspace, and note its workspace path.
Note your workspace host URL and cluster ID, and create a personal access token. The plugin requires all three.
Go to Set up Vertex AI on Google Cloud to create a project and enable the Vertex AI and Compute Engine APIs.
Create a service account with Vertex AI and Cloud Storage permissions, then download its key.
Create a source bucket for your notebook and an output bucket for results. Go to Manage datasets with Vertex AI to register your dataset.
Install MLflow in the environment where your training code runs:
Set up a remote tracking server that every team member and pipeline can reach. A local file store does not work for pipeline runs, because each build machine is ephemeral.
Note the tracking server URI and the backend store it writes to, such as a SQL database with an S3, Azure Blob Storage, or Google Cloud Storage artifact store.
Train a model from your pipeline
Add a Plugin step to a CI stage. The plugin submits the job to your ML platform and waits for the result, so the pipeline fails when training fails.
Settings:
connectorRef: A Docker connector.image:harnesscommunity/azure-ml.username,password,tenant_id,SUBSCRIPTION_ID: Azure credentials and subscription. Pass all four as secrets.AZURE_ML_WORKSPACE_NAME,RESOURCE_GROUP: The workspace and resource group you created.PROJECT_PATH: Repository URL for your Azure ML project.TRAINING_JOB_FILE: Path in the project repository to the training job definition.MODEL_NAME: Name to register the trained model under.ENDPOINT_NAME,ENDPOINT_YAML: Endpoint name and its definition file.DEPLOYMENT_NAME,DEPLOYMENT_YAML: Deployment name and its definition file.
Settings:
connectorRef: A Docker connector.image:harnesscommunity/aws-sagemaker.model_name: Name to register the model under in SageMaker.EXECUTION_ROLE_ARN: The SageMaker execution role you created.IMAGE_URL: Container image that serves the model.MODEL_DATA_URL: S3 path to the model artifact. SageMaker expects amodel.tar.gzarchive, not a raw dataset file.ENDPOINT_CONFIG_NAME,ENDPOINT_NAME,VARIANT_NAME: Endpoint configuration, endpoint, and production variant names.INSTANCE_TYPE,INITIAL_INSTANCE_COUNT: Serving instance size and count.USERNAME:AWS.AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_REGION: Credentials and region. Pass both keys as secrets.
Settings:
connectorRef: A Docker connector.image:harnesscommunity/databricks-ml.host: Your Databricks workspace URL.pat: A Databricks personal access token. Pass it as a secret.job_name: Name for the job the plugin creates.NOTEBOOK_PATH: Workspace path to the notebook to run.TASK_KEY: Unique key for the job task.Description: Job description.CLUSTER_ID: The cluster to run on.
This plugin executes a notebook and stores the output in Cloud Storage.
Settings:
connectorRef: A Docker connector.image:harnesscommunity/gcloud-vertex.allowlist: The notebook file to execute.project_id: Your GCP project ID.GCLOUD_SOURCE_BUCKET: Bucket holding the notebook.GCLOUD_OUTPUT_BUCKET: Bucket path for notebook output.SERVICE_ACCOUNT_KEY: Service account key. Pass it as a secret.DISPLAY_NAME: Display name for the job.
The MLflow plugin runs an MLflow Project against your tracking server and records the run.
Settings:
connectorRef: A Docker connector.image:harnesscommunity/mlflow.MLFLOW_TRACKING_URI: URI of your remote tracking server, for examplehttp://mlflow.example.com:5000. Reference it through a stage variable so it differs per environment.MLFLOW_EXPERIMENT_NAME: Experiment to log the run under.MLFLOW_PROJECT_PATH: Repository URL of the MLflow Project to run.MLFLOW_RUN_PARAMETERS: Parameters passed to the project entry point.
Evaluate the trained model
Evaluation turns a trained model into a promotion decision. The workflow is the same on every platform:
Prepare evaluation data: Store a held-out dataset in a format your model accepts. Confirm the model has not seen it during training, and preprocess it exactly as you preprocessed the training data.
Select metrics: Choose metrics that match the prediction task. Binary classification tasks such as credit card approval commonly use accuracy, precision, recall, F1 score, and area under the ROC curve. Consider business metrics that weigh false positives against false negatives.
Run the evaluation and fail on a miss: Compute the metrics, compare them against your threshold, and exit non-zero when the model misses it. This is what converts a metric into a pipeline gate.
Iterate: Adjust hyperparameters, algorithms, or preprocessing, then retrain and re-evaluate.
The following example computes metrics and enforces a threshold. Run it in a CI Run step after training so a failing model stops the pipeline:
Platform-native evaluation tooling is also available:
Go to View metrics for jobs and runs to review logged metrics in Azure ML studio.
Run evaluation as a SageMaker Processing Job, and compare runs with SageMaker Experiments. For foundation models, go to Evaluate a foundation model to use automatic and human evaluation. Delete processing jobs and test endpoints after evaluation to avoid unnecessary charges.
Evaluate in the notebook and visualize results with Databricks visualization tools. Log metrics to MLflow rather than to notebook output alone, so results survive past the run.
Go to Model evaluation in Vertex AI to review metrics for AutoML and custom-trained models, and enable model monitoring on deployed models to detect skew, drift, and anomalies.
Log evaluation metrics to the same MLflow run as training so both appear together in the tracking UI. Start the UI with mlflow ui, which serves on http://127.0.0.1:5000 by default, or open your remote tracking server URL to compare runs and visualize parameters and outputs.
Deploy the model and get predictions
Once a model passes evaluation, deploy it and call its endpoint for predictions. Harness CD manages the deployment and rollback for container and serverless targets, and each ML platform also offers a managed serving path.
Go to Deploy models with online endpoints for managed serving, or to Package and deploy models outside Azure ML to serve from your own infrastructure. The plugin handles endpoint creation when you supply ENDPOINT_YAML and DEPLOYMENT_YAML.
Go to Deploy models for inference to create a real-time or batch endpoint. The plugin creates the model, endpoint configuration, and endpoint from the settings above.
Go to Databricks Model Serving to serve a registered model behind an endpoint.
Go to Vertex AI deployment to deploy to an endpoint, and to Get predictions for online and batch prediction options.
Register the logged model in the MLflow Model Registry, then serve it with mlflow models serve or package it as a container image and deploy it with Harness CD. Go to MLflow Models to review the supported serving flavors.
Monitor, improve, and iterate
Set up monitoring and logging for every deployed model so you detect degradation before it reaches a business metric. Then feed what you learn back into retraining, using triggers or scheduled pipelines to rerun the training stage when drift crosses a threshold.
Azure ML: Go to Model monitoring to track data and prediction drift.
AWS SageMaker: Go to SageMaker Model Monitor to detect data quality and drift violations.
Databricks: Go to Monitor and diagnose serving endpoints to track endpoint health.
Google Vertex AI: Go to Vertex AI Model Monitoring to detect skew and drift, and to Vertex AI Model Registry to manage versions before redeployment.
MLflow: Compare production metrics against the logged training run to quantify degradation over time.
Troubleshooting
Next steps
Wire the integration into a complete pipeline, then add the governance controls that make model promotion auditable.
Tutorial - End-to-end MLOps CI/CD pipeline with Harness and AWS: Build, scan, gate, and deploy a model end to end.
MLOps best practices: Review the practices that keep model pipelines reproducible.
Run a plugin in CI: Understand Plugin step configuration in depth.
Policy as Code: Enforce model promotion rules across every pipeline.
Last updated
Was this helpful?