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

feat: Add S3 support #1008

Open
wants to merge 81 commits into
base: main
Choose a base branch
from
Open

feat: Add S3 support #1008

wants to merge 81 commits into from

Conversation

pavelzw
Copy link
Contributor

@pavelzw pavelzw commented Jan 2, 2025

Description

xref #960

#960 (comment)

crates/rattler_networking/src/s3_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/s3_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/s3_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/s3_middleware.rs Outdated Show resolved Hide resolved
Copy link
Contributor Author

Choose a reason for hiding this comment

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

a current limitation is that we need to have one shared credential for each bucket we access with this setup.
we could also make the config-file and profile channel-dependent but i think as a first version, this is okay, wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

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

If you would add specific config per channel what would that look like? Does it change the API much?

Copy link

Choose a reason for hiding this comment

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

we could also make the config-file and profile channel-dependent

I think this comment was based on an outdated version of the code. Still, we do not support channel-specific configuration yet. Did you already think about an API @pavelzw?

Copy link
Contributor Author

@pavelzw pavelzw Jan 14, 2025

Choose a reason for hiding this comment

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

from the API side, i'm thinking of something like

#[derive(Clone, Debug)]
pub struct S3 {
    auth_storage: AuthenticationStorage,
    default_config: S3Config,
    // prefix -> config map, overrides default_config
    channel_config: HashMap<String, S3Config>,
    expiration: std::time::Duration,
}

In create_s3_client we would gather the config for the respective bucket or falling back to the default config.

It can be configured in pixi.toml (or global config respectively)

[s3-config]
endpoint-url = "https://s3.aws..."
region = "eu-central-1"
force-path-style = false

[channel."s3://my-bucket".s3-config]
endpoint-url = "https://localhost:9000"
region = "eu-west-1"
force-path-style = true

From a pixi.toml perspective, this should be backwards compatible so I think it's fine to not implement this yet but only if the need arises.

@pavelzw pavelzw marked this pull request as ready for review January 2, 2025 19:10
@pavelzw pavelzw marked this pull request as draft January 3, 2025 11:38
@pavelzw pavelzw requested a review from baszalmstra January 16, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants