Skip to content

fix(async-upload): scope S3 downloads to directory prefix - #3066

Open
immanuwell wants to merge 1 commit into
kubeflow:mainfrom
immanuwell:fix/async-upload-s3-directory-prefix
Open

fix(async-upload): scope S3 downloads to directory prefix#3066
immanuwell wants to merge 1 commit into
kubeflow:mainfrom
immanuwell:fix/async-upload-s3-directory-prefix

Conversation

@immanuwell

@immanuwell immanuwell commented Aug 9, 2026

Copy link
Copy Markdown
Member

Description

S3 treats Prefix as a raw string. With my-model, a bucket containing my-model/model.onnx and my-model-backup/unrelated.bin returns both
The second path lands outside the staging dir, pretty easy to hit in shared buckets

This adds the trailing / for directory listings. Keys already ending in / stay unchanged.

How Has This Been Tested?

Repro:

  1. Add the two keys above to MinIO.
  2. Run the job with MODEL_SYNC_SOURCE_AWS_KEY=my-model.
  3. Before this fix both objects are downloaded, now only my-model/model.onnx is.

Passed all 55 async upload unit tests, make build/compile, make lint, and make vet
A real MinIO check passed too

Broad make test was also run, but unrelated MySQL testcontainers timed out on startup

Merge criteria:

  • All commits are signed off.
  • The commit has a meaningful message.
  • Automated tests are included.
  • The change was manually tested with MinIO.
  • Code follows the contribution guidelines.

Assisted-by: Codex
Signed-off-by: immanuwell <pchpr.00@list.ru>
@google-oss-prow
google-oss-prow Bot requested review from chambridge and fege August 9, 2026 11:26
@google-oss-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tarilabs for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment


bucket_name = config.bucket
prefix = config.key
prefix = config.key if config.key.endswith("/") else f"{config.key}/"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the PR, @immanuwell.

One question though, what happens if config.key were my-model/model.onnx? I believe that would work today, but it would break after this change because it would become my-model/model.onnx/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants