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

Add Ubuntu 20.04 (focal) support #700

Merged
merged 11 commits into from
May 11, 2021
6 changes: 3 additions & 3 deletions .circle/packagecloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ function main() {
fi
;;
*)
echo $"Usage: deploy {trusty|xenial|bionic|el6|el7|el8} /tmp/st2-packages"
echo $"Usage: next-revision {trusty|xenial|bionic|el6|el7|el8} 0.14dev st2"
echo $"Usage: deploy {xenial|bionic|focal|el6|el7|el8} /tmp/st2-packages"
echo $"Usage: next-revision {xenial|bionic|focal|el6|el7|el8} 0.14dev st2"
exit 1
esac
}
Expand Down Expand Up @@ -230,7 +230,7 @@ function get_pkg_os() {
PKG_OS_VERSION=$PKG_OS
PKG_TYPE="deb"
;;
warty|hoary|breezy|dapper|edgy|feisty|gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|bionic)
warty|hoary|breezy|dapper|edgy|feisty|gutsy|hardy|intrepid|jaunty|karmic|lucid|maverick|natty|oneiric|precise|quantal|raring|saucy|trusty|utopic|vivid|wily|xenial|bionic|focal)
PKG_OS_NAME=ubuntu
PKG_OS_VERSION=$PKG_OS
PKG_TYPE="deb"
Expand Down
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
jobs:
# Build & Test st2 packages
packages:
parallelism: 4
parallelism: 5
# 4CPUs & 8GB RAM CircleCI machine
# sadly, it doesn't work with 'setup_remote_docker'
resource_class: large
Expand All @@ -17,7 +17,7 @@ jobs:
- image: circleci/python:3.6
working_directory: ~/st2-packages
environment:
DISTROS: "xenial bionic el7 el8"
DISTROS: "xenial bionic focal el7 el8"
arm4b marked this conversation as resolved.
Show resolved Hide resolved
BASH_ENV: ~/.buildenv
# These should be set to an empty string, so that st2cd prep tasks are able to replace these
# with real gitrevs during releases. Note that they are commented out, so that they do not interfere
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- image: circleci/ruby:2.4
working_directory: /tmp/deploy
environment:
- DISTROS: "xenial bionic el7 el8"
- DISTROS: "xenial bionic focal el7 el8"
steps:
- attach_workspace:
at: .
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ In order to build, package, install and test ST2 in an isolated Vagrant VM, run
vagrant up $TARGET
```

Where `$TARGET` is one of `xenial`, `bionic`, `el7`, or `el8`. If you are using `el8`, comment out the
`vm_config.vm.provision :docker` line in the Vagrantfile. There is logic in `setup-vagrant.sh` to
install docker in `el8`.
Where `$TARGET` is one of `xenial`, `bionic`, `focal`, `el7`, or `el8`. If you are using `el8`, comment
out the `vm_config.vm.provision :docker` line in the Vagrantfile. There is logic in `setup-vagrant.sh`
to install docker in `el8`.
arm4b marked this conversation as resolved.
Show resolved Hide resolved

The following steps are run while provisioning the Vagrant VM:

Expand Down
7 changes: 6 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ VIRTUAL_MACHINES = {
:box => 'ubuntu/xenial64',
:ip => '192.168.16.21',
},
:bionic=> {
:bionic => {
:hostname => 'st2-packages-bionic',
:box => 'ubuntu/bionic64',
:ip => '192.168.16.23',
},
:focal => {
:hostname => 'st2-packages-focal',
:box => 'ubuntu/focal64',
:ip => '192.168.16.25',
},
:el7 => {
:hostname => 'st2-packages-el7',
:box => 'centos/7',
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ bionic:
- rabbitmq
- mongodb

focal:
image: quay.io/stackstorm/packagingrunner
extends:
file: docker-compose.override.yml
service: suite-compose
environment:
- BUILDNODE=focalbuild
- TESTNODE=focaltest
- ST2_PACKAGES=st2
links:
- focalbuild
- focaltest
- rabbitmq
- mongodb

el8:
image: quay.io/stackstorm/packagingrunner
extends:
Expand Down Expand Up @@ -65,6 +80,11 @@ bionicbuild:
volumes_from:
- st2-packages-vol

focalbuild:
image: stackstorm/packagingbuild:focal
volumes_from:
- st2-packages-vol

centos7build:
image: stackstorm/packagingbuild:centos7
extends:
Expand Down Expand Up @@ -96,6 +116,14 @@ bionictest:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

focaltest:
image: stackstorm/packagingtest:focal-systemd
privileged: true
volumes_from:
- st2-packages-vol
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

centos7test:
image: stackstorm/packagingtest:centos7-systemd
extends:
Expand Down
28 changes: 28 additions & 0 deletions docker-compose.circle2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ bionic:
- rabbitmq
- mongodb

focal:
image: quay.io/stackstorm/packagingrunner
working_dir: /root/st2-packages
volumes_from:
- st2-packages-vol
environment:
- BUILDNODE=focalbuild
- TESTNODE=focaltest
- ST2_PACKAGES=st2
links:
- focalbuild
- focaltest
- rabbitmq
- mongodb

el8:
image: quay.io/stackstorm/packagingrunner
working_dir: /root/st2-packages
Expand Down Expand Up @@ -67,6 +82,11 @@ bionicbuild:
volumes_from:
- st2-packages-vol

focalbuild:
image: stackstorm/packagingbuild:focal
volumes_from:
- st2-packages-vol

centos7build:
image: stackstorm/packagingbuild:centos7
volumes_from:
Expand Down Expand Up @@ -95,6 +115,14 @@ bionictest:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

focaltest:
image: stackstorm/packagingtest:focal-systemd
privileged: true
volumes_from:
- st2-packages-vol
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

centos7test:
image: stackstorm/packagingtest:centos7-systemd
privileged: true
Expand Down
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ bionic:
- rabbitmq
- mongodb

focal:
image: quay.io/stackstorm/packagingrunner
extends:
file: docker-compose.override.yml
service: suite-compose
environment:
- BUILDNODE=focalbuild
- TESTNODE=focaltest
- ST2_PACKAGES=st2
links:
- focalbuild
- focaltest
- rabbitmq
- mongodb

el8:
image: quay.io/stackstorm/packagingrunner
extends:
Expand Down Expand Up @@ -71,6 +86,12 @@ bionicbuild:
file: docker-compose.override.yml
service: volumes-compose

focalbuild:
image: stackstorm/packagingbuild:focal
extends:
file: docker-compose.override.yml
service: volumes-compose

centos7build:
image: stackstorm/packagingbuild:centos7
extends:
Expand Down Expand Up @@ -103,6 +124,15 @@ bionictest:
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

focaltest:
image: stackstorm/packagingtest:focal-systemd
privileged: true
extends:
file: docker-compose.override.yml
service: volumes-compose
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro

centos7test:
image: stackstorm/packagingtest:centos7-systemd
privileged: true
Expand Down
3 changes: 3 additions & 0 deletions packages/st2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ endif
ifeq ($(DEB_DISTRO),bionic)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3.6
else ifeq ($(DEB_DISTRO),focal)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3.8
else ifeq ($(DEB_DISTRO),xenial)
PYTHON_BINARY := /usr/bin/python3.6
PIP_BINARY := /usr/local/bin/pip3.6
Expand Down
3 changes: 3 additions & 0 deletions packages/st2/component.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ endif
ifeq ($(DEB_DISTRO),bionic)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3.6
else ifeq ($(DEB_DISTRO),focal)
PYTHON_BINARY := /usr/bin/python3
PIP_BINARY := /usr/local/bin/pip3.8
else ifeq ($(DEB_DISTRO),xenial)
PYTHON_BINARY := /usr/bin/python3.6
PIP_BINARY := /usr/local/bin/pip3.6
Expand Down
2 changes: 1 addition & 1 deletion packages/st2/debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Section: Python
Priority: optional
Maintainer: StackStorm Engineering <[email protected]>
Build-Depends: debhelper (>= 9),
python,
python3,
dh-virtualenv (>= 0.8),
libldap2-dev,
libsasl2-dev
Expand Down
6 changes: 6 additions & 0 deletions packages/st2/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ DEB_DISTRO := $(shell lsb_release -cs)
ifeq ($(DEB_DISTRO),bionic)
BUILD_PRE_DEPENDS := python3 (>= 3.6)
BUILD_DEPENDS := python3-distutils, python3-dev
else ifeq ($(DEB_DISTRO),focal)
BUILD_PRE_DEPENDS := python3 (>= 3.8)
BUILD_DEPENDS := python3-distutils, python3-dev
else ifeq ($(DEB_DISTRO),xenial)
BUILD_PRE_DEPENDS := python3.6 (>= 3.6)
BUILD_DEPENDS := python3.6-dev
Expand All @@ -29,6 +32,8 @@ endif
# Use Python 3 binary on Ubuntu Bionic
ifeq ($(DEB_DISTRO),bionic)
dh $@ --with python-virtualenv --python /usr/bin/python3.6
else ifeq ($(DEB_DISTRO),focal)
dh $@ --with python-virtualenv --python /usr/bin/python3.8
else ifeq ($(DEB_DISTRO),xenial)
dh $@ --with python-virtualenv --python /usr/bin/python3.6
endif
Expand Down Expand Up @@ -71,6 +76,7 @@ override_dh_virtualenv:
# NB! Use '--copies' else /opt/stackstorm/st2/bin/python is symlink to
# /usr/bin/pythonx rather than copy - and this breaks pack install
# which follows the path to calculate the location of the bin directory

dh_virtualenv --extra-virtualenv-arg='--copies' --extra-virtualenv-arg='--no-download' \
'--upgrade-pip-to=$(PIP_VERSION)' \
--extra-pip-arg '--find-links=$(WHEELDIR)' \
Expand Down
2 changes: 1 addition & 1 deletion rake/spec/default/50-installed-cli-versions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
describe 'st2 cli version checks' do
describe command("st2 --version") do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { should match /on Python 3.6/ }
its(:stdout) { should match /on Python 3.[68]/ }
# show version number in Rspec output
after(:all) do
puts puts " " + described_class.stderr
Expand Down
2 changes: 1 addition & 1 deletion scripts/includes/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function configure_proxy() {
function get_package_url() {
# Retrieve direct package URL for the provided dev build, subtype and package name regex.
DEV_BUILD=$1 # Repo name and build number - <repo name>/<build_num> (e.g. st2/5646)
DISTRO=$2 # Distro name (e.g. xenial,bionic,el7,el8)
DISTRO=$2 # Distro name (e.g. xenial,bionic,focal,el7,el8)
PACKAGE_NAME_REGEX=$3

PACKAGES_METADATA=$(curl -sSL -q https://circleci.com/api/v1.1/project/github/StackStorm/${DEV_BUILD}/artifacts)
Expand Down
4 changes: 2 additions & 2 deletions scripts/st2_bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ elif [[ -n "$DEBTEST" ]]; then
echo "*** Detected Distro is ${DEBTEST} ***"
SUBTYPE=`lsb_release -a 2>&1 | grep Codename | grep -v "LSB" | awk '{print $2}'`
echo "*** Detected flavor ${SUBTYPE} ***"
if [[ "$SUBTYPE" != 'xenial' && "$SUBTYPE" != 'bionic' ]]; then
echo "Unsupported ubuntu flavor ${SUBTYPE}. Please use 16.04 (xenial) or 18.04 (bionic) as base system!"
if [[ "$SUBTYPE" != 'xenial' && "$SUBTYPE" != 'focal' && "$SUBTYPE" != 'bionic' ]]; then
echo "Unsupported ubuntu codename ${SUBTYPE}. Please use 16.04 (xenial) or Ubuntu 18.04 (bionic) or Ubuntu 20.04 (focal) as base system!"
exit 2
fi
ST2BOOTSTRAP="${BASE_PATH}/${BRANCH}/scripts/st2bootstrap-deb.sh"
Expand Down
26 changes: 9 additions & 17 deletions scripts/st2bootstrap-deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ DEV_BUILD=''
USERNAME=''
PASSWORD=''
U16_ADD_INSECURE_PY3_PPA=0
SUBTYPE=`lsb_release -a 2>&1 | grep Codename | grep -v "LSB" | awk '{print $2}'`
SUBTYPE=`lsb_release -cs`
blag marked this conversation as resolved.
Show resolved Hide resolved

if [[ "$SUBTYPE" != 'xenial' && "$SUBTYPE" != 'bionic' ]]; then
echo "Unsupported ubuntu flavor ${SUBTYPE}. Please use 16.04 (xenial) or Ubuntu 18.04 (bionic) as base system!"
if [[ "$SUBTYPE" != 'xenial' && "$SUBTYPE" != 'focal' && "$SUBTYPE" != 'bionic' ]]; then
echo "Unsupported ubuntu codename ${SUBTYPE}. Please use 16.04 (xenial) or Ubuntu 18.04 (bionic) or Ubuntu 20.04 (focal) as base system!"
exit 2
fi


setup_args() {
for i in "$@"
do
Expand Down Expand Up @@ -180,7 +179,7 @@ function configure_proxy() {
function get_package_url() {
# Retrieve direct package URL for the provided dev build, subtype and package name regex.
DEV_BUILD=$1 # Repo name and build number - <repo name>/<build_num> (e.g. st2/5646)
DISTRO=$2 # Distro name (e.g. xenial,bionic,el7,el8)
DISTRO=$2 # Distro name (e.g. xenial,bionic,focal,el7,el8)
PACKAGE_NAME_REGEX=$3

PACKAGES_METADATA=$(curl -sSL -q https://circleci.com/api/v1.1/project/github/StackStorm/${DEV_BUILD}/artifacts)
Expand Down Expand Up @@ -462,7 +461,7 @@ install_st2_dependencies() {
sudo apt-get update

# Note: gnupg-curl is needed to be able to use https transport when fetching keys
if [[ "$SUBTYPE" != 'bionic' ]]; then
if [[ "$SUBTYPE" = 'xenial' ]]; then
arm4b marked this conversation as resolved.
Show resolved Hide resolved
sudo apt-get install -y gnupg-curl
fi

Expand All @@ -483,19 +482,15 @@ install_rabbitmq() {
# Configure RabbitMQ to listen on localhost only
sudo sh -c 'echo "RABBITMQ_NODE_IP_ADDRESS=127.0.0.1" >> /etc/rabbitmq/rabbitmq-env.conf'

if [[ "$SUBTYPE" == 'xenial' || "${SUBTYPE}" == "bionic" ]]; then
sudo systemctl restart rabbitmq-server
else
sudo service rabbitmq-server restart
fi
sudo systemctl restart rabbitmq-server
arm4b marked this conversation as resolved.
Show resolved Hide resolved

}

install_mongodb() {
# Add key and repo for the latest stable MongoDB 4.0
wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add -
echo "deb http://repo.mongodb.org/apt/ubuntu ${SUBTYPE}/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list


# Install MongoDB 4.0
sudo apt-get update
sudo apt-get install -y mongodb-org
Expand Down Expand Up @@ -540,11 +535,8 @@ EOF
sudo sh -c 'printf "security:\n authorization: enabled\n" >> /etc/mongod.conf'

# MongoDB needs to be restarted after enabling auth
if [[ "$SUBTYPE" == 'xenial' || "${SUBTYPE}" == "bionic" ]]; then
sudo systemctl restart mongod
else
sudo service mongod restart
fi
sudo systemctl restart mongod


}

Expand Down
Loading