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 support for synchronizing oracle repos using ULN #1896

Merged
merged 1 commit into from Mar 29, 2021

Conversation

ThikaXer
Copy link

@ThikaXer ThikaXer commented Nov 30, 2020

This PR relates to the following PR in pulpcore:
Add headers option is aiohttp client session #1041

pulp/pulpcore#1041

@pulpbot
Copy link
Member

pulpbot commented Nov 30, 2020

WARNING!!! This PR is not attached to an issue. In most cases this is not advisable. Please see our PR docs for more information about how to attach this PR to an issue.

@@ -51,6 +51,12 @@ class RpmRemote(Remote):
TYPE = "rpm"
sles_auth_token = models.CharField(max_length=512, null=True)

uln_user = models.CharField(max_length=512, null=True)

uln_pwd = models.CharField(max_length=512, null=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed there are username and password fields in the Remote base class from pulpcore.
My question is if those are in use for anything specific, or could we repurpose them for this change (instead of adding uln_user and uln_pwd)?

Also, why are they part of the Remote base class? Are they really needed for every type of remote in every plugin?!

Copy link
Contributor

@quba42 quba42 Jan 27, 2021

Choose a reason for hiding this comment

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

@dkliban I wonder if you could give some input on this question. Given I just watched a headers field being added to the remote base class, I guess this base class contains anything that might be of interest to more than one type of remote. I presume the existing username and password fields are intended in the same way, and we could have users use those instead of adding uln_user and uln_pwd. Is that right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@quba42 quba42 left a comment

Choose a reason for hiding this comment

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

Just some thoughts on the server URL fields. These are not meant to be set in stone, but a starting point for discussion.

pulp_rpm/app/models/repository.py Outdated Show resolved Hide resolved
pulp_rpm/app/serializers/repository.py Show resolved Hide resolved
pulp_rpm/app/downloaders.py Outdated Show resolved Hide resolved
pulp_rpm/app/downloaders.py Outdated Show resolved Hide resolved
pulp_rpm/app/downloaders.py Outdated Show resolved Hide resolved
pulp_rpm/app/downloaders.py Outdated Show resolved Hide resolved
pulp_rpm/app/downloaders.py Show resolved Hide resolved
@ThikaXer ThikaXer marked this pull request as ready for review December 4, 2020 10:33
@quba42
Copy link
Contributor

quba42 commented Mar 4, 2021

@bmbouter Thanks for the hint, it turns out I forgot to pass on **kwargs to a super().get_downloader call.

@quba42 quba42 force-pushed the uln branch 2 times, most recently from 38741fb to 9f1facd Compare March 9, 2021 08:36

TYPE = "uln"
uln_server_base_url = models.CharField(
max_length=512, default="https://linux-update.oracle.com/"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is currently the final item on the list of things I think I could improve about this PR:

I feel a bit uncomfortable defaulting to some Oracle URL right in the DB. I could just not do that, make uln_server_base_url a required field in the serializer, and leave everything to the user, but that would not be very user friendly. I think 99.9% of the time, users are going to want to use a single instance wide uln_server_base_url, and based on my research (Oracle is the only one I can find in the wild using ULN for content delivery) 99.8% of the time the value will be https://linux-update.oracle.com/.

So I have two questions (@goosemania, @bmbouter, or any one else with relevant knowledge):

  1. Is there some existing mechanism to let users configure instance wide default values?
  2. Is there somewhere else I could default to this value other than directly within the DB?

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps I could make it a django setting?
https://docs.pulpproject.org/pulpcore/settings.html#pulp-settings

Copy link
Contributor

Choose a reason for hiding this comment

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

Done.

@quba42 quba42 force-pushed the uln branch 3 times, most recently from b1dd52e to 48ec83c Compare March 18, 2021 17:04
@quba42
Copy link
Contributor

quba42 commented Mar 18, 2021

I have successfully retested the latest state locally.

@@ -0,0 +1 @@
Added the ability to synchronize Oracle ULN repositories.
Copy link
Member

Choose a reason for hiding this comment

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

I'd add here a note about new setting as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Amended.

@goosemania
Copy link
Member

Hey @quba42 , it looks good to me, thanks for all the improvements and for the unittests.

I think it's worth adding some docs around new configuration option and the new remote. What do you think?
It can be done in the follow up PR, not to delay merging this one even more.

Comment on lines +6 to +9
pulpcore>=3.10
PyGObject~=3.22
solv~=0.7.17
aiohttp_xmlrpc
Copy link
Member

Choose a reason for hiding this comment

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

@dralley , @jlsherrill, @evgeni , JFYI, when this is released (likely pulp_rpm 3.10), it will bump the pulpcore version requirement to 3.10, and also it adds a new dependency (in case @evgeni will need to build it for rpm installations).

Copy link
Member

Choose a reason for hiding this comment

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

I will have to, but thankfully we have tools to catch that.

Thanks for the ping tho :)

@goosemania
Copy link
Member

@quba42 , it would also be good if you could squash commits, so all those changes are never separated (especially the migration). Thanks

@quba42
Copy link
Contributor

quba42 commented Mar 19, 2021

I have squashed the commits and opened a follow on task for the documentation (https://pulp.plan.io/issues/8426).
Not sure why flake8 has suddenly changed it's linting verdict... I will look into this later.

@goosemania
Copy link
Member

goosemania commented Mar 19, 2021

It seems to be a new version of flake8-docstrings and pydocstyle.
I do not see this issue in other repos I checked, so I guess what they fixed now exposed the problem here.
Unrelated to your changes, let me fix it and you can rebase.

@goosemania
Copy link
Member

It seems to be a new version of flake8-docstrings and pydocstyle.
I do not see this issue in other repos I checked, so I guess what they fixed now exposed the problem here.
Unrelated to your changes, let me fix it and you can rebase.

#1959

@goosemania
Copy link
Member

It seems to be a new version of flake8-docstrings and pydocstyle.
I do not see this issue in other repos I checked, so I guess what they fixed now exposed the problem here.
Unrelated to your changes, let me fix it and you can rebase.

#1959

@quba42 , #1959 is merged, please rebase, so the linter passes. Thanks

@goosemania
Copy link
Member

@quba42 , thanks, it all looks good. I'm not approving now, so it is not merged.
We'll merge it after the release next week. The main reason to postpone this one is that you bump pulpcore version and there are some items we need to release which should be compatible with pulpcore 3.7.

fixes #7905
https://pulp.plan.io/issues/7905

Should also work for non-Oracle ULN repositories, tested using Oracle.
@goosemania
Copy link
Member

The failure is unrelated to the changes in the PR. The CI issue have been addressed separately, see #1963. Merging.

@goosemania goosemania merged commit 3157ad1 into pulp:master Mar 29, 2021
Copy link
Member

@goosemania goosemania left a comment

Choose a reason for hiding this comment

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

Great job, everyone!
Thanks

@bmbouter
Copy link
Member

Thank you all!

@quba42 quba42 deleted the uln branch April 1, 2021 10:59
@dralley
Copy link
Contributor

dralley commented Dec 1, 2021

@ThikaXer It looks like an aiohttp-xmlrpc change has broken this support. Any chance you could revisit?

#2186

This is the change that broke ULN: https://github.com/mosquito/aiohttp-xmlrpc/pull/48/files

@quba42
Copy link
Contributor

quba42 commented Dec 1, 2021

@m-bucher, @sbernhard, @Manisha15 One of us will need to "revisit" this issue.

@m-bucher
Copy link
Contributor

@dralley, @quba42, @Manisha15 I created a draft-PR, which incorporates the necessary changes: #2198
Feedback welcome on whether it should be split into multiple PRs/Tickets 😄

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.

None yet