Skip to content

Commit f0c22ab

Browse files
authored
Merge branch 'master' into issue-4928
2 parents 13189ad + 6326a85 commit f0c22ab

File tree

500 files changed

+7732
-7988
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

500 files changed

+7732
-7988
lines changed

.circleci/config.yml

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
# 'machine' executor runs Unit tests ~x1.5 faster, comparing to 'docker' executor
99
# but the fastest is still ~x1.5-2 slower, comparing to Travis
1010
machine: true
11-
parallelism: 4
11+
parallelism: 3
1212
working_directory: ~/st2
1313
steps:
1414
- checkout
@@ -43,8 +43,8 @@ jobs:
4343
# Run st2 Integration tests
4444
integration:
4545
docker:
46-
- image: circleci/python:3.6
47-
- image: mongo:4.0
46+
- image: circleci/python:3.8
47+
- image: mongo:4.4
4848
- image: rabbitmq:3
4949
working_directory: ~/st2
5050
steps:
@@ -57,8 +57,9 @@ jobs:
5757
name: Install Mongo Shell
5858
command: |
5959
set -x
60-
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
61-
echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/4.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
60+
sudo apt-get -qq -y install gnupg curl
61+
curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/mongodb-server-4.4.gpg
62+
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list
6263
sudo apt-get -qq -y update
6364
sudo apt-get -qq -y install mongodb-org-shell
6465
- run:
@@ -79,8 +80,8 @@ jobs:
7980
# Run st2 Lint Checks
8081
lint:
8182
docker:
82-
- image: circleci/python:3.6
83-
- image: mongo:4.0
83+
- image: circleci/python:3.8
84+
- image: mongo:4.4
8485
- image: rabbitmq:3
8586
working_directory: ~/st2
8687
steps:
@@ -107,33 +108,48 @@ jobs:
107108

108109
# Build & Test st2 packages
109110
packages:
110-
parallelism: 4
111+
parallelism: 3
111112
# 4CPUs & 8GB RAM CircleCI machine
112113
# sadly, it doesn't work with 'setup_remote_docker'
113114
resource_class: large
114115
docker:
115116
# The primary container is an instance of the first list image listed. Your build commands run in this container.
116-
- image: circleci/python:3.6
117+
- image: circleci/python:3.8
117118
working_directory: ~/st2
118119
environment:
119-
- DISTROS: "bionic focal el7 el8"
120+
- DISTROS: "focal el8 el9"
120121
- ST2_PACKAGES_REPO: https://github.com/StackStorm/st2-packages
121122
- ST2_PACKAGES: "st2"
122123
- ST2_CHECKOUT: 0
123124
- ST2_GITDIR: /tmp/st2
124125
- BASH_ENV: ~/.buildenv
125126
steps:
126127
- checkout
128+
- run:
129+
name: Install latest Docker Compose V2
130+
command: |
131+
set -x
132+
export CODENAME=$(source /etc/os-release && echo "$VERSION_CODENAME")
133+
export DISTRO=$(source /etc/os-release && echo "$ID")
134+
export ARCH=$(dpkg --print-architecture)
135+
# get gpg key for download.docker
136+
curl -fsSL https://download.docker.com/linux/${DISTRO}/gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/download.docker.gpg
137+
# set source list
138+
sudo tee <<<"deb [arch=${ARCH}] https://download.docker.com/linux/${DISTRO} ${CODENAME} stable" /etc/apt/sources.list.d/download.docker.list
139+
# update package list
140+
sudo apt update
141+
# install docker CLI and Docker Compose v2
142+
sudo apt install docker-ce-cli docker-compose-plugin
127143
- setup_remote_docker:
128144
reusable: true # default - false
129145
exclusive: true # default - true
130-
version: 19.03.14
146+
version: docker24
131147
- run:
132148
name: Docker version
133149
command: |
134150
set -x
135151
docker --version
136-
docker-compose --version
152+
docker compose version
137153
- run:
138154
name: Download st2-packages repository
139155
command: |
@@ -167,7 +183,7 @@ jobs:
167183
name: Copy st2-packages files to build containers
168184
command: |
169185
# creating dummy container which will hold a volume with data files
170-
docker create -v /root/st2-packages -v ${ST2_GITDIR} -v /root/build -v /var/log/st2 -v /root/.cache/pip -v /tmp/wheelhouse --name st2-packages-vol alpine:3.4 /bin/true
186+
docker create -v /root/st2-packages -v ${ST2_GITDIR} -v /root/build -v /var/log/st2 -v /root/.cache/pip -v /tmp/wheelhouse --name st2-packages-vol alpine:3.12 /bin/true
171187
# copy st2-packages data files into this volume
172188
docker cp ~/st2-packages st2-packages-vol:/root
173189
# copy st2 source files into this volume
@@ -219,10 +235,10 @@ jobs:
219235
deploy:
220236
docker:
221237
# The primary container is an instance of the first list image listed. Your build commands run in this container.
222-
- image: circleci/ruby:2.4
238+
- image: circleci/ruby:2.7
223239
working_directory: /tmp/deploy
224240
environment:
225-
- DISTROS: "bionic focal el7 el8"
241+
- DISTROS: "focal el8 el9"
226242
steps:
227243
- attach_workspace:
228244
at: .
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: Cache and Install APT Dependencies
3+
description:
4+
Light wrapper around the actions/cache action and our script
5+
to maintain the input vars in only one place for all workflows.
6+
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Cache APT Dependencies
11+
id: cache-apt-deps
12+
uses: actions/cache@v4
13+
with:
14+
path: |
15+
~/apt_cache
16+
key: ${{ runner.os }}-v8-apt-${{ hashFiles('scripts/github/apt-packages.txt') }}
17+
restore-keys: |
18+
${{ runner.os }}-v8-apt-
19+
20+
- name: Install APT Depedencies
21+
shell: bash
22+
env:
23+
CACHE_HIT: ${{steps.cache-apt-deps.outputs.cache-hit}}
24+
run: |
25+
# install dev dependencies for Python YAML and LDAP packages
26+
# https://github.com/StackStorm/st2-auth-ldap
27+
./scripts/github/install-apt-packages-use-cache.sh
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Initialize Pants and its GHA caches
3+
description:
4+
Light wrapper around the pantsbuild/actions/init-pants action
5+
to maintain the input vars in only one place for all workflows.
6+
7+
inputs:
8+
gha-cache-key:
9+
description: Qualify all cache keys with this string. Useful for invalidating everything.
10+
required: true
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Initialize Pants and its GHA caches
16+
uses: pantsbuild/actions/init-pants@v9
17+
# This action adds an env var to make pants use both pants.ci.toml & pants.toml.
18+
# This action also creates 3 GHA caches (1 is optional).
19+
# - `pants-setup` has the bootsrapped pants install
20+
# - `pants-named-caches` has pip/wheel and PEX caches
21+
# - `pants-lmdb-store` has the fine-grained process cache.
22+
# If we ever use a remote cache, then we can drop this.
23+
# Otherwise, we may need an additional workflow or job to delete old caches
24+
# if they are not expiring fast enough, and we hit the GHA 10GB per repo max.
25+
with:
26+
base-branch: master
27+
# To ignore a bad cache, bump the cache* integer.
28+
gha-cache-key: ${{ inputs.gha-cache-key }}
29+
# This hash should include all of our lockfiles so that the pip/pex caches
30+
# get invalidated on any transitive dependency update.
31+
named-caches-hash: ${{ hashFiles('lockfiles/*.lock') }}
32+
# enable the optional lmdb_store cache since we can't rely on remote caching yet.
33+
cache-lmdb-store: 'true'
34+
# Try the experimental support for using GHA cache as a pants remote cache.
35+
experimental-remote-cache-via-gha: 'true'
36+
# install whatever version of python we need for our in-repo pants-plugins
37+
setup-python-for-plugins: 'true'
38+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Install Python and Cache Deps
3+
description:
4+
Light wrapper around the actions/setup-python and actions/cache actions
5+
to maintain the input vars in only one place for all workflows.
6+
7+
input:
8+
python-version:
9+
description: Which version of python to install.
10+
required: true
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: 'Set up Python (${{ inputs.python-version }})'
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '${{ inputs.python-version }}'
19+
20+
- name: Cache Python Dependencies
21+
uses: actions/cache@v4
22+
with:
23+
path: |
24+
~/.cache/pip
25+
virtualenv
26+
~/virtualenv
27+
# TODO: maybe make the virtualenv a partial cache to exclude st2*?
28+
# !virtualenv/lib/python*/site-packages/st2*
29+
# !virtualenv/bin/st2*
30+
key: ${{ runner.os }}-v5-python-${{ inputs.python-version }}-${{ hashFiles('requirements.txt', 'test-requirements.txt', 'lockfiles/*.lock') }}
31+
# Don't use alternative key as if requirements.txt has altered we
32+
# don't want to retrieve previous cache
33+
#restore-keys: |
34+
# ${{ runner.os }}-v5-python-${{ inputs.python }}-

.github/workflows/checks.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Add CHANGELOG.rst
1515
runs-on: ubuntu-20.04
1616
steps:
17-
- uses: actions/checkout@v1
17+
- uses: actions/checkout@v4
1818
- name: Changelog check
1919
# https://github.com/marketplace/actions/changelog-checker
2020
uses: Zomzog/[email protected]

0 commit comments

Comments
 (0)