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
Sync from a mirror list feed if provided #1690
Conversation
|
Attached issue: https://pulp.plan.io/issues/6225 |
99143c0
to
3b76bb7
Compare
3b76bb7
to
7706609
Compare
|
@lubosmj , please, re-push (git commit --amend, git push -f ...), so the required check for your PR passes. We moved to travis-ci.com and your PR hasn't been tested there yet. Thanks. |
7706609
to
ea53264
Compare
|
I converted this to a draft PR because it is not possible to call |
ead64bd
to
7405a0e
Compare
pulp_rpm/app/tasks/synchronizing.py
Outdated
| await self.put(dc) | ||
|
|
||
| missing_type = set(PACKAGE_REPODATA) - main_types | ||
| if missing_type: |
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.
if i understand correctly how mirrolist works is - is looks for the first available mirror and tries it. If there is some issue with the repodata it just fails. So once the download starts from a url there is not way back.
There are some BZ opened around this behaviour and we agreed that amatej will inform us once they fix this( complicated change)
https://bugzilla.redhat.com/show_bug.cgi?id=1819188
https://bugzilla.redhat.com/show_bug.cgi?id=1819188
I think we should follow same logic as currently mirrorlist has implemented. Thoughts?
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.
For the initial feature I think we should do the very simplest thing possible. I believe that would be:
- Use the repodata from the very first available mirror that will serve it, and try to fetch all content from that mirror exclusively. If anything goes wrong in fetching content fail (just like Pulp normally would in cases where there is no mirrorlist).
- Do not try to sort mirrors based on how fast or close they are
- Do not try to fetch content from multiple mirrors
We can improve (2) and (3) later, but having even basic mirrorlist support is still a useful feature for users because we currently do not support it.
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.
After rpm meeting we decided that for now we would want to follow the current implementation of mirrorlist( aka fail if the the first fetched url fails during download)
In the future we could add this kind of enhancement where other urls would be tried if previous fail, but for that we'd rather implement a mirrorlist downloader to be more flexibile
|
@lubosmj i don't think you handled case for treeinfo. It will always be ignored https://github.com/pulp/pulp_rpm/blob/master/pulp_rpm/app/kickstart/treeinfo.py#L21 |
ff62f86
to
12826df
Compare
caab6cd
to
d10c210
Compare
| with open(result.path) as mirror_list_file: | ||
| for mirror in mirror_list_file: | ||
| match = re.match(url_pattern, mirror) | ||
| if match and repodata_exists(remote, match.group(2)): |
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.
i don't think we should check whether the repodata for the url exists, i think we should just parse the file and add the urls to the list of feeds
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.
@bmbouter i don't have a strong opinion on this approach, thoughts?
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.
I was thinking we would do no parsing and try to use the URL blind. If the resultant works it works, if it fails try the next one.
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.
there have been some discussion around what should be the behaviour and this is what we agreed on: 1) identify whether this is a mirrorlist 2) find url that matches the regexp and check whether it has repomd.xml, once such url has been found return it and use it in the the sync, no need to parse other urls 3) if further issues will appear during the sync with that url just fail the sync
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.
for mirror in mirror_list_file:
match = re.match(url_pattern, mirror)
if match and repodata_exists(remote, match.group(2)):
mirror_list_feed.append(match.group(2))
break
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 can also get rid of the list and return the url instead
.travis/post_before_script.sh
Outdated
| REPLACE_ORIGIN="sed -i -E 's/https?:\/\/.+?:[0-9]+\/fixtures\//${FIXTURE_ORIGIN}/g' /usr/share/nginx/html/fixtures/rpm-mirrorlist-bad" | ||
| docker exec -ti ${FIXTURES_CONTAINER_ID} sh -c "${REPLACE_ORIGIN}" | ||
| fi |
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.
I have a couple PRs that should set the base url in mirror lists:
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.
This should enable it: #1750
ffd583b
to
3795a23
Compare
3795a23
to
cafc129
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.
Thank you for all your work 🍰
ref #6225