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 mirror handling and OCI mirror type #553

Merged
merged 12 commits into from
Mar 14, 2024

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Mar 4, 2024

This is the start of the "mirror" implemnetation that would

  • be able to handle multiple mirrors of a single channel
  • reroute a channel to an "internal" mirror (for on-prem deployments)
  • handle OCI channels to pull data from

@wolfv
Copy link
Contributor Author

wolfv commented Mar 6, 2024

Looks like some pushed artifacts have the wrong mediaType / no mediaType: pthread-stubs (https://github.com/orgs/channel-mirrors/packages/container/conda-forge%2Fosx-arm64%2Fpthread-stubs/23610821?tag=0.4-h27ca646_1001)

@wolfv wolfv changed the title work on mirror functionality / oci mirror [skip ci] feat: add mirror handling and OCI mirror type Mar 8, 2024
@wolfv wolfv requested a review from baszalmstra March 8, 2024 21:57
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.

I left a bunch of comments.

  • Would be nice if you can take a look at removing all unwraps or replacing them with expects.
  • I think the API for the MirrorState contains lots of values that are unused. It would also be nice to type it a little more. There are some implicit expectations in there now, like that the URL is sort of rewritten, but this is completely unclear from comments and/or types.
  • I think perhaps it would be nice to split this PR into two. One for the mirrors and one for OCI.

crates/rattler_networking/src/mirror_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/mirror_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/mirror_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/oci_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/oci_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/oci_middleware.rs Outdated Show resolved Hide resolved
crates/rattler_networking/src/oci_middleware.rs Outdated Show resolved Hide resolved
@wolfv
Copy link
Contributor Author

wolfv commented Mar 9, 2024

TODOs:

  • sort channel keys from long to short, so that both https://conda.anaconda.org and more specific https://conda.anaconda.org/conda-forge work.
  • add a "manifest" cache for OCI mirrors in order to only download the manifest once (instead of three times for checking jlap, zstd and bz2 existence (this one is deferred)
  • fix issues on the actual OCI registry

I think for this PR we shoudl fix the first item, but defer the other ones (and fix them in a little while when the OCI registry itself is fully functional).

crates/rattler_networking/Cargo.toml Outdated Show resolved Hide resolved
crates/rattler_networking/Cargo.toml Outdated Show resolved Hide resolved
@baszalmstra baszalmstra enabled auto-merge (squash) March 14, 2024 15:57
@baszalmstra baszalmstra merged commit e3784e0 into conda:main Mar 14, 2024
14 checks passed
@baszalmstra baszalmstra mentioned this pull request Mar 12, 2024
@wolfv wolfv deleted the channel-mirrors branch March 14, 2024 16:39
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.

2 participants