Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy Multipart Upload for Azure Blob Storage #10531

Merged
merged 17 commits into from
Dec 8, 2023

Conversation

gabrielfu
Copy link
Collaborator

@gabrielfu gabrielfu commented Nov 29, 2023

🛠 DevTools 🛠

Open in GitHub Codespaces

Install mlflow from this PR

pip install git+https://github.com/mlflow/mlflow.git@refs/pull/10531/merge

Checkout with GitHub CLI

gh pr checkout 10531

Related Issues/PRs

#xxx

What changes are proposed in this pull request?

Implement proxy multipart upload for Azure Blob Storage

Example:

mlflow ui --artifacts-destination wasbs://[email protected]
import os
import mlflow
from mlflow.store.artifact.http_artifact_repo import HttpArtifactRepository

os.environ["MLFLOW_MULTIPART_UPLOAD_MINIMUM_FILE_SIZE"] = str(5 * 1024**2)
os.environ["MLFLOW_MULTIPART_UPLOAD_CHUNK_SIZE"] = str(5 * 1024**2)

mlflow.set_tracking_uri("http://127.0.0.1:5000")
artifact_uri = mlflow.get_artifact_uri()
repo = mlflow.artifacts.get_artifact_repository(artifact_uri)
assert isinstance(repo, HttpArtifactRepository)
repo._try_multipart_upload("test.file", "my-folder")

image

How is this PR tested?

  • Existing unit/integration tests
  • New unit/integration tests
  • Manual tests

Does this PR require documentation update?

  • No. You can skip the rest of this section.
  • Yes. I've updated:
    • Examples
    • API references
    • Instructions

Release Notes

Is this a user-facing change?

  • No. You can skip the rest of this section.
  • Yes. Give a description of this change to be included in the release notes for MLflow users.

Implement proxy multipart upload for Azure Blob Storage

What component(s), interfaces, languages, and integrations does this PR affect?

Components

  • area/artifacts: Artifact stores and artifact logging
  • area/build: Build and test infrastructure for MLflow
  • area/docs: MLflow documentation pages
  • area/examples: Example code
  • area/gateway: AI Gateway service, Gateway client APIs, third-party Gateway integrations
  • area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • area/models: MLmodel format, model serialization/deserialization, flavors
  • area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • area/projects: MLproject format, project running backends
  • area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • area/server-infra: MLflow Tracking server backend
  • area/tracking: Tracking Service, tracking client APIs, autologging

Interface

  • area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • area/windows: Windows support

Language

  • language/r: R APIs and clients
  • language/java: Java APIs and clients
  • language/new: Proposals for new client languages

Integrations

  • integrations/azure: Azure and Azure ML integrations
  • integrations/sagemaker: SageMaker integrations
  • integrations/databricks: Databricks integrations

How should the PR be classified in the release notes? Choose one:

  • rn/none - No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" section
  • rn/breaking-change - The PR will be mentioned in the "Breaking Changes" section
  • rn/feature - A new user-facing feature worth mentioning in the release notes
  • rn/bug-fix - A user-facing bug fix worth mentioning in the release notes
  • rn/documentation - A user-facing documentation change worth mentioning in the release notes

Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Copy link

github-actions bot commented Nov 29, 2023

Documentation preview for 223f7b1 will be available here when this CircleCI job completes successfully.

More info

@github-actions github-actions bot added area/artifacts Artifact stores and artifact logging rn/feature Mention under Features in Changelogs. labels Nov 29, 2023
@gabrielfu gabrielfu requested a review from harupy November 29, 2023 09:04
Signed-off-by: Gabriel Fu <[email protected]>
@gabrielfu gabrielfu removed the request for review from harupy November 29, 2023 09:11
@gabrielfu gabrielfu changed the title Proxy Multipart Upload for Azure Blob Storage [DRAFT] Proxy Multipart Upload for Azure Blob Storage Nov 29, 2023
@gabrielfu gabrielfu changed the title [DRAFT] Proxy Multipart Upload for Azure Blob Storage Proxy Multipart Upload for Azure Blob Storage Nov 29, 2023
@gabrielfu gabrielfu requested a review from harupy November 29, 2023 09:16
# Conflicts:
#	mlflow/store/artifact/http_artifact_repo.py

Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
Signed-off-by: Gabriel Fu <[email protected]>
blob_client.commit_block_list(block_ids)

def abort_multipart_upload(self, local_file, upload_id, artifact_path=None):
# There is no way to delete uncommitted blocks in Azure Blob Storage.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great comment

blob_name=dest_path,
account_key=self.client.credential.account_key,
permission=BlobSasPermissions(read=True, write=True),
expiry=datetime.datetime.utcnow() + datetime.timedelta(hours=6),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about the expiration time - is this something that Azure recommends for duration?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I misread the documentation somewhere. Let me change to 1 hour to align with our s3 & gcs impl

Copy link
Member

@BenWilson2 BenWilson2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for knocking this out @gabrielfu :D

Signed-off-by: Gabriel Fu <[email protected]>

Signed-off-by: Gabriel Fu <[email protected]>
@BenWilson2
Copy link
Member

@gabrielfu Let's wait until after the 2.9 release to merge this :D

@gabrielfu
Copy link
Collaborator Author

@gabrielfu Let's wait until after the 2.9 release to merge this :D

Sure!

@gabrielfu gabrielfu merged commit 874802f into mlflow:master Dec 8, 2023
@gabrielfu gabrielfu deleted the mpu-azure-abs branch December 8, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/artifacts Artifact stores and artifact logging rn/feature Mention under Features in Changelogs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants