Skip to content

Commit 7743f2a

Browse files
authored
Merge pull request #348 from cernops/rockypy
upgrade to python 3.8, add rockylinux support for ci
2 parents 1a1d045 + 6b32228 commit 7743f2a

File tree

17 files changed

+379
-38
lines changed

17 files changed

+379
-38
lines changed

.github/workflows/build.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ jobs:
9696
- uses: actions/cache@v2
9797
with:
9898
path: ~/.cache/pip
99-
key: ${{ runner.os }}-${{ matrix.puppet }}-{{ matrix.python }}-pip-unit-${{ hashFiles('**/requirements*.txt') }}
99+
key: ${{ runner.os }}-${{ matrix.python }}-pip-unit-${{ hashFiles('**/requirements*.txt') }}
100100
restore-keys: |
101-
${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-pip-unit-
101+
${{ runner.os }}-${{ matrix.python }}-pip-unit-
102102
- name: Python prep
103103
run: |
104104
pip install virtualenv
@@ -122,7 +122,9 @@ jobs:
122122
- ruby: '2.7'
123123
name: 'centos7-puppet7'
124124
- ruby: '2.7'
125-
name: 'centos7-puppet7-python38'
125+
name: 'rocky8-puppet6'
126+
- ruby: '2.7'
127+
name: 'rocky8-puppet7'
126128
- ruby: '2.7'
127129
name: 'ubuntu18-puppet6'
128130
- ruby: '2.7'
@@ -253,4 +255,4 @@ jobs:
253255
with:
254256
channel: puppet
255257
status: FAILED
256-
color: danger
258+
color: danger

.kitchen.yml

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provisioner:
1212
# in the container, run: puppet apply
1313
name: puppet_apply
1414
# manifest to execute
15-
manifest: test/fullinstall.pp
15+
manifest: test/fullinstall_python36.pp
1616
# unused, but required
1717
modules_path: ./modules
1818
# don't have kitchen-puppet install chef by default
@@ -61,16 +61,28 @@ platforms:
6161
provisioner:
6262
puppetfile_path: build/centos7-puppet7/Puppetfile
6363

64-
# CentOS7 with Systemd - Puppet 7 - Python 3.6
65-
- name: centos7-puppet7-python38
64+
# RockyLinux 8 - Puppet 6
65+
- name: rocky8-puppet6
6666
driver:
67-
platform: centos
68-
dockerfile: build/centos7-puppet7/Dockerfile.kitchen
67+
platform: rockylinux
68+
dockerfile: build/rocky8-puppet6/Dockerfile.kitchen
6969
run_command: /sbin/init
7070
volume:
7171
- /sys/fs/cgroup:/sys/fs/cgroup:ro
7272
provisioner:
73-
puppetfile_path: build/centos7-puppet7/Puppetfile
73+
puppetfile_path: build/rocky8-puppet6/Puppetfile
74+
manifest: test/fullinstall_python38.pp
75+
76+
# RockyLinux 8 - Puppet 7
77+
- name: rocky8-puppet7
78+
driver:
79+
platform: rockylinux
80+
dockerfile: build/rocky8-puppet7/Dockerfile.kitchen
81+
run_command: /sbin/init
82+
volume:
83+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
84+
provisioner:
85+
puppetfile_path: build/rocky8-puppet7/Puppetfile
7486
manifest: test/fullinstall_python38.pp
7587

7688
# Ubuntu Bionic with Systemd - Puppet 6
@@ -105,6 +117,7 @@ platforms:
105117
- /sys/fs/cgroup:/sys/fs/cgroup:ro
106118
provisioner:
107119
puppetfile_path: build/ubuntu20-puppet6/Puppetfile
120+
manifest: test/fullinstall_python38.pp
108121

109122
# Ubuntu Focal with Systemd - Puppet 7
110123
- name: ubuntu20-puppet7
@@ -116,6 +129,7 @@ platforms:
116129
- /sys/fs/cgroup:/sys/fs/cgroup:ro
117130
provisioner:
118131
puppetfile_path: build/ubuntu20-puppet7/Puppetfile
132+
manifest: test/fullinstall_python38.pp
119133

120134
suites:
121135
- name: default

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Development
44

5+
- Move CentOS -> RockyLinux and Python 3.6 -> 3.8. Contributed by @rush-skills
6+
57
- Added the ability to manage StackStack metrics giving options for the metric driver,
68
host and port number defined in st2.conf. Contributed by @bishopbm1
79

REFERENCE.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ class { 'st2':
134134
}
135135
```
136136

137-
##### Install with python 3.6 (if not default on your system)
137+
##### Install with python 3.8 (if not default on your system)
138138

139139
```puppet
140140
$st2_python_version = $facts['os']['family'] ? {
141-
'RedHat' => '3.6',
142-
'Debian' => 'python3.6',
141+
'RedHat' => '3.8',
142+
'Debian' => 'python3.8',
143143
}
144144
class { 'st2':
145145
python_version => $st2_python_version,
@@ -257,8 +257,8 @@ Data type: `String`
257257

258258
Version of Python to install. Default is 'system' meaning the system version
259259
of Python will be used.
260-
To install Python 3.6 on RHEL/CentOS 7 specify '3.6'.
261-
To install Python 3.6 on Ubuntu 16.05 specify 'python3.6'.
260+
To install Python 3.8 on RHEL/CentOS 7 specify '3.8'.
261+
To install Python 3.8 on Ubuntu 16.05 specify 'python3.8'.
262262

263263
Default value: `'system'`
264264

@@ -2383,12 +2383,12 @@ include st2::profile::python
23832383
include st2::profile::python
23842384
```
23852385

2386-
##### Install with python 3.6 (if not default on your system)
2386+
##### Install with python 3.8 (if not default on your system)
23872387

23882388
```puppet
23892389
$st2_python_version = $facts['os']['family'] ? {
2390-
'RedHat' => '3.6',
2391-
'Debian' => 'python3.6',
2390+
'RedHat' => '3.8',
2391+
'Debian' => 'python3.8',
23922392
}
23932393
class { 'st2':
23942394
python_version => $st2_python_version,
@@ -2407,8 +2407,8 @@ Data type: `String`
24072407

24082408
Version of Python to install. Default is 'system' meaning the system version
24092409
of Python will be used.
2410-
To install Python 3.6 on RHEL/CentOS 7 specify '3.6'.
2411-
To install Python 3.6 on Ubuntu 16.05 specify 'python3.6'.
2410+
To install Python 3.8 on RHEL/CentOS/Rocky 7/8 specify '3.8'.
2411+
To install Python 3.8 on Ubuntu 18.04/20.04 specify 'python3.8'.
24122412

24132413
Default value: `$st2::python_version`
24142414

@@ -4462,9 +4462,9 @@ High level steps:
44624462
- stop stackstorm
44634463
## https://docs.mongodb.com/manual/release-notes/3.6-upgrade-standalone/
44644464
- set MongoDB feature compatibility to 3.4
4465-
- change package repo to 3.6
4465+
- change package repo to 3.8
44664466
- upgrade packages
4467-
- set MongoDB feature compatibility to 3.6
4467+
- set MongoDB feature compatibility to 3.8
44684468
## https://docs.mongodb.com/manual/release-notes/4.0-upgrade-standalone/
44694469
- change package repo to 4.0
44704470
- upgrade packages
@@ -4488,13 +4488,13 @@ bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_passwor
44884488
##### Upgrading from 3.6 to 4.0
44894489

44904490
```puppet
4491-
bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_password": "xxx", "upgrade_version_start": "3.6", "upgrade_version_path": ["4.0"]}'
4491+
bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_password": "xxx", "upgrade_version_start": "3.8", "upgrade_version_path": ["4.0"]}'
44924492
```
44934493

44944494
##### Upgrading from 3.4 to 3.6 to 4.0
44954495

44964496
```puppet
4497-
bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_password": "xxx", "upgrade_version_start": "3.4", "upgrade_version_path": ["3.6", "4.0"]}'
4497+
bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_password": "xxx", "upgrade_version_start": "3.4", "upgrade_version_path": ["3.8", "4.0"]}'
44984498
```
44994499

45004500
#### Parameters
@@ -4570,4 +4570,3 @@ Data type: `Array[String]`
45704570
List of versions that we will upgrade through along our path to success!
45714571

45724572
Default value: `['3.6', '4.0']`
4573-

Vagrantfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
#
3232
# # Python 3 testing
3333
# # CentOS/RHEL
34-
# echo -e "class { 'st2': python_version => '3.6' }\n include st2::profile::fullinstall" > apply.pp
34+
# echo -e "class { 'st2': python_version => '3.8' }\n include st2::profile::fullinstall" > apply.pp
3535
# # Ubuntu 18.04 +
36-
# echo -e "class { 'st2': python_version => 'python3.6' }\n include st2::profile::fullinstall" > apply.pp
36+
# echo -e "class { 'st2': python_version => 'python3.8' }\n include st2::profile::fullinstall" > apply.pp
3737
#
3838
# chmod 440 -R /etc/sudoers.d; puppet apply apply.pp; chmod 755 -R /etc/sudoers.d
3939
#

build/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ build/scripts/install_puppet.sh
3737
# below are the test environments we currently use
3838
build/centos7-puppet6 # Files needed for the RHEL/CentOS 7 test environemnt on puppet 6
3939
build/centos7-puppet7 # Files needed for the RHEL/CentOS 7 test environemnt on puppet 7
40+
build/rocky8-puppet6 # Files needed for the RockyLinux 8 test environemnt on puppet 6
41+
build/rocky8-puppet7 # Files needed for the RockyLinux 8 test environemnt on puppet 7
4042
build/ubuntu18-puppet6 # Files needed for the Ubuntu 18.04 test environemnt on puppet 6
4143
build/ubuntu18-puppet7 # Files needed for the Ubuntu 18.04 test environemnt on puppet 7
4244
build/ubuntu20-puppet6 # Files needed for the Ubuntu 20.04 test environemnt on puppet 6

build/rocky8-puppet6/Dockerfile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# usage (from the root of the puppet-st2/ directory):
2+
# docker build -t stackstorm/puppet-st2-puppet6 -f build/puppet6/Dockerfile .
3+
4+
FROM stackstorm/packagingtest:rockylinux8-systemd
5+
6+
# install ruby and dependencies for gem install
7+
RUN yum -y install gcc gcc-c++ make which openssl
8+
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
9+
RUN curl -sSL https://get.rvm.io | bash -s stable
10+
RUN /bin/bash -l -c "rvm requirements"
11+
RUN /bin/bash -l -c "rvm install 2.5.1"
12+
RUN /bin/bash -l -c "rvm use 2.5.1 --default"
13+
RUN /bin/bash -l -c "gem install bundler --no-rdoc --no-ri"
14+
15+
# install puppet
16+
RUN yum -y install https://yum.puppet.com/puppet6/puppet6-release-el-7.noarch.rpm
17+
RUN yum -y install puppet-agent
18+
ENV PATH="/opt/puppetlabs/bin:${PATH}"
19+
20+
# print versions (ruby 2.5.x, puppet 6.x)
21+
RUN /bin/bash -l -c "ruby --version"
22+
RUN /bin/bash -l -c "gem --version"
23+
RUN /bin/bash -l -c "bundle --version"
24+
RUN puppet --version
25+
26+
# create our working directory with the code from our repo in it
27+
ENV APP_HOME /puppet_st2
28+
RUN mkdir $APP_HOME
29+
WORKDIR $APP_HOME
30+
COPY . $APP_HOME
31+
32+
# use bundler to install our gems
33+
ENV PUPPET_GEM_VERSION "~> 6.0"
34+
ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
35+
BUNDLE_JOBS=2 \
36+
BUNDLE_PATH=/bundle
37+
RUN /bin/bash -l -c "bundle -v"
38+
RUN /bin/bash -l -c "rm -f ${APP_HOME}/Gemfile.lock"
39+
RUN /bin/bash -l -c "gem update --system"
40+
RUN /bin/bash -l -c "gem --version"
41+
RUN /bin/bash -l -c "bundle -v"
42+
RUN cat $BUNDLE_GEMFILE
43+
RUN /bin/bash -l -c "bundle install --without system_tests"
44+
RUN cat $BUNDLE_GEMFILE.lock
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# usage (from the root of the puppet-st2/ directory):
2+
# docker build -t stackstorm/puppet-st2-puppet6 -f build/puppet6/Dockerfile.kitchen .
3+
4+
FROM stackstorm/packagingtest:rockylinux8-systemd
5+
6+
RUN mkdir -p /var/run/sshd
7+
RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %>
8+
RUN echo <%= "#{@username}:#{@password}" %> | chpasswd
9+
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
10+
RUN mkdir -p /home/<%= @username %>/.ssh
11+
RUN chown -R <%= @username %> /home/<%= @username %>/.ssh
12+
RUN chmod 0700 /home/<%= @username %>/.ssh
13+
RUN touch /home/<%= @username %>/.ssh/authorized_keys
14+
RUN chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys
15+
RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys
16+
RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys
17+
18+
# upgrade the image, otherwise installing st2 package hangs
19+
RUN yum -y upgrade
20+
21+
# install doc files (/usr/share/docs) when installing yum packages
22+
# otherwise /usr/share/docs/st2/conf/nginx/st2.conf won't be present
23+
# https://github.com/docker-library/docs/tree/master/centos#package-documentation
24+
RUN sed -i '/nodocs/d' /etc/yum.conf
25+
26+
# install puppet
27+
RUN yum -y install https://yum.puppet.com/puppet6/puppet6-release-el-8.noarch.rpm
28+
RUN yum -y install puppet-agent
29+
ENV PATH="/opt/puppetlabs/bin:${PATH}"
30+
RUN ln -s /opt/puppetlabs/bin/facter /usr/bin/
31+
RUN ln -s /opt/puppetlabs/bin/hiera /usr/bin/
32+
RUN ln -s /opt/puppetlabs/bin/mco /usr/bin/
33+
RUN ln -s /opt/puppetlabs/bin/puppet /usr/bin/
34+
35+
# print versions (ruby 2.5.x, puppet 6.x)
36+
RUN puppet --version
37+
RUN sudo -E puppet --version

build/rocky8-puppet6/Puppetfile

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# coding: utf-8
2+
# ################
3+
# # Instructions #
4+
# ################
5+
# yum -y install puppet (or equivalent)
6+
# gem install r10k
7+
# # create a new file ./Puppetfile with the contents of this file
8+
# r10k puppetfile install -v --moduledir=./modules --puppetfile=./Puppetfile
9+
# # to check the module dependencies here:
10+
# # puppet module list --tree --modulepath ./modules/
11+
# puppet apply --modulepath=./modules -e "include st2::profile::fullinstall"
12+
#
13+
# #############
14+
# # DEV Notes #
15+
# #############
16+
# # To generate this file i did this, make sure you have this repo cloned:
17+
# pdk build
18+
# puppet module install ./pkg/stackstorm-st2-x.y.z.tar.gz
19+
# puppet module list --tree
20+
#
21+
# ######################
22+
# # Latest Module Tree #
23+
# ######################
24+
# └─┬ stackstorm-st2 (v1.7.0)
25+
# ├── ghoneycutt-facter (v3.5.0)
26+
# ├── jamtur01-httpauth (v0.0.6)
27+
# ├── npwalker-recursive_file_permissions (v0.6.0)
28+
# ├── puppet-epel (v3.0.1)
29+
# ├── puppet-mongodb (v3.1.0)
30+
# ├─┬ puppet-nginx (v1.1.0)
31+
# │ └── puppetlabs-concat (v6.2.0)
32+
# ├── puppet-nodejs (v7.0.1)
33+
# ├── puppet-python (v4.1.1)
34+
# ├── puppet-redis (v7.0.0)
35+
# ├─┬ puppet-rabbitmq (v10.1.1)
36+
# │ ├── camptocamp-systemd (v2.9.0)
37+
# │ └── puppet-archive (v4.5.0)
38+
# ├── puppet-selinux (v3.2.0)
39+
# ├─┬ puppetlabs-apt (v7.5.0)
40+
# │ └── puppetlabs-translate (v2.2.0)
41+
# ├── puppetlabs-inifile (v4.2.0)
42+
# ├── puppetlabs-stdlib (v5.2.0)
43+
# ├── puppetlabs-yumrepo_core (v1.0.7)
44+
# └── saz-sudo (v6.0.0)
45+
forge "https://forgeapi.puppetlabs.com"
46+
47+
# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70
48+
# in latest release. Pinning to 3.5 until resolved.
49+
mod 'ghoneycutt/facter', '3.5.0'
50+
mod 'jamtur01-httpauth'
51+
mod 'npwalker-recursive_file_permissions'
52+
mod 'puppet-epel'
53+
mod 'puppet-mongodb',
54+
:git => 'https://github.com/voxpupuli/puppet-mongodb.git',
55+
:branch => 'master'
56+
mod 'puppet-nginx'
57+
mod 'puppetlabs-concat' # dependency of puppet-nginx'
58+
mod 'puppet-nodejs'
59+
mod 'puppet-python'
60+
# Using master branch due to new release on hold pending new tests.
61+
mod 'puppet/rabbitmq',
62+
:git => 'https://github.com/voxpupuli/puppet-rabbitmq.git',
63+
:branch => 'master'
64+
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
65+
mod 'puppet-archive' # dependency of puppet-rabbitmq
66+
mod 'puppet-selinux'
67+
mod 'puppetlabs-apt'
68+
mod 'puppetlabs-translate' # dependency of puppetlabs-apt
69+
mod 'puppetlabs-inifile'
70+
mod 'puppetlabs-stdlib'
71+
mod 'puppetlabs-yumrepo_core'
72+
mod 'saz-sudo'
73+
mod 'puppet/redis'

0 commit comments

Comments
 (0)