Skip to content

Commit 1014511

Browse files
jaymzhfacebook-github-bot
authored andcommitted
CI fixes: yum repos; disable logind; chef 18 (facebook#254)
Summary: * centos8 mirrors have moved, adjust kitchen setup accordingly. * logind can't run in containers * modern chef * Newer chef requires at least debian 11 for SSL compatability * rsyslog needs several tweaks to run in containers, added to ci_fixes * default apache config in centos points to some certs, so make those This makes everything green _except_ for debian which requires significant refactors of fb_apt, which can be found in facebook#250, but I didn't want production-effecting stuff mixed with CI fixes Signed-off-by: Phil Dibowitz <phil@ipom.com> Pull Request resolved: facebook#254 Differential Revision: D69275524 fbshipit-source-id: 6b6e7f0a10263d28e999f3adaa0b8c916459a604
1 parent a106940 commit 1014511

File tree

4 files changed

+54
-10
lines changed

4 files changed

+54
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
os:
3131
- centos-stream-8
3232
- ubuntu-2004
33-
- debian-10
33+
- debian-11
3434
runs-on: ubuntu-latest
3535
steps:
3636
- name: Checkout repository
@@ -47,7 +47,7 @@ jobs:
4747
os: ${{ matrix.os }}
4848
env:
4949
CHEF_LICENSE: accept-no-persist
50-
CHEF_VERSION: 16.18.0
50+
CHEF_VERSION: 18.6.14
5151
shellcheck:
5252
runs-on: ubuntu-latest
5353
steps:

.kitchen.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ platforms:
2222
intermediate_instructions:
2323
# stub out /etc/fstab for fb_fstab
2424
- RUN touch /etc/fstab
25+
# mirrorlist.centos.org doesn't exist anymore, use baseurl
26+
- 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
27+
- RUN rm /etc/yum.repos.d/*.bak
2528
# enable EPEL (for stuff like hddtemp)
2629
- RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
2730
- name: ubuntu-18.04
@@ -32,13 +35,9 @@ platforms:
3235
driver:
3336
image: dokken/ubuntu-20.04
3437
pid_one_command: /bin/systemd
35-
- name: debian-9
38+
- name: debian-11
3639
driver:
37-
image: dokken/debian-9
38-
pid_one_command: /bin/systemd
39-
- name: debian-10
40-
driver:
41-
image: dokken/debian-10
40+
image: dokken/debian-11
4241
pid_one_command: /bin/systemd
4342

4443
provisioner:

cookbooks/ci_fixes/recipes/default.rb

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,48 @@
1717
# See the License for the specific language governing permissions and
1818
# limitations under the License.
1919
#
20+
21+
node.default['fb_systemd']['logind']['enable'] = false
22+
23+
# older versions of rsyslog try to call close() on every _possible_ fd
24+
# as limited by ulimit -n, which can take MINUTES to start. So drop this
25+
# number for CI: https://github.com/rsyslog/rsyslog/issues/5158
26+
if node.centos_max_version?(9)
27+
node.default['fb_limits']['*']['nofile'] = {
28+
'hard' => '1024',
29+
'soft' => '1024',
30+
}
31+
end
32+
33+
# postfix hasn't setup it's chroot on rsyslog's first startup and
34+
# thus it fails in containers on firstboot, so override postfix
35+
# telling syslog to look at its socket. Why this is an issue only
36+
# on CentOS, I do not know
37+
whyrun_safe_ruby_block 'ci fix for postfix/syslog' do
38+
only_if { node.centos? }
39+
block do
40+
node.default['fb_syslog']['rsyslog_additional_sockets'] = []
41+
end
42+
end
43+
44+
# create the certs the default apache looks at
45+
execute 'create certs' do
46+
only_if { node.centos? }
47+
command 'openssl req -new -newkey rsa:4096 -x509 -sha256 -days 365 ' +
48+
'-nodes -out /etc/pki/tls/certs/localhost.crt ' +
49+
'-keyout /etc/pki/tls/private/localhost.key ' +
50+
'-subj "/C=US/ST=California/L=Some City/O=Some Org/CN=test"'
51+
end
52+
53+
# GH Runner's forced apparmor doesn't let binaries write to
54+
# /run/systemd/notify, so tell the unit not to try
55+
# why this seems to be issue on CentOS, I do not know
56+
fb_systemd_override 'syslog-no-systemd' do
57+
only_if { node.centos? }
58+
unit_name 'rsyslog.service'
59+
content({
60+
'Service' => {
61+
'Type' => 'simple',
62+
},
63+
})
64+
end

cookbooks/fb_syslog/recipes/default.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@
7777
action :start
7878
subscribes :restart, 'package[rsyslog]'
7979
# within vagrant, sometimes rsyslog fails to restart the first time
80-
retries 5
81-
retry_delay 5
80+
retries 1
81+
retry_delay 15
8282
end

0 commit comments

Comments
 (0)