-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixes #32891 - Add feature to enable new tasking system and enable it by default #203
Conversation
NOTE: While the default ( |
8e3dd6a
to
e444885
Compare
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do |
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 is somewhat of a hack. diffsettings
will show the difference relative to default settings for Django, so pulpcore's USE_NEW_WORKER_TYPE
setting (introduced with v3.13) should be visible here.
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.
Is there a reason not to just assert the contents of settings.py
?
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 think you can also use dynaconf to dump the settings. I think that won't break when Pulp switches its default.
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.
Is there a reason not to just assert the contents of
settings.py
?
To me, reading the running configuration of the application seems closer to testing the true, desired outcome vs. reading the contents of a file. For that reason I see it as a better approach in an "acceptance" test.
With that said, we could easily test both and treat one as an in memory test for the currently running process and the other as a test of the persistent configuration.
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 think you can also use dynaconf to dump the settings. I think that won't break when Pulp switches its default.
I'll have to look into how to do this
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 test looks good enough for now. Or just yank it since we test this in the unit tests and we are asserting the behaviors we expect anyway. That's my TLDR way of saying, let's not hold this up on that sorta detail.
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'll have to look into how to do this
FYI: sosreport has this:
https://github.com/sosreport/sos/blob/c7d3644c0c64e9e5439806250592a55c8e2de26f/sos/report/plugins/pulpcore.py#L99-L102
Should this be rebased on #202? |
manifests/init.pp
Outdated
@@ -197,6 +202,7 @@ | |||
Pulpcore::ChecksumTypes $allowed_content_checksums = ['sha224', 'sha256', 'sha384', 'sha512'], | |||
String[1] $remote_user_environ_name = 'HTTP_REMOTE_USER', | |||
Integer[0] $worker_count = min(8, $facts['processors']['count']), | |||
Boolean $use_legacy_tasking_system = true, |
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.
To avoid the ole legacy
wording, perhaps we name it use_postgresql_tasking_system
or `use_rq_tasking_system.
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.
or an Enum of ['rq', 'postgresql']
or ['rq', 'new']
?
If I understand pulp/pulpcore@0e1c629 correctly, there are two changes in that commit:
- add a script ("entrypoint" in Python lingo)
pulpcore-worker
which should be used instead ofrq
- allow for two different tasking systems: old RQ and new PostgreSQL based
So switching to the old one doesn't require us to switch to calling rq
directly (like this PR does right now) and I think this is actually officially unsupported by Pulpcore (or should be unsupported)
And if you look at the commit in pulp_installer
(pulp/pulp_installer@39a8869) they switch to the new binary for all 3.13+ installs, unrelated to the used tasking system
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 went with use_rq_tasking_system
for now but I'm open to other ideas.
Some thoughts: at a base level it would be nice for this module to be consistent with the setting name in pulpcore, but USE_NEW_WORKER_TYPE
has a problem in that the postgresql tasking system won't be "new" forever, and something that is described as "new" could be perceived by users as being unstable, unsafe, etc.
I like being specific and descriptive about what technology is actually used, so Enum['rq', 'postgresql']
is appealing for that reason, but that could be more difficult for foreman-installer
users ("what were the options again? I need to find that in the docs somewhere") vs. a simple boolean which can be set true or false.
So I went with use_rq_tasking_system
, added a note in the parameter documentation that this refers to the older rq workers tasking system and the alternative is the postgresql tasking system introduced in pulpcore 3.13.
When we later reach a point where use_rq_tasking_system
is false by default, this seems particularly intuitive as an interface to allow users to opt-in to use the older tasking system instead.
To recap, the first big question is whether we take a progressive enhancement, keep supporting Pulp 3.11 and 3.13+ or just support 3.13+ only with the new wrapper. #202 takes the latter approach. I lean towards the 3.13+ only approach, there are enough changes coming that I think its safe to cut off 3.11 from the main branch, and create a stable release branch if we need to backport to supporting 3.11 for any reason. The big changes, supporting new tasking system, content caching are only applicable to 3.13+ and there is no plan to backport any of those so I think its safe for our module to look forward only. |
e444885
to
1027dbf
Compare
@ehelms @ekohl @evgeni thanks for all comments and feedback! I've updated this with the following changes:
|
Just to throw it out there, we could introduce the same wrapper in 3.11 if we really cared about this. |
Given the current plans around pulpcore upgrades, I don't think we need to invest in 3.11 compatibility too long anymore? |
A question on how this will play out when we decide to flip the switch and use the new (PostgreSQL) system: Right now this is a direct parameter to the class ( |
The case I can imagine is that we have update the pulpcore repo definition in katello-repos.rpm. So the user runs:
Now what the user should have done:
By shipping the wrapper in 3.11, at least the service will continue to start up. |
Migrations only run once. There's a file (IIRC |
Ooooh, you mean for users already on 4.1 that is using 3.11? Fair. But at the same time, this will only happen once? |
Yes, but it's certainly a case I worry about. We should very carefully approach it to make it a smooth and painless migration. |
You can now rebase this on master |
1027dbf
to
a2a9d61
Compare
Rebased |
a2a9d61
to
2cb68a8
Compare
Current implementation is dealing with this issue when enabling the new tasking system:
|
445fb38
to
e9424f9
Compare
To my knowledge, this is now ready to go, as it provides the agreed upon design and has complete test coverage. Requesting a fresh round of reviews. Thanks for all the feedback and testing so far. |
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'll let the others do the nitpicks, looks good to me!
e9424f9
to
df41d0f
Compare
This introduces a new parameter `use_rq_tasking_system` with default value false that configures pulpcore to use the same RQ worker tasking system as before. When false, it instead configures pulpcore to use the newer PostgreSQL tasking system introduced in pulpcore version 3.14. Acceptance tests are included to ensure users can switch between either worker type.
df41d0f
to
4ccdb94
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.
Updates look good, thanks @wbclark for addressing
Requires theforeman/puppet-pulpcore#203 (cherry picked from commit baa0e9c)
Requires theforeman/puppet-pulpcore#203 (cherry picked from commit baa0e9c)
This introduces a new parameter
use_legacy_tasking_system
whichdefaults to true and configures the application the same as before.
When set to false, pulpcore is configured with the new tasking system
instead. Acceptance tests are included to ensure that users can switch
between the two tasking systems. This is backwards compatible with
Pulpcore versions older than 3.13 ONLY when configured to use the
legacy tasking system. The newer tasking system requires Pulpcore
version >= 3.13.