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

Support Ubuntu 24.04 #163

Merged
merged 1 commit into from
Oct 16, 2024
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
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
- "amazon2023"
- "ubuntu-2004"
- "ubuntu-2204"
- "ubuntu-2404"
- "debian-12"
puppet:
- "puppet7"
Expand Down
10 changes: 9 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,15 @@ Style/TernaryParentheses:
Style/TrailingCommaInArguments:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: comma
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInArrayLiteral:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: consistent_comma
Style/TrailingCommaInHashLiteral:
Description: Prefer always trailing comma on multiline argument lists. This makes
diffs, and re-ordering nicer.
EnforcedStyleForMultiline: consistent_comma
Style/SymbolArray:
Description: Using percent style obscures symbolic intent of array's contents.
EnforcedStyle: brackets
Expand Down
7 changes: 7 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Rakefile:
- amazon2023
- ubuntu-2004
- ubuntu-2204
- ubuntu-2404
- debian-12
puppet:
- puppet7
Expand Down Expand Up @@ -51,6 +52,12 @@ spec/acceptance/nodesets/ubuntu-2204.yml:
default_module_install_opts:
ignore-dependencies: ~
force: ~
spec/acceptance/nodesets/ubuntu-2404.yml:
packages:
- cron
default_module_install_opts:
ignore-dependencies: ~
force: ~
spec/acceptance/nodesets/debian-12.yml:
packages:
- cron
Expand Down
5 changes: 4 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
$osname = $facts.dig('os', 'name')
$osmajor = $facts.dig('os', 'release', 'major')

$supported = ['RedHat-7','RedHat-8','RedHat-9','RedHat-2023','Debian-20.04','Debian-22.04','Debian-12']
$supported = ['RedHat-7','RedHat-8','RedHat-9','RedHat-2023','Debian-20.04','Debian-22.04','Debian-24.04','Debian-12']
$os = "${osfamily}-${osmajor}"
if ! ($os in $supported) {
fail("Unsupported OS: module ${module_name}. osfamily=${osfamily} osmajor=${osmajor} detected")
Expand All @@ -418,6 +418,9 @@
if "${osname}-${osmajor}" == 'Debian-12' {
fail('Debian 12 is not supported with OnDemand 3.0')
}
if "${osname}-${osmajor}" == 'Ubuntu-24.04' {
fail('Ubuntu 24.04 is not supported with OnDemand 3.0')
}
}

if versioncmp($osmajor, '7') <= 0 {
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

# Debian 12 has NodeJS 18 in OS repos
if String($openondemand::osmajor) != '12' and $openondemand::nodejs == '18' {
if ! (String($openondemand::osmajor) in ['12', '24.04']) and $openondemand::nodejs == '18' {
apt::source { 'nodesource':
ensure => 'present',
location => 'https://deb.nodesource.com/node_18.x',
Expand Down
7 changes: 4 additions & 3 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
{
"name": "puppetlabs/apache",
"version_requirement": ">= 5.2.0 < 12.0.0"
"version_requirement": ">= 5.2.0 < 13.0.0"
},
{
"name": "puppetlabs/vcsrepo",
Expand Down Expand Up @@ -77,7 +77,8 @@
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"20.04",
"22.04"
"22.04",
"24.04"
]
},
{
Expand All @@ -100,5 +101,5 @@
],
"pdk-version": "2.7.1",
"template-url": "https://github.com/treydock/pdk-templates.git#master",
"template-ref": "heads/master-0-g50afcd2"
"template-ref": "heads/master-0-gd2de99e"
}
28 changes: 28 additions & 0 deletions spec/acceptance/nodesets/ubuntu-2404.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
HOSTS:
ubuntu2404:
roles:
- agent
platform: ubuntu-24.04-amd64
hypervisor : docker
image: ubuntu:24.04
docker_preserve_image: true
docker_cmd: '["/sbin/init"]'
docker_image_commands:
- "rm -f /etc/dpkg/dpkg.cfg.d/excludes"
- 'apt-get install -y wget net-tools iproute2 locales apt-transport-https ca-certificates cron'
- 'locale-gen en_US.UTF-8'
docker_env:
- LANG=en_US.UTF-8
- LANGUAGE=en_US.UTF-8
- LC_ALL=en_US.UTF-8
docker_container_name: 'openondemand-ubuntu2404'
default_module_install_opts:
ignore-dependencies:
force:
CONFIG:
log_level: debug
type: foss
ssh:
password: root
auth_methods: ["password"]

2 changes: 1 addition & 1 deletion spec/defines/app_usr_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
is_expected.to contain_file('/var/www/ood/apps/usr/test').with('ensure' => 'directory',
'owner' => 'root',
'group' => 'root',
'mode' => '0750')
'mode' => '0750',)
end
end
end
Expand Down
28 changes: 14 additions & 14 deletions spec/defines/cluster_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
{
'adapter' => 'group',
'groups' => ['test-group'],
'type' => 'whitelist'
}
'type' => 'whitelist',
},
],
rsv_query_acls: [
{
'adapter' => 'group',
'groups' => ['test-group-rsv'],
'type' => 'blacklist'
}
'type' => 'blacklist',
},
],
login_host: 'login.test',
batch_connect: {
'basic' => { 'script_wrapper' => 'module restore\n%s' },
'vnc' => { 'script_wrapper' => 'module restore\nmodule load ondemand-vnc\n%s' }
}
'vnc' => { 'script_wrapper' => 'module restore\nmodule load ondemand-vnc\n%s' },
},
}
end

Expand All @@ -43,7 +43,7 @@
is_expected.to contain_file('/etc/ood/config/clusters.d/test.yml').with('ensure' => 'file',
'owner' => 'root',
'group' => 'root',
'mode' => '0644')
'mode' => '0644',)
end

it do
Expand All @@ -62,10 +62,10 @@
job_username_prefix: 'dev',
job_server: { 'endpoint' => 'https://k8dev.example.com:6443', 'cert_authority_file' => '/etc/k8dev.crt' },
job_mounts: [
{ 'name' => 'home', 'destination_path' => '/home', 'path' => '/home', 'host_type' => 'Directory', 'type' => 'host' }
{ 'name' => 'home', 'destination_path' => '/home', 'path' => '/home', 'host_type' => 'Directory', 'type' => 'host' },
],
job_auth: { 'type' => 'oidc' },
batch_connect: { 'ssh_allow' => false }
batch_connect: { 'ssh_allow' => false },
}
end

Expand All @@ -92,10 +92,10 @@
jupyter: {
AI_BOOTCAMP_OSC: {
hours: 3,
project: 'FOO'
}
}
}
project: 'FOO',
},
},
},
},
)
end
Expand Down Expand Up @@ -143,7 +143,7 @@
grafana_dashboard_name: 'test',
grafana_dashboard_uid: 'foo',
grafana_dashboard_panels: { 'cpu' => 1, 'memory' => 2 },
grafana_labels: { 'cluster' => 'cluster', 'host' => 'host' }
grafana_labels: { 'cluster' => 'cluster', 'host' => 'host' },
}
end

Expand Down
4 changes: 2 additions & 2 deletions spec/defines/install_app_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
context 'when git repo' do
let :params do
{
'git_repo' => 'https://github.com/foo/test'
'git_repo' => 'https://github.com/foo/test',
}
end

Expand All @@ -58,7 +58,7 @@
context 'when source' do
let(:params) do
{
'source' => 'puppet:///modules/apps'
'source' => 'puppet:///modules/apps',
}
end

Expand Down
28 changes: 14 additions & 14 deletions spec/shared_examples/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
let(:params) do
{
nginx_stage_passenger_options: {
'passenger_foobar' => 'baz'
}
'passenger_foobar' => 'baz',
},
}
end

Expand All @@ -28,7 +28,7 @@
'pinned_apps' => [
'usr/*',
'sys/jupyter',
{ 'type' => 'dev', 'category' => 'system' }
{ 'type' => 'dev', 'category' => 'system' },
],
'pinned_apps_menu_length' => 10,
'pinned_apps_group_by' => 'category',
Expand All @@ -37,11 +37,11 @@
{
'columns' => [
{ 'width' => 8, 'widgets' => ['pinned_apps', 'motd'] },
{ 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] }
]
}
]
}
{ 'width' => 4, 'widgets' => ['xdmod_widget_job_efficiency', 'xdmod_widget_jobs'] },
],
},
],
},
}
end

Expand Down Expand Up @@ -81,8 +81,8 @@
'IDP_ISSUER_URL' => 'https://idp.example.com/auth/realms/main/protocol/openid-connect/token',
'IMAGE_PULL_SECRET' => 'private-docker-registry',
'REGISTRY_DOCKER_CONFIG_JSON' => '/etc/docker-registry-auth/robot-ondemand-read.json',
'USE_JOB_POD_REAPER' => true
}
'USE_JOB_POD_REAPER' => true,
},
}
end

Expand All @@ -96,8 +96,8 @@
'IDP_ISSUER_URL="https://idp.example.com/auth/realms/main/protocol/openid-connect/token"',
'IMAGE_PULL_SECRET="private-docker-registry"',
'REGISTRY_DOCKER_CONFIG_JSON="/etc/docker-registry-auth/robot-ondemand-read.json"',
'USE_JOB_POD_REAPER="true"'
])
'USE_JOB_POD_REAPER="true"',
],)
end
end

Expand All @@ -107,8 +107,8 @@
nginx_stage_configs: {
'foo' => 'bar',
'bar' => false,
'baz' => ['foo', 'bar']
}
'baz' => ['foo', 'bar'],
},
}
end

Expand Down
12 changes: 6 additions & 6 deletions spec/shared_examples/repo_apt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
release: facts[:os]['distro']['codename'],
key: {
'id' => 'FE143EA1CB378B569BBF7C544B72FE2B92D31755',
'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand'
'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand',
},
)
end
Expand All @@ -22,12 +22,12 @@
release: facts[:os]['distro']['codename'],
key: {
'id' => 'FE143EA1CB378B569BBF7C544B72FE2B92D31755',
'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand'
'source' => 'https://apt.osc.edu/ondemand/DEB-GPG-KEY-ondemand',
},
)
end

if facts[:os]['release']['major'].to_i != 12
if facts[:os]['release']['major'].to_i != 12 && facts[:os]['release']['major'].to_s != '24.04'
it do
is_expected.to contain_apt__source('nodesource').with(
ensure: 'present',
Expand All @@ -36,15 +36,15 @@
release: 'nodistro',
key: {
'id' => '6F71F525282841EEDAF851B42F59B5F99B1BE0B4',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key'
'source' => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key',
},
)
end
else
it { is_expected.not_to contain_apt__source('nodesource') }
end

context 'when repo_release => 3.0', if: facts[:os]['release']['major'].to_i != 12 do
context 'when repo_release => 3.0', if: facts[:os]['release']['major'].to_i != 12 && facts[:os]['release']['major'].to_s != '24.04' do
let(:params) { { repo_release: '3.0' } }

it do
Expand All @@ -55,7 +55,7 @@
release: facts[:os]['distro']['codename'],
key: {
'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key'
'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
},
)
end
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

default_facts = {
puppetversion: Puppet.version,
facterversion: Facter.version
facterversion: Facter.version,
}

default_fact_files = [
File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')),
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml'))
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')),
]

default_fact_files.each do |f|
Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper_acceptance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
Dir["#{dir}/acceptance/shared_examples/**/*.rb"].sort.each { |f| require f }
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))

run_puppet_install_helper unless ENV['BEAKER_set'] == 'debian-12'
on hosts, 'apt install -y puppet-agent' if ENV['BEAKER_set'] == 'debian-12'
run_puppet_install_helper unless ['debian-12', 'ubuntu-2404'].include?(ENV['BEAKER_set'])
on hosts, 'apt install -y puppet-agent' if ['debian-12', 'ubuntu-2404'].include?(ENV['BEAKER_set'])
install_module_on(hosts)
install_module_dependencies_on(hosts)

Expand Down
4 changes: 2 additions & 2 deletions spec/spec_helper_acceptance_setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def supported_releases
osname = fact('os.name')
osfamily = fact('os.family')
osmajor = fact('os.release.major')
if ['Amazon-2023', 'Debian-12'].include?("#{osname}-#{osmajor}")
if ['Amazon-2023', 'Debian-12', 'Ubuntu-24.04'].include?("#{osname}-#{osmajor}")
['3.1']
elsif "#{osfamily}-#{osmajor}" == 'RedHat-7'
['3.0']
Expand Down Expand Up @@ -50,7 +50,7 @@ def supported_releases
'--cert-key-file /etc/pki/tls/private/localhost.key',
'--ca-file /etc/pki/tls/certs/localhost.crt',
'--dhparams-file /tmp/dhparams.pem --lifetime 365',
'--hostname $(hostname) --email root@$(hostname)'
'--hostname $(hostname) --email root@$(hostname)',
]
on hosts, cert_bootstrap.join(' ')
end
Expand Down
Loading
Loading