Skip to content

Fix OASIS_AWS_LOCATION var#43

Merged
Ha-Ree merged 1 commit into
developfrom
fix/aws-location
May 27, 2026
Merged

Fix OASIS_AWS_LOCATION var#43
Ha-Ree merged 1 commit into
developfrom
fix/aws-location

Conversation

@sambles
Copy link
Copy Markdown
Contributor

@sambles sambles commented May 19, 2026

Fix the OASIS_AWS_LOCATION variable

Fixed the env OASIS_AWS_LOCATION=<location-path>, when set objects should be stored in bucket/<location-path>/filename


put() override — effective_subdir = location + subdir is passed to super().put(), which stores the file at DirFS(bucket_name/root_dir)/location/subdir/file. Since root_dir is typically "", this means S3 key = location/subdir/file. The return value from super() is os.path.join(location, subdir, filename) — the full bucket-relative key — which is exactly what the server's is_in_bucket() and CopyObject(Key=...) need.

get_storage_url() fix — same principle: the returned key includes the location prefix so the server stores a reference that the worker can later resolve.

get() needs no change — DirFileSystem rooted at bucket_name accepts bucket-relative keys like oasis/file.txt directly. Both worker-side re-fetches and server-provided references (which may already carry the Django location prefix) work without stripping.

root_dir / config_options unchanged — location and root_dir remain independent in storage config, so round-tripping is clean and existing deployments with location="" behave identically to before.

put() override — effective_subdir = location + subdir is passed to super().put(), which stores the file at
DirFS(bucket_name/root_dir)/location/subdir/file. Since root_dir is typically "", this means S3 key =
location/subdir/file. The return value from super() is os.path.join(location, subdir, filename) — the full
bucket-relative key — which is exactly what the server's is_in_bucket() and CopyObject(Key=...) need.

get_storage_url() fix — same principle: the returned key includes the location prefix so the server stores a
reference that the worker can later resolve.

get() needs no change — DirFileSystem rooted at bucket_name accepts bucket-relative keys like oasis/file.txt
directly. Both worker-side re-fetches and server-provided references (which may already carry the Django location
prefix) work without stripping.

root_dir / config_options unchanged — location and root_dir remain independent in storage config, so round-tripping
is clean and existing deployments with location="" behave identically to before.
@sambles sambles linked an issue May 19, 2026 that may be closed by this pull request
@sambles sambles added the bug Something isn't working label May 19, 2026
@sambles sambles self-assigned this May 19, 2026
@sambles sambles requested a review from Ha-Ree May 19, 2026 14:42
@sambles sambles moved this to Waiting for Review in Oasis Dev Team Tasks May 19, 2026
@Ha-Ree Ha-Ree merged commit 158b037 into develop May 27, 2026
6 of 10 checks passed
@github-project-automation github-project-automation Bot moved this from Waiting for Review to Done in Oasis Dev Team Tasks May 27, 2026
This was referenced May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OASIS_AWS_LOCATION is not working

3 participants