What I want to do:
I am trying to execute mlflow ui
in the SageMaker Studio Lab terminal to run a local mlflow server and be able to view it in the tab next to my SageMaker Studio Lab tab.
What I tried so far:
- executing
mlflow ui
in the SageMaker Studio Lab terminal (which returns success message and info that it is listening at http://127.0.0.1:5000) and then setting port forwarding between SageMaker Studio Lab instance and my local machine withssh -L 5000:localhost:5000 studio-lab-user@<ip>
, however that returned "Connection timed out" - executing
mlflow ui --host 0.0.0.0
in the SageMaker Studio Lab terminal – this didn’t help either as I am still getting connection refused in my browser.
2
Answers
Hey SlimakSlimak ๐
SageMaker Studio Lab is a free service with (frustratingly) limited options when it comes to customisability. Unfortunately, port forwarding is not possible within Studio Lab.
You can achieve your desired outcome by signing-up for an AWS Account, and creating a SageMaker Studio Domain. Once created, you’ll need to make a VPC with internet access, and establish a connection between Studio and your new VPC. This guide provides a good overview of the process.
A note about pricing…
SageMaker is in the AWS Free Tier (see more here), so you can use certain functionality for 2 months without incurring any cost.
You’re eligible for 250 hours per month of
ml.t3.medium
-powered notebooks in SageMaker Studio for free.Alternative Options
t3.micro
) that’s included free for 12 months on the Free Tier.Good luck!
Direct port forwarding is not possible with SageMaker Studio Lab, but you can use the following solution for port forwarding in SageMaker Studio: https://github.com/aws-samples/sagemaker-ssh-helper
This solution uses AWS Systems Manager (SSM) to register a container in SSM, and then creates a session between your machine and the Session Manager service. You can then ssh into SageMaker notebook containers via the SSM session and use the Linux shell to configure SSH port forwarding.