Skip to content

MLFlow server provisioning for SageMaker Unified Studio using terraform

0

I am provisioning MLFlow tracking server instance using the following terraform script:

resource "aws_sagemaker_mlflow_tracking_server" "ml_flow_tracking_server" {
  tracking_server_name  = "MLFlow tracking server"
  role_arn = aws_iam_role.my_role.arn
  artifact_store_uri = "s3://sm/data/ml/mlflow"
}

Is there a way to "attach" the created instance of a tracking server to a specific domain or a project that is already existing inside a Unified SageMaker Studio, so it can be accessible through UI of the Studio as well?

asked a year ago724 views

2 Answers
0
Accepted Answer

Actually it can be "attached" using tags, this has worked for me:

resource "aws_sagemaker_mlflow_tracking_server" "ml_flow_tracking_server" {
  tracking_server_name  = "MLFlow tracking server"
  role_arn = aws_iam_role.my_role.arn
  artifact_store_uri = "s3://sm/data/ml/mlflow"
  tags = {    
    AmazonDataZoneDomain = "SMUS_DOMAIN_ID"    
    AmazonDataZoneProject = "SMUS_PROJECT_ID"  
  }
}

answered a year ago

0

Currently, there isn't a direct Terraform method to attach an MLflow tracking server to a specific domain or project in SageMaker Unified Studio.

When you create an MLflow tracking server using Terraform as shown in your code, the server exists independently. To use it within SageMaker Unified Studio, you would need to manually connect to it by copying its ARN and using it in your notebooks.

In SageMaker Unified Studio, you can access your MLflow tracking server by:

  1. Copying the ARN of your tracking server created via Terraform
  2. In your notebook, importing MLflow and setting the tracking URI using the ARN:
import mlflow
tracking_server_arn = "your-tracking-server-ARN"
mlflow.set_tracking_uri(tracking_server_arn)

While SageMaker Unified Studio (which is a relatively new offering) allows creating MLflow tracking servers directly through its UI under the MLflow section in the Applications pane, there isn't currently a Terraform resource to automatically associate externally created tracking servers with the Studio UI.

Note that when creating a tracking server through the SageMaker Studio UI, it automatically becomes accessible within that Studio environment, but when creating it through Terraform, you'll need to reference it by ARN in your code.
Sources
End-to-End model training and deployment with Amazon SageMaker Unified Studio | Artificial Intelligence
Create a tracking server using Studio - Amazon SageMaker AI
sagemaker unified studio | AWS re:Post
Accelerating generative AI development with fully managed MLflow 3.0 on Amazon SageMaker AI | Artificial Intelligence
Integrate MLflow with your environment - Amazon SageMaker AI

answered a year ago

AWS
SUPPORT ENGINEER

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.