-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #32891 - Support new tasking system and enable it by default
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.
- Loading branch information
Showing
5 changed files
with
277 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'initial configuration with newer postgresql tasking system' do | ||
certdir = '/etc/pulpcore-certs' | ||
|
||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'pulpcore': | ||
worker_count => 1, | ||
use_rq_tasking_system => false, | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe service('httpd') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-api') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-content') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-resource-manager') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-worker@1') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe port(443) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/status/", cacert: "#{certdir}/ca-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do | ||
its(:stdout) { is_expected.to match(/^USE_NEW_WORKER_TYPE = True/) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py rq info -c pulpcore.rqconfig") do | ||
its(:stdout) { is_expected.to match(/^0 workers, /) } | ||
its(:stdout) { is_expected.not_to match(/^resource-manager /) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
end | ||
|
||
describe 'reconfigure pulpcore to use older rq worker tasking system' do | ||
certdir = '/etc/pulpcore-certs' | ||
|
||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'pulpcore': | ||
worker_count => 1, | ||
use_rq_tasking_system => true, | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe service('httpd') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-api') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-content') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-resource-manager') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-worker@1') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe port(443) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/status/", cacert: "#{certdir}/ca-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do | ||
its(:stdout) { is_expected.to match(/^USE_NEW_WORKER_TYPE = False/) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py rq info -c pulpcore.rqconfig") do | ||
its(:stdout) { is_expected.to match(/^2 workers, /) } | ||
its(:stdout) { is_expected.to match(/^resource-manager /) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'initial configuration with older rq worker tasking system' do | ||
certdir = '/etc/pulpcore-certs' | ||
|
||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'pulpcore': | ||
worker_count => 1, | ||
use_rq_tasking_system => true, | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe service('httpd') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-api') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-content') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-resource-manager') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-worker@1') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe port(443) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/status/", cacert: "#{certdir}/ca-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do | ||
its(:stdout) { is_expected.to match(/^USE_NEW_WORKER_TYPE = False/) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py rq info -c pulpcore.rqconfig") do | ||
its(:stdout) { is_expected.to match(/^2 workers, /) } | ||
its(:stdout) { is_expected.to match(/^resource-manager /) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
end | ||
|
||
describe 'reconfigure pulpcore to use newer postgresql tasking system' do | ||
certdir = '/etc/pulpcore-certs' | ||
|
||
it_behaves_like 'an idempotent resource' do | ||
let(:manifest) do | ||
<<-PUPPET | ||
class { 'pulpcore': | ||
worker_count => 1, | ||
use_rq_tasking_system => false, | ||
} | ||
PUPPET | ||
end | ||
end | ||
|
||
describe service('httpd') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-api') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-content') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-resource-manager') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe service('pulpcore-worker@1') do | ||
it { is_expected.to be_enabled } | ||
it { is_expected.to be_running } | ||
end | ||
|
||
describe port(80) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe port(443) do | ||
it { is_expected.to be_listening } | ||
end | ||
|
||
describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/status/", cacert: "#{certdir}/ca-cert.pem") do | ||
its(:response_code) { is_expected.to eq(200) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("PULP_SETTINGS=/etc/pulp/settings.py pulpcore-manager diffsettings") do | ||
its(:stdout) { is_expected.to match(/^USE_NEW_WORKER_TYPE = True/) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
|
||
describe command("DJANGO_SETTINGS_MODULE=pulpcore.app.settings PULP_SETTINGS=/etc/pulp/settings.py rq info -c pulpcore.rqconfig") do | ||
its(:stdout) { is_expected.to match(/^0 workers, /) } | ||
its(:stdout) { is_expected.not_to match(/^resource-manager /) } | ||
its(:exit_status) { is_expected.to eq 0 } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters