-
Notifications
You must be signed in to change notification settings - Fork 1.1k
chore: include regression tests on arm release build and refactor #1706
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
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
aa4c2fa
chore(gh-workflows): add regression tests to release job
kostasrim 8369e3e
WIP
kostasrim d827047
fix: migrate reusable workflow as action
kostasrim 3aa956e
fix: regression test action
kostasrim 41e17e5
fix: broken action
kostasrim d31a423
fix: prefix token to properly use it
kostasrim a0decab
fix: add missing composite
kostasrim d4375a7
fix: use expression properly
kostasrim 3a7dba8
fix: update release workflow
kostasrim 64c086f
fix: action check && release
kostasrim f41aeec
to be dropped
kostasrim 0173dc0
WIP
kostasrim be56c36
try regression on release
kostasrim dce6c0a
add trigger
kostasrim cd2dd22
try
kostasrim 0a0f223
try proper tagging
kostasrim 3d983c6
add explicit tag
kostasrim 928be49
add pip install
kostasrim 29e9f70
call action properly
kostasrim 246576b
properly name dfly executable on release
kostasrim 23a0b57
try to run composite action in docker arm
kostasrim db9754b
revert regression tests for docker arm release
kostasrim 65f5cae
revert CI to original state
kostasrim cdebaf2
remove extra spaces
kostasrim f256e6c
add parameter for build folder name in regression action
kostasrim 3c5afe7
wip
kostasrim cf19ac3
chore: refactor release to use matrix
kostasrim 8b8f9f0
fix naming
kostasrim c6944dc
try
kostasrim 575058c
add specific image
kostasrim 3ed27e5
enable build only for x86
kostasrim aef3e99
enable arm build without replication tests
kostasrim 882b31b
try
kostasrim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: Regression Tests | ||
description: "Run regression tests" | ||
|
||
inputs: | ||
dfly-executable: | ||
required: true | ||
type: string | ||
gspace-secret: | ||
required: true | ||
type: string | ||
run-only-on-ubuntu-latest: | ||
# 'true' or 'false' cause boolean | ||
# is not supported in composite actions | ||
required: true | ||
type: string | ||
build-folder-name: | ||
required: true | ||
type: string | ||
|
||
|
||
runs: | ||
using: "composite" | ||
# bring back timeouts once composite actions start supporting them | ||
# timeout-minutes: 20 | ||
steps: | ||
- name: Run PyTests | ||
shell: bash | ||
run: | | ||
ls -l ${GITHUB_WORKSPACE}/ | ||
cd ${GITHUB_WORKSPACE}/tests | ||
echo "Current commit is ${{github.sha}}" | ||
pip install -r dragonfly/requirements.txt | ||
# used by PyTests | ||
export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}" | ||
export UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 # to crash on errors | ||
|
||
pytest --json-report --json-report-file=report.json -svr dragonfly --ignore=dragonfly/replication_test.py | ||
|
||
|
||
|
||
- name: Run PyTests replication test | ||
if: ${{ inputs.run-only-on-ubuntu-latest == 'false' || matrix.runner == 'ubuntu-latest' }} | ||
shell: bash | ||
run: | | ||
echo "Running PyTests replication test with flag: ${{ inputs.run-only-on-ubuntu-latest }}" | ||
cd ${GITHUB_WORKSPACE}/tests | ||
# used by PyTests | ||
export DRAGONFLY_PATH="${GITHUB_WORKSPACE}/${{inputs.build-folder-name}}/${{inputs.dfly-executable}}" | ||
|
||
pytest --json-report --json-report-file=rep1_report.json -sv dragonfly/replication_test.py --df alsologtostderr --df enable_multi_shard_sync=true | ||
pytest --json-report --json-report-file=rep2_report.json -sv dragonfly/replication_test.py --df alsologtostderr --df enable_multi_shard_sync=false | ||
|
||
|
||
|
||
- name: Send notification on failure | ||
if: failure() | ||
shell: bash | ||
run: | | ||
get_failed_tests() { | ||
local report_file=$1 | ||
echo $(jq -r '.tests[] | select(.outcome == "failed") | .nodeid' "$report_file") | ||
} | ||
cd ${GITHUB_WORKSPACE}/tests | ||
failed_tests="" | ||
# The order in of if is important, and expected to be the oposite order of the pytest run. | ||
# As github runner will not run the next step if the pytest failed, we start from the last | ||
# report file and if exist we get the failed test from the pytest run, if there are any. | ||
if [ -f rep2_report.json ]; then | ||
failed_tests=$(get_failed_tests rep2_report.json) | ||
elif [ -f rep1_report.json ]; then | ||
failed_tests=$(get_failed_tests rep1_report.json) | ||
elif [ -f report.json ]; then | ||
failed_tests=$(get_failed_tests report.json) | ||
fi | ||
|
||
job_link="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" | ||
message="Regression tests failed.\\n The commit is: ${{github.sha}}.\\n $failed_tests \\n Job Link: ${job_link}\\n" | ||
|
||
curl -s \ | ||
-X POST \ | ||
-H 'Content-Type: application/json' \ | ||
'${{ inputs.gspace-secret }}' \ | ||
-d '{"text": "'"${message}"'"}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
name: Version Release | ||
|
||
#on: | ||
# push: | ||
# tags: | ||
# - 'v*' | ||
# | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
# push: | ||
# branches: [ main ] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -15,104 +22,57 @@ jobs: | |
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: temp | ||
allowUpdates: true | ||
omitBody: true | ||
prerelease: true | ||
draft: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
build-qemu: | ||
runs-on: ubuntu-latest | ||
name: Build aarch64 on ubuntu20.04 | ||
needs: create-release | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Cache build deps | ||
id: cache-deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
${{github.workspace}}/build-opt/ | ||
!${{github.workspace}}/build-opt/CMakeCache.txt | ||
key: ${{ runner.os }}-release-deps-${{ github.sha }} | ||
#restore-keys: | | ||
# ${{ runner.os }}-release-deps- | ||
|
||
- uses: uraimo/run-on-arch-action@v2 | ||
name: Run commands | ||
id: runcmd | ||
with: | ||
arch: aarch64 | ||
distro: ubuntu20.04 | ||
githubToken: ${{ github.token }} | ||
# Create an artifacts directory | ||
setup: | | ||
mkdir -p "${PWD}/artifacts" | ||
|
||
# Mount the artifacts directory as /artifacts in the container | ||
dockerRunArgs: | | ||
--volume "${{ github.workspace }}:/src" | ||
# The shell to run commands with in the container | ||
shell: /bin/bash | ||
install: | | ||
export DEBIAN_FRONTEND=noninteractive | ||
apt update && apt install -q -y autoconf-archive cmake curl git libssl-dev \ | ||
libunwind-dev ninja-build libtool gcc-9 g++-9 libboost-fiber-dev \ | ||
libxml2-dev zip libzstd-dev debhelper moreutils bison | ||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 40 \ | ||
--slave /usr/bin/g++ g++ /usr/bin/g++-9 | ||
run: | | ||
# Work around https://github.com/actions/checkout/issues/766 | ||
git config --global --add safe.directory /src | ||
cd /src | ||
git describe --always --tags ${{ github.sha }} | ||
|
||
if [ -d build-opt ]; then | ||
chown -R root build-opt | ||
ls -l ./build-opt | ||
for i in `ls -d ./build-opt/_deps/*-src`; do | ||
git config --global --add safe.directory $(realpath $i) | ||
done | ||
fi | ||
./tools/release.sh | ||
./tools/packaging/generate_debian_package.sh build-opt/dragonfly-aarch64 | ||
mv dragonfly_*.deb build-opt/ | ||
- name: Show the artifact | ||
# Items placed in /src/build-opt in the container will be in | ||
# ${PWD}/build-opt on the host. | ||
run: | | ||
echo finished | ||
ls -al | ||
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dragonfly-aarch64 | ||
path: | | ||
build-opt/dragonfly-*tar.gz | ||
build-opt/dragonfly_*.deb | ||
|
||
build-native: | ||
runs-on: ubuntu-latest | ||
needs: create-release | ||
build: | ||
strategy: | ||
matrix: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We now use a matrix! |
||
# Test of these containers | ||
container: ["ubuntu-dev:20"] | ||
runner: [[linux, arm64], [ubuntu-20.04]] | ||
include: | ||
- container: "ubuntu-dev:20" | ||
runner: [linux, arm64] | ||
df-binary-name: dragonfly-aarch64 | ||
platform: aarch64 | ||
name: dragonfly-aarch64 | ||
not-replication: true | ||
- container: "ubuntu-dev:20" | ||
runner: [ubuntu-20.04] | ||
df-binary-name: dragonfly-x86_64 | ||
platform: x86_64 | ||
name: dragonfly-amd64 | ||
not-replication: false | ||
runs-on: ${{ matrix.runner }} | ||
container: | ||
image: ghcr.io/romange/ubuntu-dev:20 | ||
image: ghcr.io/romange/${{ matrix.container }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once we release the new packages, I will remove apt-install from here :) |
||
name: Build ${{ matrix.platform }} on ubuntu20.04 | ||
needs: create-release | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Configure | ||
run: | | ||
apt update && apt install -y debhelper moreutils | ||
- name: Build artifacts | ||
run: | | ||
# Work around https://github.com/actions/checkout/issues/766 | ||
git config --global --add safe.directory "$GITHUB_WORKSPACE" | ||
git describe --always --tags ${{ github.sha }} | ||
./tools/release.sh | ||
# once the build is over, we want to generate a Debian package | ||
./tools/packaging/generate_debian_package.sh build-opt/dragonfly-x86_64 | ||
./tools/packaging/generate_debian_package.sh build-opt/${{ matrix.df-binary-name}} | ||
mv dragonfly_*.deb build-opt/ | ||
ls -lah build-opt | ||
- name: Run regression tests | ||
uses: ./.github/actions/regression-tests | ||
with: | ||
dfly-executable: ${{ matrix.df-binary-name }} | ||
gspace-secret: ${{ secrets.GSPACES_BOT_DF_BUILD }} | ||
run-only-on-ubuntu-latest: ${{ matrix.not-replication }} | ||
build-folder-name: build-opt | ||
- name: Save artifacts | ||
run: | | ||
# place all artifacts at the same location | ||
|
@@ -122,24 +82,25 @@ jobs: | |
- name: Upload | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dragonfly-amd64 | ||
name: ${{ matrix.name }} | ||
path: results-artifacts/* | ||
publish_release: | ||
runs-on: ubuntu-latest | ||
needs: [build-native, build-qemu] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
name: Download files | ||
with: | ||
path: artifacts | ||
- name: See all the artifacts | ||
run: | | ||
ls -lR artifacts/ | ||
- uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "artifacts/dragonfly-*/*" | ||
allowUpdates: true | ||
draft: true | ||
prerelease: true | ||
omitNameDuringUpdate: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# publish_release: | ||
# runs-on: ubuntu-latest | ||
# needs: [build] | ||
# steps: | ||
# - uses: actions/download-artifact@v3 | ||
# name: Download files | ||
# with: | ||
# path: artifacts | ||
# - name: See all the artifacts | ||
# run: | | ||
# ls -lR artifacts/ | ||
# - uses: ncipollo/release-action@v1 | ||
# with: | ||
# artifacts: "artifacts/dragonfly-*/*" | ||
# allowUpdates: true | ||
# draft: true | ||
# prerelease: true | ||
# omitNameDuringUpdate: true | ||
# token: ${{ secrets.GITHUB_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will remove these, used for testing only