Skip to content

upgrade to python 3.8, add rockylinux support for ci #348

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

Merged
merged 3 commits into from
Jun 8, 2022
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
10 changes: 6 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ jobs:
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.puppet }}-{{ matrix.python }}-pip-unit-${{ hashFiles('**/requirements*.txt') }}
key: ${{ runner.os }}-${{ matrix.python }}-pip-unit-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.puppet }}-${{ matrix.ruby }}-pip-unit-
${{ runner.os }}-${{ matrix.python }}-pip-unit-
- name: Python prep
run: |
pip install virtualenv
Expand All @@ -122,7 +122,9 @@ jobs:
- ruby: '2.7'
name: 'centos7-puppet7'
- ruby: '2.7'
name: 'centos7-puppet7-python38'
name: 'rocky8-puppet6'
- ruby: '2.7'
name: 'rocky8-puppet7'
- ruby: '2.7'
name: 'ubuntu18-puppet6'
- ruby: '2.7'
Expand Down Expand Up @@ -253,4 +255,4 @@ jobs:
with:
channel: puppet
status: FAILED
color: danger
color: danger
26 changes: 20 additions & 6 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ provisioner:
# in the container, run: puppet apply
name: puppet_apply
# manifest to execute
manifest: test/fullinstall.pp
manifest: test/fullinstall_python36.pp
# unused, but required
modules_path: ./modules
# don't have kitchen-puppet install chef by default
Expand Down Expand Up @@ -61,16 +61,28 @@ platforms:
provisioner:
puppetfile_path: build/centos7-puppet7/Puppetfile

# CentOS7 with Systemd - Puppet 7 - Python 3.6
- name: centos7-puppet7-python38
# RockyLinux 8 - Puppet 6
- name: rocky8-puppet6
driver:
platform: centos
dockerfile: build/centos7-puppet7/Dockerfile.kitchen
platform: rockylinux
dockerfile: build/rocky8-puppet6/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/centos7-puppet7/Puppetfile
puppetfile_path: build/rocky8-puppet6/Puppetfile
manifest: test/fullinstall_python38.pp

# RockyLinux 8 - Puppet 7
- name: rocky8-puppet7
driver:
platform: rockylinux
dockerfile: build/rocky8-puppet7/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/rocky8-puppet7/Puppetfile
manifest: test/fullinstall_python38.pp

# Ubuntu Bionic with Systemd - Puppet 6
Expand Down Expand Up @@ -105,6 +117,7 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu20-puppet6/Puppetfile
manifest: test/fullinstall_python38.pp

# Ubuntu Focal with Systemd - Puppet 7
- name: ubuntu20-puppet7
Expand All @@ -116,6 +129,7 @@ platforms:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu20-puppet7/Puppetfile
manifest: test/fullinstall_python38.pp

suites:
- name: default
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Development

- Move CentOS -> RockyLinux and Python 3.6 -> 3.8. Contributed by @rush-skills

- Added the ability to manage StackStack metrics giving options for the metric driver,
host and port number defined in st2.conf. Contributed by @bishopbm1

Expand Down
29 changes: 14 additions & 15 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ class { 'st2':
}
```

##### Install with python 3.6 (if not default on your system)
##### Install with python 3.8 (if not default on your system)

```puppet
$st2_python_version = $facts['os']['family'] ? {
'RedHat' => '3.6',
'Debian' => 'python3.6',
'RedHat' => '3.8',
'Debian' => 'python3.8',
}
class { 'st2':
python_version => $st2_python_version,
Expand Down Expand Up @@ -257,8 +257,8 @@ Data type: `String`

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

Default value: `'system'`

Expand Down Expand Up @@ -2383,12 +2383,12 @@ include st2::profile::python
include st2::profile::python
```

##### Install with python 3.6 (if not default on your system)
##### Install with python 3.8 (if not default on your system)

```puppet
$st2_python_version = $facts['os']['family'] ? {
'RedHat' => '3.6',
'Debian' => 'python3.6',
'RedHat' => '3.8',
'Debian' => 'python3.8',
}
class { 'st2':
python_version => $st2_python_version,
Expand All @@ -2407,8 +2407,8 @@ Data type: `String`

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

Default value: `$st2::python_version`

Expand Down Expand Up @@ -4462,9 +4462,9 @@ High level steps:
- stop stackstorm
## https://docs.mongodb.com/manual/release-notes/3.6-upgrade-standalone/
- set MongoDB feature compatibility to 3.4
- change package repo to 3.6
- change package repo to 3.8
- upgrade packages
- set MongoDB feature compatibility to 3.6
- set MongoDB feature compatibility to 3.8
## https://docs.mongodb.com/manual/release-notes/4.0-upgrade-standalone/
- change package repo to 4.0
- upgrade packages
Expand All @@ -4488,13 +4488,13 @@ bolt plan run st2::upgrade_mongodb --targets ssh_nodes --params '{"mongo_passwor
##### Upgrading from 3.6 to 4.0

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

##### Upgrading from 3.4 to 3.6 to 4.0

```puppet
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"]}'
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"]}'
```

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

Default value: `['3.6', '4.0']`

4 changes: 2 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
#
# # Python 3 testing
# # CentOS/RHEL
# echo -e "class { 'st2': python_version => '3.6' }\n include st2::profile::fullinstall" > apply.pp
# echo -e "class { 'st2': python_version => '3.8' }\n include st2::profile::fullinstall" > apply.pp
# # Ubuntu 18.04 +
# echo -e "class { 'st2': python_version => 'python3.6' }\n include st2::profile::fullinstall" > apply.pp
# echo -e "class { 'st2': python_version => 'python3.8' }\n include st2::profile::fullinstall" > apply.pp
#
# chmod 440 -R /etc/sudoers.d; puppet apply apply.pp; chmod 755 -R /etc/sudoers.d
#
Expand Down
2 changes: 2 additions & 0 deletions build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ build/scripts/install_puppet.sh
# below are the test environments we currently use
build/centos7-puppet6 # Files needed for the RHEL/CentOS 7 test environemnt on puppet 6
build/centos7-puppet7 # Files needed for the RHEL/CentOS 7 test environemnt on puppet 7
build/rocky8-puppet6 # Files needed for the RockyLinux 8 test environemnt on puppet 6
build/rocky8-puppet7 # Files needed for the RockyLinux 8 test environemnt on puppet 7
build/ubuntu18-puppet6 # Files needed for the Ubuntu 18.04 test environemnt on puppet 6
build/ubuntu18-puppet7 # Files needed for the Ubuntu 18.04 test environemnt on puppet 7
build/ubuntu20-puppet6 # Files needed for the Ubuntu 20.04 test environemnt on puppet 6
Expand Down
44 changes: 44 additions & 0 deletions build/rocky8-puppet6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# usage (from the root of the puppet-st2/ directory):
# docker build -t stackstorm/puppet-st2-puppet6 -f build/puppet6/Dockerfile .

FROM stackstorm/packagingtest:rockylinux8-systemd

# install ruby and dependencies for gem install
RUN yum -y install gcc gcc-c++ make which openssl
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
RUN curl -sSL https://get.rvm.io | bash -s stable
RUN /bin/bash -l -c "rvm requirements"
RUN /bin/bash -l -c "rvm install 2.5.1"
RUN /bin/bash -l -c "rvm use 2.5.1 --default"
RUN /bin/bash -l -c "gem install bundler --no-rdoc --no-ri"

# install puppet
RUN yum -y install https://yum.puppet.com/puppet6/puppet6-release-el-7.noarch.rpm
RUN yum -y install puppet-agent
ENV PATH="/opt/puppetlabs/bin:${PATH}"

# print versions (ruby 2.5.x, puppet 6.x)
RUN /bin/bash -l -c "ruby --version"
RUN /bin/bash -l -c "gem --version"
RUN /bin/bash -l -c "bundle --version"
RUN puppet --version

# create our working directory with the code from our repo in it
ENV APP_HOME /puppet_st2
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
COPY . $APP_HOME

# use bundler to install our gems
ENV PUPPET_GEM_VERSION "~> 6.0"
ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
BUNDLE_JOBS=2 \
BUNDLE_PATH=/bundle
RUN /bin/bash -l -c "bundle -v"
RUN /bin/bash -l -c "rm -f ${APP_HOME}/Gemfile.lock"
RUN /bin/bash -l -c "gem update --system"
RUN /bin/bash -l -c "gem --version"
RUN /bin/bash -l -c "bundle -v"
RUN cat $BUNDLE_GEMFILE
RUN /bin/bash -l -c "bundle install --without system_tests"
RUN cat $BUNDLE_GEMFILE.lock
37 changes: 37 additions & 0 deletions build/rocky8-puppet6/Dockerfile.kitchen
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# usage (from the root of the puppet-st2/ directory):
# docker build -t stackstorm/puppet-st2-puppet6 -f build/puppet6/Dockerfile.kitchen .

FROM stackstorm/packagingtest:rockylinux8-systemd

RUN mkdir -p /var/run/sshd
RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %>
RUN echo <%= "#{@username}:#{@password}" %> | chpasswd
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /home/<%= @username %>/.ssh
RUN chown -R <%= @username %> /home/<%= @username %>/.ssh
RUN chmod 0700 /home/<%= @username %>/.ssh
RUN touch /home/<%= @username %>/.ssh/authorized_keys
RUN chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys
RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys
RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys

# upgrade the image, otherwise installing st2 package hangs
RUN yum -y upgrade

# install doc files (/usr/share/docs) when installing yum packages
# otherwise /usr/share/docs/st2/conf/nginx/st2.conf won't be present
# https://github.com/docker-library/docs/tree/master/centos#package-documentation
RUN sed -i '/nodocs/d' /etc/yum.conf

# install puppet
RUN yum -y install https://yum.puppet.com/puppet6/puppet6-release-el-8.noarch.rpm
RUN yum -y install puppet-agent
ENV PATH="/opt/puppetlabs/bin:${PATH}"
RUN ln -s /opt/puppetlabs/bin/facter /usr/bin/
RUN ln -s /opt/puppetlabs/bin/hiera /usr/bin/
RUN ln -s /opt/puppetlabs/bin/mco /usr/bin/
RUN ln -s /opt/puppetlabs/bin/puppet /usr/bin/

# print versions (ruby 2.5.x, puppet 6.x)
RUN puppet --version
RUN sudo -E puppet --version
73 changes: 73 additions & 0 deletions build/rocky8-puppet6/Puppetfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# coding: utf-8
# ################
# # Instructions #
# ################
# yum -y install puppet (or equivalent)
# gem install r10k
# # create a new file ./Puppetfile with the contents of this file
# r10k puppetfile install -v --moduledir=./modules --puppetfile=./Puppetfile
# # to check the module dependencies here:
# # puppet module list --tree --modulepath ./modules/
# puppet apply --modulepath=./modules -e "include st2::profile::fullinstall"
#
# #############
# # DEV Notes #
# #############
# # To generate this file i did this, make sure you have this repo cloned:
# pdk build
# puppet module install ./pkg/stackstorm-st2-x.y.z.tar.gz
# puppet module list --tree
#
# ######################
# # Latest Module Tree #
# ######################
# └─┬ stackstorm-st2 (v1.7.0)
# ├── ghoneycutt-facter (v3.5.0)
# ├── jamtur01-httpauth (v0.0.6)
# ├── npwalker-recursive_file_permissions (v0.6.0)
# ├── puppet-epel (v3.0.1)
# ├── puppet-mongodb (v3.1.0)
# ├─┬ puppet-nginx (v1.1.0)
# │ └── puppetlabs-concat (v6.2.0)
# ├── puppet-nodejs (v7.0.1)
# ├── puppet-python (v4.1.1)
# ├── puppet-redis (v7.0.0)
# ├─┬ puppet-rabbitmq (v10.1.1)
# │ ├── camptocamp-systemd (v2.9.0)
# │ └── puppet-archive (v4.5.0)
# ├── puppet-selinux (v3.2.0)
# ├─┬ puppetlabs-apt (v7.5.0)
# │ └── puppetlabs-translate (v2.2.0)
# ├── puppetlabs-inifile (v4.2.0)
# ├── puppetlabs-stdlib (v5.2.0)
# ├── puppetlabs-yumrepo_core (v1.0.7)
# └── saz-sudo (v6.0.0)
forge "https://forgeapi.puppetlabs.com"

# Current bug: https://github.com/ghoneycutt/puppet-module-facter/issues/70
# in latest release. Pinning to 3.5 until resolved.
mod 'ghoneycutt/facter', '3.5.0'
mod 'jamtur01-httpauth'
mod 'npwalker-recursive_file_permissions'
mod 'puppet-epel'
mod 'puppet-mongodb',
:git => 'https://github.com/voxpupuli/puppet-mongodb.git',
:branch => 'master'
mod 'puppet-nginx'
mod 'puppetlabs-concat' # dependency of puppet-nginx'
mod 'puppet-nodejs'
mod 'puppet-python'
# Using master branch due to new release on hold pending new tests.
mod 'puppet/rabbitmq',
:git => 'https://github.com/voxpupuli/puppet-rabbitmq.git',
:branch => 'master'
mod 'camptocamp-systemd' # dependency of puppet-rabbitmq
mod 'puppet-archive' # dependency of puppet-rabbitmq
mod 'puppet-selinux'
mod 'puppetlabs-apt'
mod 'puppetlabs-translate' # dependency of puppetlabs-apt
mod 'puppetlabs-inifile'
mod 'puppetlabs-stdlib'
mod 'puppetlabs-yumrepo_core'
mod 'saz-sudo'
mod 'puppet/redis'
Loading