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

Fixes #36902 - Support Pulpcore 3.39, drop older versions #315

Merged
merged 1 commit into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
beaker_facter: 'pulpcore_version:Pulp:nightly,3.39'
rubocop: false
cache-version: '1'
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
.github/workflows/ci.yml:
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
beaker_facter: 'pulpcore_version:Pulp:nightly,3.39'
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,10 @@ 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.28
### Pulpcore 3.39

Default recommended version.

### Pulpcore 3.22

Supported version.

### Pulpcore 3.21

Supported version. The parameter `$hide_guarded_distributions` doesn't work since it's a Pulp 3.22 feature.

### Pulpcore 3.16 - 3.18

Untested, but should work besides the `$hide_guarded_distributions` parameter. Not recommended.

## Installation layout

Pulpcore doesn't mandate a specific layout so this module creates and manages this. There are some constraints, mostly due to SELinux support.
Expand Down
16 changes: 2 additions & 14 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# An optional value for gpgkey to be used for yumrepo, instead of the default.
# If an empty string is passed, gpgcheck will be disabled.
class pulpcore::repo (
Variant[Enum['nightly'], Pattern['^\d+\.\d+$']] $version = '3.28',
Variant[Enum['nightly'], Pattern['^\d+\.\d+$']] $version = '3.39',
Optional[Stdlib::HTTPUrl] $baseurl = undef,
Optional[String[0]] $gpgkey = undef,
) {
Expand All @@ -18,23 +18,11 @@
descr => "Pulpcore ${version}",
baseurl => pick($baseurl, "https://yum.theforeman.org/pulpcore/${version}/${dist_tag}/\$basearch"),
enabled => '1',
gpgcheck => if $gpgkey == '' { '0' } else { '1' },
gpgcheck => if $gpgkey == '' or $version == 'nightly' { '0' } else { '1' },
gpgkey => pick($gpgkey, "https://yum.theforeman.org/pulpcore/${version}/GPG-RPM-KEY-pulpcore"),
notify => Anchor['pulpcore::repo'],
}

# Only EL8 has DNF modules
Copy link
Member

@evgeni evgeni Nov 23, 2023

Choose a reason for hiding this comment

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

Removing this here, leaves a "failsafe" module in DNF, but seems not hinder the upgrade:

[root@centos8-stream ~]# dnf module list |grep -B5 pulpcore
Last metadata expiration check: 0:04:07 ago on Thu 23 Nov 2023 07:26:27 AM UTC.
@modulefailsafe
Name                 Stream          Profiles                                 Summary                                                                                                                                                                                                                                   
pulpcore             el8 [e]                                                  Pulpcore module                                                                                                                                          

The only cleanup needed is to remove the /etc/dnf/modules.d/pulpcore.module file, which I think can be done in here?

(People who do not use pulpcore::repo still need to be informed via docs to either delete that file or call dnf module reset pulpcore, but I think that's fine)

Copy link
Member

Choose a reason for hiding this comment

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

(People who do not use pulpcore::repo still need to be informed via docs to either delete that file or call dnf module reset pulpcore, but I think that's fine)

theforeman/foreman-documentation#2597

if $dist_tag == 'el8' {
package { 'pulpcore-dnf-module':
ensure => $dist_tag,
ekohl marked this conversation as resolved.
Show resolved Hide resolved
name => 'pulpcore',
enable_only => true,
provider => 'dnfmodule',
require => Yumrepo['pulpcore'],
notify => Anchor['pulpcore::repo'],
}
}

# An anchor is used because it can be collected
anchor { 'pulpcore::repo': } # lint:ignore:anchor_resource
}
14 changes: 0 additions & 14 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,6 @@
.with_gpgkey(%r{https://yum.theforeman.org/pulpcore/\d+\.\d+/GPG-RPM-KEY-pulpcore})
.that_notifies('Anchor[pulpcore::repo]')
}

if os_facts[:os]['release']['major'] == '8'
it 'configures the pulpcore module' do
is_expected.to contain_package('pulpcore-dnf-module')
.with_name('pulpcore')
.with_ensure(/^el\d+/)
.with_enable_only(true)
.with_provider('dnfmodule')
.that_requires('Yumrepo[pulpcore]')
.that_notifies('Anchor[pulpcore::repo]')
end
else
it { is_expected.not_to contain_package('pulpcore-dnf-module') }
end
end

describe "with nightly version" do
Expand Down
2 changes: 1 addition & 1 deletion templates/pulpcore-api.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User=<%= scope['pulpcore::user'] %>
Group=<%= scope['pulpcore::group'] %>
WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-api
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.app.wsgi:application \
ExecStart=/usr/bin/pulpcore-api \
ekohl marked this conversation as resolved.
Show resolved Hide resolved
--preload \
--timeout <%= scope['pulpcore::api_service_worker_timeout'] %> \
--workers <%= scope['pulpcore::api_service_worker_count'] %> \
Expand Down
3 changes: 1 addition & 2 deletions templates/pulpcore-content.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ User=<%= scope['pulpcore::user'] %>
Group=<%= scope['pulpcore::group'] %>
WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-content
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.content:server \
ExecStart=/usr/bin/pulpcore-content \
--preload \
--timeout <%= scope['pulpcore::content_service_worker_timeout'] %> \
--worker-class 'aiohttp.GunicornWebWorker' \
--workers <%= scope['pulpcore::content_service_worker_count'] %> \
--access-logfile -
ExecReload=/bin/kill -s HUP $MAINPID
Expand Down