Skip to content

Commit

Permalink
Migrate from Jenkins to Buildkite and GitHub Actions (#1679)
Browse files Browse the repository at this point in the history
  • Loading branch information
pquentin authored Mar 6, 2023
1 parent e01b1e0 commit 074d059
Show file tree
Hide file tree
Showing 22 changed files with 142 additions and 445 deletions.
9 changes: 9 additions & 0 deletions .buildkite/it/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
agents:
provider: "gcp"
image: family/core-ubuntu-2204

steps:
- label: "Run 3.8 integration tests :test_tube:"
command: bash .buildkite/it/run.sh 3.8
- label: "Run 3.10 integration tests :test_tube:"
command: bash .buildkite/it/run.sh 3.10
64 changes: 64 additions & 0 deletions .buildkite/it/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash

set -eo pipefail

# based on https://gist.github.com/sj26/88e1c6584397bb7c13bd11108a579746?permalink_comment_id=4155247#gistcomment-4155247
function retry {
local retries=$1
shift
local cmd=($@)
local cmd_string="${@}"
local count=0

# be lenient with non-zero exit codes, to allow retries
set +o errexit
set +o pipefail
until "${cmd[@]}"; do
retcode=$?
wait=$(( 2 ** count ))
count=$(( count + 1))
if [[ $count -le $retries ]]; then
printf "Command [%s] failed. Retry [%d/%d] in [%d] seconds.\n" "$cmd_string" $count $retries $wait
sleep $wait
else
printf "Exhausted all [%s] retries for command [%s]. Exiting.\n" "$cmd_string" $retries
# restore settings to fail immediately on error
set -o errexit
set -o pipefail
return $retcode
fi
done
# restore settings to fail immediately on error
set -o errexit
set -o pipefail
return 0
}
echo "--- System dependencies"

PYTHON_VERSION="$1"
retry 5 sudo add-apt-repository --yes ppa:deadsnakes/ppa
retry 5 sudo apt-get update
retry 5 sudo apt-get install -y \
"python${PYTHON_VERSION}" "python${PYTHON_VERSION}-dev" "python${PYTHON_VERSION}-venv" \
git make jq docker \
openjdk-17-jdk-headless openjdk-11-jdk-headless \
zlib1g zlib1g-dev libssl-dev libbz2-dev libsqlite3-dev
export JAVA11_HOME=/usr/lib/jvm/java-11-openjdk-amd64
export JAVA17_HOME=/usr/lib/jvm/java-17-openjdk-amd64

echo "--- Run IT test :pytest:"

export RALLY_HOME=$HOME
export THESPLOG_FILE="${THESPLOG_FILE:-${RALLY_HOME}/.rally/logs/actor-system-internal.log}"
# this value is in bytes, the default is 50kB. We increase it to 200kiB.
export THESPLOG_FILE_MAXSIZE=${THESPLOG_FILE_MAXSIZE:-204800}
# adjust the default log level from WARNING
export THESPLOG_THRESHOLD="INFO"
export TERM=dumb
export LC_ALL=en_US.UTF-8

"python${PYTHON_VERSION}" -m venv .venv
source .venv/bin/activate

pip install nox
nox -s "it-${PYTHON_VERSION}"
9 changes: 9 additions & 0 deletions .buildkite/pull-requests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"jobs": [
{
"enabled": true,
"pipeline_slug": "rally",
"allow_org_users": true
}
]
}
165 changes: 0 additions & 165 deletions .ci/build.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .ci/jobs/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,3 @@
publishers:
- email:
recipients: [email protected]
- junit:
allow-empty-results: true
results: 'junit-py*.xml'
keep-long-stdio: true
- google-cloud-storage:
credentials-id: 'elasticsearch-ci-gcs-plugin'
uploads:
- classic:
file-pattern: '.rally/$BUILD_NUMBER.tar.bz2'
storage-location: 'gs://elasticsearch-ci-artifacts/jobs/$JOB_NAME'
share-publicly: false
upload-for-failed-jobs: true
show-inline: true
builders:
- inject:
properties-content: |
HOME=$JENKINS_HOME
RALLY_HOME=$WORKSPACE
7 changes: 0 additions & 7 deletions .ci/jobs/periodic-it310.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .ci/jobs/periodic-it38.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/jobs/periodic.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/jobs/pull-request-it310.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/jobs/pull-request-it38.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .ci/jobs/pull-request-rally-tracks-compat.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .ci/jobs/push-it310.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .ci/jobs/push-it38.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .ci/jobs/push.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .ci/templates/it.yml

This file was deleted.

Loading

0 comments on commit 074d059

Please sign in to comment.