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
Enables FilesystemExporter to incrementally export rpms #3511
Conversation
503d304
to
f037333
Compare
Also check out Katello/katello#10417 (comment) on how this PR works with katello |
This PR currently supports I think we should always accept (Also - we prob need some error-checking at the view-level, you should not be able to specify a delta that "goes back in time" - once we have start and end repo-version, we should insure that start < end...) The other thing I'm noting is, if I start with a repo, remove some RPMs to create version-N, add them back in to create version-M, and export start_repository_version=N/repository_version=M, I get an empty export. I expect somewhere in the "find the content for a version" is making An Assumption that may not be valid. Testing/investigation continues. |
Interesting - Katello only uses publication. Wonder why
I wonder if we should limit the scope of this PR to only publication and start_publication and leave the version compare to a different PR? Katello really only needs this combination to work. That would potentially mean small set of changes. @sjha4 @ianballou - Do you guys know if we create publications every time with publish a Content View. @ggainey is proposing using start-publication for incremental
I will look into this case |
We may not create "new" publications if our contents_changed dynflow middleware detects nothing has changed in which case we reuse the previous version's publication. Every repo version however will have a publication URL which could be used here I think with the catch that the publication may not be unique between versions. |
{
"pulp_href": "/pulp/api/v3/exporters/core/filesystem/8f7a1139-5153-4e54-9e9d-994152379d01/",
"pulp_created": "2023-01-20T18:27:54.693496Z",
"name": "open_Export-Library-SYNCABLE_2.0-67",
"path": "/var/lib/pulp/exports/open/Export-Library-SYNCABLE/2.0/2023-01-20T18-27-51-00-00/custom/goals/auto",
"method": "hardlink"
}
$ curl --cert /home/vagrant/foreman-certs/client_cert.pem --key /home/vagrant/foreman-certs/client_key.pem \
-X POST -H 'Content-Type: application/json' \
-d '{"publication":"/pulp/api/v3/publications/rpm/rpm/62b3af46-d059-4d2b-a898-1dd7955ec531/", "start_repository_version":"/pulp/api/v3/repositories/rpm/rpm/6c98c027-53ff-440e-a5ce-ba68cc0833cc/versions/4/"}' \
https://centos8-katello-devel-stable.example.com/pulp/api/v3/exporters/core/filesystem/8f7a1139-5153-4e54-9e9d-994152379d01/exports/ Works well -
|
I'm still digging into this myself, but it sounds like Katello only really needs to give the start repo version and the end publication to get what we want -- if that's the case then I'm with Partha in that perhaps the start publication could be added later. I'd be curious to hear though if Pulp folks think we might be missing something and do need a start publication. |
Can we phrase this feature around "content" instead of "rpms"? |
I think only Yum/File repos are supported for FS Exporter at this point. That being said where do you see this PR being specific to rpms? |
I meant the docs and changelog. Sorry for not being specific enough. Thank you for making the feature agnostic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor wordsmithing, and one bugfix :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some formatting and what i meant by agnostic in the changelog...
@parthaa Can you rebase and squash commits? |
pulpcore/app/tasks/export.py
Outdated
@@ -138,8 +144,11 @@ def _export_publication_to_file_system( | |||
"content_artifact", "content_artifact__artifact" | |||
).iterator(): | |||
# Artifact isn't guaranteed to be present | |||
if pa.content_artifact.artifact: | |||
if pa.content_artifact.artifact and ( | |||
start_repo_version is None or pa.content_artifact in difference_content_artifacts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
difference_content_artifacts
appears to be a queryset, do we know that this isn't going to be re-evaluated every time in a loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats a good point I am curious about that :). How would I be able to check if its getting re evaluated ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could explicitly cast to a set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
c18c8a8
to
207237e
Compare
d5373bc
to
81873ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like all current comments are responded to. Tested with an RPM repo in my test env, worked like a champ. Looks good to me!
Tested it here locally with Katello and was able to export incrementally and import without any issues Export: [root@centos8-stream-katello-nightly ~]# hammer content-export incremental version --format=syncable --organization-id 1 --id 3
[.................................................................................................................................................................] [100%]
Generated /var/lib/pulp/exports/Default_Organization/view/2.0/2023-01-31T20-48-04-00-00/metadata.json Import: [root@centos8-stream-katello-nightly ~]# ll /var/lib/pulp/imports/2023-01-31T20-48-04-00-00/^C
[root@centos8-stream-katello-nightly ~]# hammer content-import version --organization-id 4 --path /var/lib/pulp/imports/2023-01-31T20-48-04-00-00/
[.................................................................................................................................................................] [100%] |
52278ff
to
82b921c
Compare
@parthaa OK, please rebase this on top of current-main to address the lint-issues, and resubmit. |
It accepts a start repository version and calculates what content artifacts need to get copied over. fixes pulp#3413 lint-fixes Addressed PR Comments
82b921c
to
ed537a3
Compare
Backport to 3.21: 💚 backport PR created✅ Backport PR branch: Backported as #3546 🤖 @patchback |
Backport to 3.22: 💚 backport PR created✅ Backport PR branch: Backported as #3547 🤖 @patchback |
@ggainey How far should this go back, is 3.18 possible? |
Backport to 3.18: 💔 cherry-picking failed — conflicts found❌ Failed to cleanly apply 70b1eb0 on top of patchback/backports/3.18/70b1eb04a4349bedfa6781c8598b53a99f9a63a1/pr-3511 Backporting merged PR #3511 into main
🤖 @patchback |
@parthaa It looks like there is a request for this to go into 3.18 (6.12.z), could you investigate which other patches are necessary to backport it? |
It accepts a start repository version and calculates what content artifacts need to get copied over.