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

Refactor/use oras and organize #19

Merged

Conversation

vsoch
Copy link
Contributor

@vsoch vsoch commented Feb 2, 2023

Also opening this one for comparison - it looks like I might have based this original branch on the main one for conda_oci_mirror!

I am adding a global oras client, that way we can ensure checking
credentials once (and possibly defaulting to a dry run) and using
the client across different types of pushes (repo and packages).
I also added a "Pusher" class to oras since the actions of creating
layers and setting defaults were used between the two places. I
am currently maintaining the relatively flat structure of the
module, however this could be refactored in the future if needed
(I usually prefer to have a main module with the core functionality
but I will not push this preference on others! I need to next
refactor the cache_packages.py and then add some testing.

Signed-off-by: vsoch <[email protected]>
this test needs to be extended but for now is setup to
do some push and some pull and validate.

Signed-off-by: vsoch <[email protected]>
the previous subdir_accessor.py had functions to get info, the index.json,
and the package (archive) when given a specific URI. These are now added
to the PackageRepo, meaning this class can now take a registry URI (host
and username) on init so it functions similarity to the previous class.
To be more consistent across the cli and classes, we now take the full
registry <host>/<username> as the registry argument instead of separating
them. It also did not make sense for the Mirror class to accept multiple
channels when we are generally just taking one. Finally, the pull/push
classes now are done with parallel tasks, and the structure of tasks
is more consistent. There are tests for these new functions, and
the upload of a latest for a package is removed. This means when
we want to download latest, we determine the latest based on
sorted versions and build numbers

Signed-off-by: vsoch <[email protected]>
This file includes yanked packages, so we use it to do the mirror,
although we upload and honor the current repodata.json. In addition,
I am adding a helper script to run the registry so the developer
does not need to remember / copy paste from the readme, and support
for running in serial to the other mirror functions to be consistent!

Signed-off-by: vsoch <[email protected]>
TODO.md Outdated

### High Priority

#### Support the new .conda package format.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be good now?! :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just removed! Sorry forgot to check the TODOs before I opened!

It would be good to get this merged soon - since I've rebased the slow_upload branch locally I'm not sure I can do it again without messing up the git history here - so if/when we merge I can create a fresh clone/branch to work off of.

@wolfv wolfv merged commit d63427e into channel-mirrors:main Feb 3, 2023
@wolfv
Copy link
Contributor

wolfv commented Feb 3, 2023

merged!

@wolfv
Copy link
Contributor

wolfv commented Feb 3, 2023

I should update the github action to use this vs. the old slow upload branch. I'll do that later today and 🙏 that it works :) but it's in a much better state with tests now, so I am very confident!

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