Skip to content

Commit

Permalink
Modernize testing platforms
Browse files Browse the repository at this point in the history
Chef 18, Workstaiton 25, Centos 9&10, Debian 12, Ubuntu 22+

This also removes an old monkeypatch.

It is based on the CI Fixes PR facebook#254

Signed-off-by: Phil Dibowitz <phil@ipom.com>
  • Loading branch information
jaymzh committed Feb 13, 2025
1 parent 2ac2573 commit ef1eaac
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 42 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.7', '3.0', '3.1']
ruby: ['3.1', '3.3']
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -28,9 +28,11 @@ jobs:
fail-fast: false
matrix:
os:
- centos-stream-8
- ubuntu-2004
- debian-11
- centos-stream-9
- centos-stream-10
- ubuntu-2204
- ubuntu-2404
- debian-12
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -39,7 +41,7 @@ jobs:
uses: actionshub/chef-install@2.0.4
with:
project: chef-workstation
version: 20.11.180
version: 25.2.1075
- name: Run Kitchen
uses: actionshub/test-kitchen@2.1.0
with:
Expand Down
24 changes: 12 additions & 12 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ driver:
chef_version: <%= ENV['CHEF_VERSION'] || 'current' %>

platforms:
- name: centos-7
- name: centos-stream-9
driver:
image: dokken/centos-7
image: dokken/centos-stream-9
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
# stub out /etc/fstab for fb_fstab
- RUN touch /etc/fstab
# enable EPEL (for stuff like hddtemp)
- RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- name: centos-stream-8
- RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
- name: centos-stream-10
driver:
image: dokken/centos-stream-8
image: dokken/centos-stream-10
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
# stub out /etc/fstab for fb_fstab
Expand All @@ -26,18 +26,18 @@ platforms:
- RUN sed -i=.bak -e 's/^mirrorlist/#mirrorlist/g' -e 's!^#baseurl=http://mirror.centos.org/$contentdir/$stream!baseurl=https://vault.centos.org/$stream!g' /etc/yum.repos.d/*.repo
- RUN rm /etc/yum.repos.d/*.bak
# enable EPEL (for stuff like hddtemp)
- RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
- name: ubuntu-18.04
- RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
- name: ubuntu-24.04
driver:
image: dokken/ubuntu-18.04
image: dokken/ubuntu-24.04
pid_one_command: /bin/systemd
- name: ubuntu-20.04
- name: ubuntu-22.04
driver:
image: dokken/ubuntu-20.04
image: dokken/ubuntu-22.04
pid_one_command: /bin/systemd
- name: debian-11
- name: debian-12
driver:
image: dokken/debian-11
image: dokken/debian-12
pid_one_command: /bin/systemd

provisioner:
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'chef', '~> 16'
gem 'chef', '~> 18'
gem 'cookstyle', '= 7.32.1'
gem 'rspec', '= 3.11'
gem 'rubocop', '= 1.25.1'
Expand Down
21 changes: 0 additions & 21 deletions cookbooks/ci_fixes/attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,3 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

# monkeypatch for https://github.com/chef/ohai/pull/1476
if FB::Version.new(Chef::VERSION) < FB::Version.new('16.2.2')
Chef::Log.debug('ci_fixes: applying virtualization monkeypatch')

if File.exist?('/proc/self/cgroup')
cgroup_content = File.read('/proc/self/cgroup')
if cgroup_content =~ %r{^\d+:[^:]*:/(lxc|docker)/.+$} ||
cgroup_content =~ %r{^\d+:[^:]*:/[^/]+/(lxc|docker)-?.+$}
Chef::Log.info(
'Plugin Virtualization Monkeypatch: /proc/self/cgroup indicates ' +
"#{$1} container. Detecting as #{$1} guest",
)
node.automatic['virtualization']['system'] = $1 # rubocop:disable Chef/Meta/UseNodeDefault
node.automatic['virtualization']['role'] = 'guest' # rubocop:disable Chef/Meta/UseNodeDefault
node.automatic['virtualization']['systems'][$1.to_s] = 'guest' # rubocop:disable Chef/Meta/UseNodeDefault
end
end
else
Chef::Log.warn('ci_fixes: clean up the virtualization monkeypatch!')
end
10 changes: 8 additions & 2 deletions cookbooks/fb_init_sample/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,18 @@
end

unless node.centos6?
include_recipe 'fb_apcupsd'
# not packaged in C10 and above
if node.centos_max_version?(9)
include_recipe 'fb_apcupsd'
end
# Turn off dnsmasq as it doesn't play well with travis
node.default['fb_dnsmasq']['enable'] = false
include_recipe 'fb_dnsmasq'
end
include_recipe 'fb_collectd'
# not packaged in C10 and above
unless node.centos10?
include_recipe 'fb_collectd'
end
include_recipe 'fb_rsync::server'
if node.centos?
include_recipe 'fb_sysstat'
Expand Down
6 changes: 5 additions & 1 deletion cookbooks/test_services/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
include_recipe 'fb_apache'
if node.debian? || (node.ubuntu? && !node.ubuntu16?)
include_recipe 'fb_apt_cacher'
include_recipe 'fb_smokeping'
# debian post-18 doesn't package echoping which the config
# in fb_smokeping depends on, so don't run it, for now
if node.debian? || node.ubuntu18? || node.ubuntu20?
include_recipe 'fb_smokeping'
end
end

# Currently fb_reprepro is broken
Expand Down

0 comments on commit ef1eaac

Please sign in to comment.