Store MLflow Artifacts in S3

You can configure MLflow to store experiment artifacts such as models, images, and logs in an Amazon S3 bucket for scalable and durable storage. This is especially useful in distributed environments where multiple users or systems access the same artifacts.

Access S3 Object Using AWS CLI

Follow these steps to access, download, or view an image stored in S3, for example: s3://mlflow-artifacts-hv/my-folder/image.png.

  1. Verify AWS CLI installation
Bash
Copy
  1. Configure AWS CLI (if not already).
Bash
Copy

Provide the following details when prompted:

  • AWS Access Key ID
  • AWS Secret Access Key
  • Default Region (e.g., us-east-1)
  1. List files in S3 path.
Bash
Copy
  1. Download image from S3.
Bash
Copy

This command downloads the image to your current working directory.

  1. View the image.
Bash
Copy
  1. (Optional) Generate a pre-signed URL.

If the bucket is private, you can generate a temporary URL to access it in a browser.

Bash
Copy

This creates a secure URL valid for 1 hour (3600 seconds).

Example Use Cases

TaskCommand
List bucketaws s3 ls s3://mlflow-artifacts-hv/
List folderaws s3 ls s3://mlflow-artifacts-hv/my-folder/
Download imageaws s3 cp s3://mlflow-artifacts-hv/my-folder/image.png .
Generate public URLaws s3 presign s3://mlflow-artifacts-hv/yourfile

The below example shows how to store and access MLflow artifacts in S3 using the AWS CLI.

Bash
Copy
Bash
Copy
Bash
Copy
Bash
Copy
Bash
Copy
Bash
Copy
Bash
Copy
Bash
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated