diff --git a/.circle/docker-compose2.sh b/.circle/docker-compose2.sh index 244b47b7..9c65cc71 100755 --- a/.circle/docker-compose2.sh +++ b/.circle/docker-compose2.sh @@ -9,6 +9,7 @@ set -e # Source the build environment defintion (details in buildenv.sh) +# shellcheck disable=SC1090 . ~/.buildenv set -x @@ -18,31 +19,31 @@ case "$1" in # containers running from the previous cached build clean) echo Cleaning cached Docker containers which could be there from the previous build ... - docker-compose -f docker-compose.circle2.yml -f docker-compose.override.yml rm -v --stop --force || true + docker compose -f docker-compose.circle2.yml -f docker-compose.override.yml rm -v --stop --force || true ;; # Perform fake command invocation, technically provides images "pull" phase. pull) - echo Pulling dependent Docker images for $2 ... - docker-compose -f docker-compose.circle2.yml -f docker-compose.override.yml pull --include-deps $2 + echo "Pulling dependent Docker images for $2 ..." + docker compose -f docker-compose.circle2.yml -f docker-compose.override.yml pull --include-deps $2 ;; build) - echo Starting Packages Build for $2 ... - docker-compose -f docker-compose.circle2.yml -f docker-compose.override.yml run \ - -e ST2_CHECKOUT=${ST2_CHECKOUT} \ - -e ST2_GITURL=${ST2_GITURL} \ - -e ST2_GITREV=${ST2_GITREV} \ - -e ST2_GITDIR=${ST2_GITDIR} \ - -e ST2PKG_VERSION=${ST2PKG_VERSION} \ - -e ST2PKG_RELEASE=${ST2PKG_RELEASE} \ + echo "Starting Packages Build for $2 ..." + docker compose -f docker-compose.circle2.yml -f docker-compose.override.yml run \ + -e ST2_CHECKOUT="${ST2_CHECKOUT}" \ + -e ST2_GITURL="${ST2_GITURL}" \ + -e ST2_GITREV="${ST2_GITREV}" \ + -e ST2_GITDIR="${ST2_GITDIR}" \ + -e ST2PKG_VERSION="${ST2PKG_VERSION}" \ + -e ST2PKG_RELEASE="${ST2PKG_RELEASE}" \ -e ST2_PACKAGES="${ST2_PACKAGES}" \ - -e ST2_CIRCLE_URL=${CIRCLE_BUILD_URL} \ + -e ST2_CIRCLE_URL="${CIRCLE_BUILD_URL}" \ $2 build ;; test) [ "$TESTING" = 0 ] && { echo "Omitting Tests for $2 ..." ; exit 0; } - echo Starting Tests for $2 ... - docker-compose -f docker-compose.circle2.yml -f docker-compose.override.yml run \ + echo "Starting Tests for $2 ..." + docker compose -f docker-compose.circle2.yml -f docker-compose.override.yml run \ -e ST2_PACKAGES="${ST2_PACKAGES}" \ - $2 test + "$2" test ;; esac diff --git a/.circle/packagecloud.sh b/.circle/packagecloud.sh index 0f44dbfc..56f49037 100755 --- a/.circle/packagecloud.sh +++ b/.circle/packagecloud.sh @@ -37,8 +37,8 @@ function main() { fi ;; *) - echo $"Usage: deploy {focal|el6|el8} /tmp/st2-packages" - echo $"Usage: next-revision {focal|el6|el8} 0.14dev st2" + echo $"Usage: deploy {focal|jammy|el8} /tmp/st2-packages" + echo $"Usage: next-revision {focal|jammy|el8} 0.14dev st2" exit 1 esac } @@ -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|focal) + 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|jammy) PKG_OS_NAME=ubuntu PKG_OS_VERSION=$PKG_OS PKG_TYPE="deb" diff --git a/.circleci/config.yml b/.circleci/config.yml index 57389b61..8cacd892 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ version: 2 jobs: # Build & Test st2 packages packages: - parallelism: 2 + parallelism: 3 # 4CPUs & 8GB RAM CircleCI machine # sadly, it doesn't work with 'setup_remote_docker' resource_class: large @@ -17,7 +17,7 @@ jobs: - image: circleci/python:3.8 working_directory: ~/st2-packages environment: - DISTROS: "focal el8" + DISTROS: "focal jammy el8" 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 @@ -26,10 +26,25 @@ jobs: # ST2_GITREV: "" steps: - checkout + - run: + name: Install latest Docker Compose V2 + command: | + set -x + export CODENAME=$(source /etc/os-release && echo "$VERSION_CODENAME") + export DISTRO=$(source /etc/os-release && echo "$ID") + export ARCH=$(dpkg --print-architecture) + # get gpg key for download.docker + curl -fsSL https://download.docker.com/linux/${DISTRO}/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/download.docker.gpg + # set source list + sudo tee <<<"deb [arch=${ARCH}] https://download.docker.com/linux/${DISTRO} ${CODENAME} stable" /etc/apt/sources.list.d/download.docker.list + # update package list + sudo apt update + # install docker CLI and Docker Compose v2 + sudo apt install docker-ce-cli docker-compose-plugin - setup_remote_docker: - reusable: true # default - false - exclusive: true # default - true - version: 19.03.14 + # reusable: true # default - false + # exclusive: true # default - true + version: docker24 - run: name: Ensure installation scripts are synced with their templates command: make .generated-files-check @@ -38,7 +53,7 @@ jobs: command: | set -x docker --version - docker-compose --version + docker compose --version - run: name: Initialize packages Build Environment command: | @@ -73,7 +88,7 @@ jobs: command: | # Create necessary directories mkdir -p ~/st2-packages/build/${DISTRO}/log/ - + # Run the build .circle/docker-compose2.sh build ${DISTRO} @@ -116,7 +131,7 @@ jobs: - image: circleci/ruby:2.7 working_directory: /tmp/deploy environment: - - DISTROS: "focal el8" + - DISTROS: "focal jammy el8" steps: - attach_workspace: at: . diff --git a/README.md b/README.md index b9d4ad8e..0dda3c6e 100644 --- a/README.md +++ b/README.md @@ -6,18 +6,18 @@ ## Highlights - - **Docker based**. Leveraging docker it's possible to deliver packages for any OS distro in a fast and reliable way. - - [Rake](https://github.com/ruby/rake) + [sshkit](https://github.com/capistrano/sshkit)-based execution enables easy configuration via **simple DSL** and brings **parallel task processing** out of the box. - - **Test-driven workflow**. Artifacts built are not only available for any enabled OS distro but at the same time tested on a bunch of platforms, providing feedback such as can be installed, services can start up, operations can be executed etc. +- **Docker based**. Leveraging docker it's possible to deliver packages for any OS distro in a fast and reliable way. +- [Rake](https://github.com/ruby/rake) + [sshkit](https://github.com/capistrano/sshkit)-based execution enables easy configuration via **simple DSL** and brings **parallel task processing** out of the box. +- **Test-driven workflow**. Artifacts built are not only available for any enabled OS distro but at the same time tested on a bunch of platforms, providing feedback such as can be installed, services can start up, operations can be executed etc. ## Overview -Packages build environment is a *multi-container docker* application defined and managed with [docker-compose](https://github.com/docker/compose). It consists of four types of containers: +Packages build environment is a _multi-container docker_ application defined and managed with [docker-compose](https://github.com/docker/compose). It consists of four types of containers: - - **Packaging runner** (https://quay.io/stackstorm/packagingrunner) - the main entry point, package build and test processing controller container. - - **Packaging build** (https://hub.docker.com/r/stackstorm/packagingbuild/) - container where actual `.deb`/`.rpm` artifacts build takes place. It's used to bring up the build environment specific for OS distro. This means that different containers are available such as *packagingbuild:rocky8*, *packagingbuild:focal* correspondingly for RockyLinux 8 and Ubuntu Focal. - - **Packaging test** (https://hub.docker.com/r/stackstorm/packagingtest/) - containers where built artifacts are tested, i.e. *artifacts are installed, configuration is written and tests are performed*. - - **Services** - these are different containers required for testing such as *rabbitmq and mongodb* +- **Packaging runner** (https://quay.io/stackstorm/packagingrunner) - the main entry point, package build and test processing controller container. +- **Packaging build** (https://hub.docker.com/r/stackstorm/packagingbuild/) - container where actual `.deb`/`.rpm` artifacts build takes place. It's used to bring up the build environment specific for OS distro. This means that different containers are available such as _packagingbuild:rocky8_, _packagingbuild:focal_, _packagingbuild:jammy_, correspondingly for RockyLinux 8, Ubuntu Focal, and Ubuntu Jammy. +- **Packaging test** (https://hub.docker.com/r/stackstorm/packagingtest/) - containers where built artifacts are tested, i.e. _artifacts are installed, configuration is written and tests are performed_. +- **Services** - these are different containers required for testing such as _rabbitmq and mongodb_ `Dockerfiles` sources are available at [StackStorm/st2-dockerfiles](https://github.com/stackstorm/st2-dockerfiles). @@ -29,11 +29,11 @@ It's very simple to invoke the whole build-test pipeline. First just make sure t ```shell # (Optional) First clean out previous build containers -docker-compose kill -docker-compose rm -f +docker compose kill +docker compose rm -f -# To build packages for ubuntu focal (--rm will wipe packaging runner container. All others will remain active). -docker-compose run --rm focal +# To build packages for ubuntu jammy (--rm will wipe packaging runner container. All others will remain active). +docker compose run --rm jammy ``` Execution takes a while, so grab a cup of tea or coffee and wait until it finishes. When build and test processes succeed, you'll find the StackStorm packages in `/tmp/st2-packages` on your host machine: @@ -47,38 +47,39 @@ ls -l1 | grep ".deb$" After the build and test stages are finished all docker containers remain active, so you are welcome to do more in-depth testing if desired. To do so simply run: -``` +```shell docker ps # Find the required testing container -# In our case it will be st2packages_focaltest_1 +# In our case it will be st2packages_jammytest_1 # Simply exec to docker -docker exec -it st2packages_focaltest_1 bash +docker exec -it st2packages_jammytest_1 bash ``` Once done, you are inside the testing environment where all services are up and running. Don't forget to do (after exec): -``` +```shell export TERM=xterm ``` + At this point you can do any manual testing which is required. # Vagrant based build and test In order to build, package, install and test ST2 in an isolated Vagrant VM, run the following: -``` +```shell vagrant up $TARGET ``` -Where `$TARGET` is one of `focal`, or `el8`. If you are using `el8`, comment +Where `$TARGET` is one of `focal`, `jammy`, 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`. The following steps are run while provisioning the Vagrant VM: 1. Install `docker` and `docker-compose`. -2. Run `docker-compose run --rm $TARGET` to build, test and package ST2 as described in prior +2. Run `docker compose run --rm $TARGET` to build, test and package ST2 as described in prior sections. 3. Install the packages built in step 2, unless the host `$ST2_INSTALL` environment variable is set to a value other than `yes`. @@ -90,66 +91,65 @@ consider allowing the host to provide existing ST2 packages, and install/self-ch Vagrant VM. To specify the ST2 source URL and REV (i.e., branch), use `ST2_GITURL` and `ST2_GITREV` environment -variables on the host prior to provisioning the VM. +variables on the host prior to provisioning the VM. -Prior to running `st2-self-check`, the required auth token is generated using `st2 auth`. If necessary, -you can change the default username and password passed to `st2 auth`. To do this, set the `ST2USER` +Prior to running `st2-self-check`, the required auth token is generated using `st2 auth`. If necessary, +you can change the default username and password passed to `st2 auth`. To do this, set the `ST2USER` and `ST2PASSWORD` environment variables on the host prior to provisioning the VM. The default values are `st2admin` and `Ch@ngeMe` respectively. # Installation + Current community packages are hosted on https://packagecloud.io/StackStorm. For detailed instructions how install st2 and perform basic configuration follow these instructions: + - [Ubuntu/Debian](https://docs.stackstorm.com/install/deb.html) - [RHEL8/RockyLinux8](https://docs.stackstorm.com/install/rhel8.html) ## Adding Support For a New Distribution -If you are adding support for a new distribution for which ``packagingbuild`` and ``packagingtest`` +If you are adding support for a new distribution for which `packagingbuild` and `packagingtest` images are not yet published to Docker Hub and you want to test the build pipeline locally, you -need to update ``docker-compose.yml`` file to use locally built Docker images. +need to update `docker-compose.yml` file to use locally built Docker images. For example: ```yaml -... - -focal: - ... - image: quay.io/stackstorm/packagingrunner - ... -... - -focalbuild: - ... - image: focalbuild +services: ... - -... - -focaltest: + jammy: + ... + image: quay.io/stackstorm/packagingrunner + ... ... - image: focaltest + jammybuild: + ... + image: jammybuild + ... ... + jammytest: + ... + image: jammytest + ... ``` -NOTE: Main ``distro`` definition (e.g. ``focal``, etc.) needs to use packaging runner image. +NOTE: Main `distro` definition (e.g. `jammy`, etc.) needs to use packaging runner image. -As you can see, ``image`` attribute references local image tagged ``focalbuild`` instead of a -remote image (e.g. ``stackstorm/packagingbuild:focal`` or similar). +As you can see, `image` attribute references local image tagged `jammybuild` instead of a +remote image (e.g. `stackstorm/packagingbuild:jammy` or similar). Before that will work, you of course also need to build those images locally. For example: ```bash -cd ~/st2packaging-dockerfiles/packagingbuild/focal -docker build -t focalbuild . +cd ~/st2packaging-dockerfiles/packagingbuild/jammy +docker build -t jammybuild . -cd ~/st2packaging-dockerfiles/packagingtest/focal/systemd -docker build -t focaltest . +cd ~/st2packaging-dockerfiles/packagingtest/jammy/systemd +docker build -t jammytest . ``` # License and Authors -* Author:: StackStorm (st2-dev) () -* Author:: Denis Baryshev () +- Author:: StackStorm (st2-dev) () +- Author:: Denis Baryshev () diff --git a/Vagrantfile b/Vagrantfile index 18e9a1b7..072c8850 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,6 +5,11 @@ VAGRANTFILE_API_VERSION = "2" VIRTUAL_MACHINES = { + :jammy => { + :hostname => 'st2-packages-jammy', + :box => 'ubuntu/jammy64', + :ip => '192.168.16.26', + }, :focal => { :hostname => 'st2-packages-focal', :box => 'ubuntu/focal64', diff --git a/docker-compose.circle.yml b/docker-compose.circle.yml index d8e0f48e..ba5b4da9 100644 --- a/docker-compose.circle.yml +++ b/docker-compose.circle.yml @@ -1,64 +1,95 @@ -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 - - redis +version: "2.1" +services: + 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 + - redis -el8: - image: quay.io/stackstorm/packagingrunner - extends: - file: docker-compose.override.yml - service: suite-compose - environment: - - BUILDNODE=rockylinux8build - - TESTNODE=rockylinux8test - - ST2_PACKAGES=st2 - links: - - rockylinux8build - - rockylinux8test - - rabbitmq - - mongodb - - redis + jammy: + image: quay.io/stackstorm/packagingrunner + extends: + file: docker-compose.override.yml + service: suite-compose + environment: + - BUILDNODE=jammybuild + - TESTNODE=jammytest + - ST2_PACKAGES=st2 + links: + - jammybuild + - jammytest + - rabbitmq + - mongodb + - redis -## Package build nodes -# -focalbuild: - image: stackstorm/packagingbuild:focal - volumes_from: - - st2-packages-vol + el8: + image: quay.io/stackstorm/packagingrunner + extends: + file: docker-compose.override.yml + service: suite-compose + environment: + - BUILDNODE=rockylinux8build + - TESTNODE=rockylinux8test + - ST2_PACKAGES=st2 + links: + - rockylinux8build + - rockylinux8test + - rabbitmq + - mongodb + - redis -rockylinux8build: - image: stackstorm/packagingbuild:rockylinux8 - extends: - file: docker-compose.override.yml - service: volumes-compose + ## Package build nodes + # + focalbuild: + image: stackstorm/packagingbuild:focal + volumes_from: + - container:st2-packages-vol -## Package testing nodes -# -focaltest: - image: stackstorm/packagingtest:focal-systemd - privileged: true - volumes_from: - - st2-packages-vol - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + jammybuild: + image: stackstorm/packagingbuild:jammy + volumes_from: + - container:st2-packages-vol -rockylinux8test: - image: stackstorm/packagingtest:rockylinux8-systemd - privileged: true - cap_add: - - SYS_ADMIN - security_opt: - - seccomp:unconfined - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup + rockylinux8build: + image: stackstorm/packagingbuild:rockylinux8 + extends: + file: docker-compose.override.yml + service: volumes-compose + + ## Package testing nodes + # + focaltest: + image: stackstorm/packagingtest:focal-systemd + privileged: true + volumes_from: + - container:st2-packages-vol + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + jammytest: + image: stackstorm/packagingtest:jammy-systemd + privileged: true + volumes_from: + - container:st2-packages-vol + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + rockylinux8test: + image: stackstorm/packagingtest:rockylinux8-systemd + privileged: true + cap_add: + - SYS_ADMIN + security_opt: + - seccomp:unconfined + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup diff --git a/docker-compose.circle2.yml b/docker-compose.circle2.yml index c070f87e..6d862fe2 100644 --- a/docker-compose.circle2.yml +++ b/docker-compose.circle2.yml @@ -1,64 +1,95 @@ -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 - - redis +version: "2.1" +services: + focal: + image: quay.io/stackstorm/packagingrunner + working_dir: /root/st2-packages + volumes_from: + - container:st2-packages-vol + environment: + - BUILDNODE=focalbuild + - TESTNODE=focaltest + - ST2_PACKAGES=st2 + links: + - focalbuild + - focaltest + - rabbitmq + - mongodb + - redis -el8: - image: quay.io/stackstorm/packagingrunner - working_dir: /root/st2-packages - volumes_from: - - st2-packages-vol - environment: - - BUILDNODE=rockylinux8build - - TESTNODE=rockylinux8test - links: - - rockylinux8build - - rockylinux8test - - rabbitmq - - mongodb - - redis + jammy: + image: quay.io/stackstorm/packagingrunner + working_dir: /root/st2-packages + volumes_from: + - container:st2-packages-vol + environment: + - BUILDNODE=jammybuild + - TESTNODE=jammytest + - ST2_PACKAGES=st2 + links: + - jammybuild + - jammytest + - rabbitmq + - mongodb + - redis -## Package build nodes -# -focalbuild: - image: stackstorm/packagingbuild:focal - volumes_from: - - st2-packages-vol + el8: + image: quay.io/stackstorm/packagingrunner + working_dir: /root/st2-packages + volumes_from: + - container:st2-packages-vol + environment: + - BUILDNODE=rockylinux8build + - TESTNODE=rockylinux8test + links: + - rockylinux8build + - rockylinux8test + - rabbitmq + - mongodb + - redis -rockylinux8build: - image: stackstorm/packagingbuild:rockylinux8 - volumes_from: - - st2-packages-vol + ## Package build nodes + # + focalbuild: + image: stackstorm/packagingbuild:focal + volumes_from: + - container:st2-packages-vol -## Package testing nodes -# -focaltest: - image: stackstorm/packagingtest:focal-systemd - privileged: true - volumes_from: - - st2-packages-vol - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + jammybuild: + image: stackstorm/packagingbuild:jammy + volumes_from: + - container:st2-packages-vol -rockylinux8test: - image: stackstorm/packagingtest:rockylinux8-systemd - privileged: true - cap_add: - - SYS_ADMIN - security_opt: - - seccomp:unconfined - volumes_from: - - st2-packages-vol - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup + rockylinux8build: + image: stackstorm/packagingbuild:rockylinux8 + volumes_from: + - container:st2-packages-vol + + ## Package testing nodes + # + focaltest: + image: stackstorm/packagingtest:focal-systemd + privileged: true + volumes_from: + - container:st2-packages-vol + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + jammytest: + image: stackstorm/packagingtest:jammy-systemd + privileged: true + volumes_from: + - container:st2-packages-vol + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + rockylinux8test: + image: stackstorm/packagingtest:rockylinux8-systemd + privileged: true + cap_add: + - SYS_ADMIN + security_opt: + - seccomp:unconfined + volumes_from: + - container:st2-packages-vol + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 95fe178a..0fbb2cf2 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,56 +1,59 @@ -## Suites configuration -# -suite: - image: fake - working_dir: /root/st2-packages - environment: - - DEBUG_LEVEL=0 - volumes: - - .:/root/st2-packages - - /tmp/st2-packages:/root/build - -suite-compose: - image: fake - extends: - file: docker-compose.override.yml - service: suite - -suite-circle: - image: fake - command: build - extends: - file: docker-compose.override.yml - service: suite - -## Volumes passed during compose or ci builds -# -volumes-compose: - image: fake - volumes: - - /tmp/st2-packages:/root/build - -volumes-circle: - image: fake - volumes: - - /tmp/st2-packages:/root/build - - /tmp/st2-packages/log/st2:/var/log/st2 - -## Service used by st2 -# -rabbitmq: - image: rabbitmq:3.9-management - privileged: true - hostname: rabbit - ports: - - "15672:15672" # managment plugin port - - "5672:5672" - -mongodb: - image: mongo:4.0 - ports: - - "27017:27017" - -redis: - image: redis:6.2.11 - ports: - - "6379:6379" +version: "2.1" # https://docs.docker.com/compose/compose-file/compose-file-v2/ + +services: + ## Suites configuration + # + suite: + image: fake + working_dir: /root/st2-packages + environment: + - DEBUG_LEVEL=0 + volumes: + - .:/root/st2-packages + - /tmp/st2-packages:/root/build + + suite-compose: + image: fake + extends: + # file: docker-compose.override.yml + service: suite + + suite-circle: + image: fake + command: build + extends: + # file: docker-compose.override.yml + service: suite + + ## Volumes passed during compose or ci builds + # + volumes-compose: + image: fake + volumes: + - /tmp/st2-packages:/root/build + + volumes-circle: + image: fake + volumes: + - /tmp/st2-packages:/root/build + - /tmp/st2-packages/log/st2:/var/log/st2 + + ## Service used by st2 + # + rabbitmq: + image: rabbitmq:3.9-management + privileged: true + hostname: rabbit + ports: + - "15672:15672" # managment plugin port + - "5672:5672" + + mongodb: + image: mongo:4.0 + ports: + - "27017:27017" + + redis: + image: redis:6.2.11 + ports: + - "6379:6379" diff --git a/docker-compose.yml b/docker-compose.yml index 46e75191..205d7caf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,70 +1,138 @@ -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 - - redis +version: "2.1" # https://docs.docker.com/compose/compose-file/compose-file-v2/ -el8: - image: quay.io/stackstorm/packagingrunner - extends: - file: docker-compose.override.yml - service: suite-compose - environment: - - BUILDNODE=rockylinux8build - - TESTNODE=rockylinux8test - - ST2_PACKAGES=st2 - links: - - rockylinux8build - - rockylinux8test - - rabbitmq - - mongodb - - redis +services: -## Package build nodes -# -focalbuild: - image: stackstorm/packagingbuild:focal - extends: - file: docker-compose.override.yml - service: volumes-compose + 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 + - redis -rockylinux8build: - image: stackstorm/packagingbuild:rockylinux8 - extends: - file: docker-compose.override.yml - service: volumes-compose + jammy: + image: quay.io/stackstorm/packagingrunner + extends: + file: docker-compose.override.yml + service: suite-compose + environment: + - BUILDNODE=jammybuild + - TESTNODE=jammytest + - ST2_PACKAGES=st2 + links: + - jammybuild + - jammytest + - rabbitmq + - mongodb + - redis -## Package testing nodes -# -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 + el8: + image: quay.io/stackstorm/packagingrunner + extends: + file: docker-compose.override.yml + service: suite-compose + environment: + - BUILDNODE=rockylinux8build + - TESTNODE=rockylinux8test + - ST2_PACKAGES=st2 + links: + - rockylinux8build + - rockylinux8test + - rabbitmq + - mongodb + - redis -rockylinux8test: - image: stackstorm/packagingtest:rockylinux8-systemd - privileged: true - cap_add: - - SYS_ADMIN - security_opt: - - seccomp:unconfined - extends: - file: docker-compose.override.yml - service: volumes-compose - volumes: - - /sys/fs/cgroup:/sys/fs/cgroup + rockylinux9: + image: quay.io/stackstorm/packagingrunner + extends: + file: docker-compose.override.yml + service: suite-compose + environment: + - BUILDNODE=rockylinux9build + - TESTNODE=rockylinux9test + - ST2_PACKAGES=st2 + links: + - rockylinux9build + - rockylinux9test + - rabbitmq + - mongodb + - redis + + ## Package build nodes + # + focalbuild: + image: stackstorm/packagingbuild:focal + extends: + file: docker-compose.override.yml + service: volumes-compose + + jammybuild: + image: stackstorm/packagingbuild:jammy + extends: + file: docker-compose.override.yml + service: volumes-compose + + rockylinux8build: + image: stackstorm/packagingbuild:rockylinux8 + extends: + file: docker-compose.override.yml + service: volumes-compose + rockylinux9build: + image: stackstorm/packagingbuild:rockylinux9 + extends: + file: docker-compose.override.yml + service: volumes-compose + + ## Package testing nodes + # + 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 + + jammytest: + image: stackstorm/packagingtest:jammy-systemd + privileged: true + extends: + file: docker-compose.override.yml + service: volumes-compose + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup:ro + + rockylinux8test: + image: stackstorm/packagingtest:rockylinux8-systemd + privileged: true + cap_add: + - SYS_ADMIN + security_opt: + - seccomp:unconfined + extends: + file: docker-compose.override.yml + service: volumes-compose + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup + rockylinux9test: + image: stackstorm/packagingtest:rockylinux9-systemd + privileged: true + cap_add: + - SYS_ADMIN + security_opt: + - seccomp:unconfined + extends: + file: docker-compose.override.yml + service: volumes-compose + volumes: + - /sys/fs/cgroup:/sys/fs/cgroup