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

Add repodata config to channel #530

Conversation

mariusvniekerk
Copy link
Contributor

@mariusvniekerk mariusvniekerk commented Feb 15, 2024

This builds on some of the idea of #420

When fetching from certain channels it would be handy to disable some of the repodata methods that are known to be expensive / non-functional.

This is particularly true for artifactory where the HEAD request for the .bz2 repodata will eager compress the contents and not cache it. :(

Idea is that in downstream tools like pixi a user can define their channel and add some of these options in

channels = [
   { base_url = "https://somehost/channel", repodata_options = { bz2_enabled = False }}
]

… if repodata gets fetched using bz2/ zstd / other options directly from the channel.
Copy link
Collaborator

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Im a bit on the fence if adding this to channel makes sense responsibility wise. It makes sense when fetching repodata but its used in many more places were it doesnt make sense.

Let me mull it over a little.

pub repodata_options: Option<ChannelRepodataConfig>,
}

fn _serde_is_true(value: &bool) -> bool {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefixing with _ would mean its unused. I assume you want to make it private to the module, if you dont add "pub" that should be fine.

@baszalmstra
Copy link
Collaborator

I have been thinking about this and I think we need to alter the design a little bit. I think we need to split this functionality into two: Channel and FetchChannel (or whatever, naming is hard). The Channel only contains information about a url. The FetchChannel struct contains a Channel and extra metata information needed for fetching the channel's repodata. You should be able to construct a FetchChannel directly from a Channel with default values. And fetch_repodata function should accept a FetchChannel.

In pixi we can then change some of the logic to work with FetchChannel instead of Channel.

@baszalmstra baszalmstra added needs-design Needs discussion, investigation, or design and removed needs-decision Undecided if this should be done labels Feb 29, 2024
@baszalmstra
Copy link
Collaborator

With the new Gateway API, it is now possible to set configuration per channel.

Im closing this, feel free to reopen if you think this PR still adds more value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-design Needs discussion, investigation, or design
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants