From b33b7e2ed15d1a694d87114599543b1098182ecd Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Wed, 9 Mar 2022 14:09:28 +0100 Subject: [PATCH] Drop Pulpcore 3.14 & 3.15, move to 3.16 & 3.17 --- .github/workflows/ci.yml | 4 +- README.md | 8 +- manifests/init.pp | 6 - manifests/repo.pp | 2 +- manifests/service.pp | 17 +-- spec/acceptance/basic_spec.rb | 10 +- .../disable_new_tasking_system_spec.rb | 137 ------------------ .../enable_new_tasking_system_spec.rb | 137 ------------------ .../pulpcore-resource-manager.service.erb | 24 --- templates/settings.py.erb | 1 - 10 files changed, 12 insertions(+), 334 deletions(-) delete mode 100644 spec/acceptance/disable_new_tasking_system_spec.rb delete mode 100644 spec/acceptance/enable_new_tasking_system_spec.rb delete mode 100644 templates/pulpcore-resource-manager.service.erb diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 072e1c55..6b06996f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,8 +66,8 @@ jobs: setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}} puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}} pulpcore_version: - - '3.15' - - '3.14' + - '3.17' + - '3.16' name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - Pulp ${{ matrix.pulpcore_version }} steps: - uses: actions/checkout@v2 diff --git a/README.md b/README.md index ed8e9321..70329f8c 100644 --- a/README.md +++ b/README.md @@ -10,15 +10,13 @@ All supported versions are listed below. For every supported version, acceptance Supported operating systems are listed in `metadata.json` but individual releases can divert from that. For example, if Pulpcore x.y drops EL7, it will still be listed in metadata.json until all versions supported by the module have dropped it. Similarly, if x.z adds support for EL9, it'll be listed in `metadata.json` and all versions that don't support EL9 will have a note. -### Pulpcore 3.15 +### Pulpcore 3.17 Default recommended version. -Starting Pulpcore 3.15 the migration plugin is no longer built. Users should remove the plugin prior to upgrding. The [foreman_maintain Pulp 2 removal procedure](https://github.com/theforeman/foreman_maintain/blob/d49ece67f1dba761bb232229593765f61e01361a/definitions/procedures/pulp/remove.rb#L109-L160) is a good reference. Additionally the package `python3-pulp-2to3-migration` should be removed. +### Pulpcore 3.16 -### Pulpcore 3.14 - -At least pulpcore 3.14.8-2 (and matching plugins) should be used, as this version introduced virtual package names that are used in this module. Certguard 1.4.0-3 should be used to pull in the correct RHSM package. +Supported ## Installation layout diff --git a/manifests/init.pp b/manifests/init.pp index e6af0caa..759b8778 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -139,11 +139,6 @@ # You should not need to modify this setting unless the application reports workers timing out while they are busy completing tasks. # Modification should be performed incrementally to determine the least value that prevents false positive worker timeouts. # -# @param use_rq_tasking_system -# Use the older RQ workers tasking system instead of the newer PostgreSQL tasking system introduced in Pulpcore 3.14. This is deprecated in 3.15. -# Any benchmarking you did to optimize worker_count or other tasking related parameters will no longer be accurate after changing the tasking system. -# Do not modify this setting unless you understand the implications for performance and stability. -# # @param service_enable # Enable/disable Pulp services at boot. # @@ -219,7 +214,6 @@ String[1] $remote_user_environ_name = 'HTTP_REMOTE_USER', Integer[0] $worker_count = min(8, $facts['processors']['count']), Optional[Integer[0]] $worker_ttl = undef, - Boolean $use_rq_tasking_system = false, Boolean $service_enable = true, Boolean $service_ensure = true, Integer[0] $content_service_worker_count = (2*min(8, $facts['processors']['count']) + 1), diff --git a/manifests/repo.pp b/manifests/repo.pp index fe8402ed..640b4bd3 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -3,7 +3,7 @@ # @param version # The Pulpcore version to use class pulpcore::repo ( - Pattern['^\d+\.\d+$'] $version = '3.15', + Pattern['^\d+\.\d+$'] $version = '3.17', ) { $context = { 'version' => $version, diff --git a/manifests/service.pp b/manifests/service.pp index 8861f7ed..09e42c50 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -18,18 +18,11 @@ service_content => template('pulpcore/pulpcore-content.service.erb'), } - if $pulpcore::use_rq_tasking_system { - systemd::unit_file { 'pulpcore-resource-manager.service': - content => template('pulpcore/pulpcore-resource-manager.service.erb'), - active => $pulpcore::service_ensure, - enable => $pulpcore::service_enable, - } - } else { - systemd::unit_file { 'pulpcore-resource-manager.service': - ensure => 'absent', - active => false, - enable => false, - } + # Clean up the RQ tasking system which 3.16 removed + systemd::unit_file { 'pulpcore-resource-manager.service': + ensure => 'absent', + active => false, + enable => false, } systemd::unit_file { 'pulpcore-worker@.service': diff --git a/spec/acceptance/basic_spec.rb b/spec/acceptance/basic_spec.rb index 19776fe9..daae6b78 100644 --- a/spec/acceptance/basic_spec.rb +++ b/spec/acceptance/basic_spec.rb @@ -65,8 +65,7 @@ end describe curl_command("https://#{host_inventory['fqdn']}/pulp/api/v3/", cacert: "#{certdir}/ca-cert.pem") do - its(:response_code) { is_expected.to eq(200) } - its(:body) { is_expected.not_to contain('artifacts_list') } + its(:response_code) { is_expected.to eq(403) } its(:exit_status) { is_expected.to eq 0 } end @@ -78,13 +77,6 @@ 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 /usr/libexec/pulpcore/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 diff --git a/spec/acceptance/disable_new_tasking_system_spec.rb b/spec/acceptance/disable_new_tasking_system_spec.rb deleted file mode 100644 index d22cf324..00000000 --- a/spec/acceptance/disable_new_tasking_system_spec.rb +++ /dev/null @@ -1,137 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'change configuration from postgresql tasking system to rq tasking system', :order => :defined do - certdir = '/etc/pulpcore-certs' - - context 'initial configuration with newer postgresql tasking system' do - 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 file('/etc/systemd/system/pulpcore-resource-manager.service') do - it { is_expected.not_to exist } - end - - describe service('pulpcore-resource-manager') do - it { is_expected.not_to be_enabled } - it { is_expected.not_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 /usr/libexec/pulpcore/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 - - context 'reconfigure pulpcore to use older rq worker tasking system' do - 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 file('/etc/systemd/system/pulpcore-resource-manager.service') do - it { is_expected.to exist } - 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 /usr/libexec/pulpcore/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 -end diff --git a/spec/acceptance/enable_new_tasking_system_spec.rb b/spec/acceptance/enable_new_tasking_system_spec.rb deleted file mode 100644 index d78d18ae..00000000 --- a/spec/acceptance/enable_new_tasking_system_spec.rb +++ /dev/null @@ -1,137 +0,0 @@ -require 'spec_helper_acceptance' - -describe 'change configuration from rq tasking system to postgresql tasking system', :order => :defined do - certdir = '/etc/pulpcore-certs' - - context 'initial configuration with older rq worker tasking system' do - 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 file('/etc/systemd/system/pulpcore-resource-manager.service') do - it { is_expected.to exist } - 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 /usr/libexec/pulpcore/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 - - context 'reconfigure pulpcore to use newer postgresql tasking system' do - 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 file('/etc/systemd/system/pulpcore-resource-manager.service') do - it { is_expected.not_to exist } - end - - describe service('pulpcore-resource-manager') do - it { is_expected.not_to be_enabled } - it { is_expected.not_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 /usr/libexec/pulpcore/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 -end diff --git a/templates/pulpcore-resource-manager.service.erb b/templates/pulpcore-resource-manager.service.erb deleted file mode 100644 index c160549c..00000000 --- a/templates/pulpcore-resource-manager.service.erb +++ /dev/null @@ -1,24 +0,0 @@ -[Unit] -Description=Pulp Resource Manager -After=network-online.target -Wants=network-online.target - -[Service] -Type=simple -Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings" -Environment="PULP_SETTINGS=<%= scope['pulpcore::settings_file'] %>" -User=<%= scope['pulpcore::user'] %> -Group=<%= scope['pulpcore::group'] %> -WorkingDirectory=<%= scope['pulpcore::user_home'] %> -RuntimeDirectory=pulpcore-resource-manager -ExecStart=/usr/libexec/pulpcore/pulpcore-worker --resource-manager -SyslogIdentifier=pulpcore-resource-manager - -# This provides reconnect support for PostgreSQL and Redis. Without reconnect support, if either -# is not available at startup or becomes disconnected, this process will die and not respawn. -Restart=always -RestartSec=3 - -[Install] -WantedBy=multi-user.target - diff --git a/templates/settings.py.erb b/templates/settings.py.erb index 3ddabd78..e967f2a0 100644 --- a/templates/settings.py.erb +++ b/templates/settings.py.erb @@ -31,7 +31,6 @@ DATABASES = { } REDIS_URL = "redis://localhost:<%= scope['redis::port'] %>/<%= scope['pulpcore::redis_db'] %>" -USE_NEW_WORKER_TYPE = <%= scope['pulpcore::use_rq_tasking_system'] ? "False" : "True" %> <% if scope['pulpcore::worker_ttl'] -%> WORKER_TTL = <%= scope['pulpcore::worker_ttl'] %> <% end -%>