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

Address issues of missing bucket_name in s3fs paths #673

Merged

Conversation

RobinHolzingerQC
Copy link
Contributor

@RobinHolzingerQC RobinHolzingerQC commented Nov 22, 2023

Motivation

The previous way of specifying paths for s3fs (not including the bucket_name) led to issues when using endpoint_url.

Changes

As paths in the format of <root_dir>/<subdir>/.../<file> are not officially supported by s3fs (see fsspec/s3fs#824), we are now using <bucket_name>/<root_dir>/<subdir>/.../<file>.
For that, we need a bucket_name config field.
def _bucket_map(...) is adjusted according so that every channel specification also includes the bucket_name

@RobinHolzingerQC RobinHolzingerQC changed the title fix: Address issues of missing bucket_name in s3fs paths fix: Address issues of missing bucket_name in s3fs paths Nov 22, 2023
@janjagusch janjagusch added the bug Something isn't working label Nov 22, 2023
@janjagusch janjagusch changed the title fix: Address issues of missing bucket_name in s3fs paths Address issues of missing bucket_name in s3fs paths Nov 22, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (76f3fda) 83.59% compared to head (f5c0022) 83.60%.
Report is 3 commits behind head on main.

Files Patch % Lines
quetz/pkgstores.py 75.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #673   +/-   ##
=======================================
  Coverage   83.59%   83.60%           
=======================================
  Files          79       79           
  Lines        6230     6233    +3     
=======================================
+ Hits         5208     5211    +3     
  Misses       1022     1022           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@@ -85,6 +86,8 @@ jobs:
S3_SECRET_KEY: ${{ secrets.s3_secret_key }}
S3_ENDPOINT: https://s3.sbg.cloud.ovh.net/
S3_REGION: sbg
S3_BUCKET_NAME: quetz
QUETZ_S3_BUCKET_NAME: quetz
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you brielfy elaborate what's the purpose of this env var?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As I found out with fsspec/s3fs#824, we need to specify the bucket_name in the paths for s3fs, we need to know how the bucket is called that we write to. Previously (at least for aws s3) this information could be encoded in S3_ENDPOINT, however, f3fs doesn't work with that (bucket cannot be encoded in URL). Therefore we need another variable explicitly stating the bucket_name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

But why do we need S3_BUCKET_NAME and QUETZ_S3_BUCKET_NAME?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already removed QUETZ_S3_BUCKET_NAME again, I just tested the QUETZ_ prefix to make sure that it wouldn't be mapped to S3_BUCKET_NAME in the tests (as the env variable was missing)

@janjagusch janjagusch marked this pull request as ready for review December 4, 2023 12:55
@janjagusch janjagusch merged commit b6e6f3f into mamba-org:main Dec 4, 2023
4 of 9 checks passed
@janjagusch
Copy link
Collaborator

The tests are failing because it's using the CI definition from the main branch.

@RobinHolzingerQC RobinHolzingerQC mentioned this pull request Dec 4, 2023
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants