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

[PH] Create workflow to test backward compatibility of performance harness #1356

Merged
merged 44 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
fe05332
Create workflow to test backward compatibility of performance harness…
oschwaldp-oci Jun 30, 2023
c42f25b
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jun 30, 2023
f848de5
Try to placate different version artifact naming conventions.
oschwaldp-oci Jun 30, 2023
3a72042
missed the extract step
oschwaldp-oci Jun 30, 2023
2e90e39
Do not run tests in parallel.
oschwaldp-oci Jun 30, 2023
cd69265
Use low-tier for longer run time
oschwaldp-oci Jun 30, 2023
a2aa513
Split up tests into individual runs.
oschwaldp-oci Jun 30, 2023
258fefc
Tests not found - move change dir build into first test.
oschwaldp-oci Jun 30, 2023
99d2316
Add regex flag to ctest.
oschwaldp-oci Jul 3, 2023
91cf4db
Give tests a little longer to complete.
oschwaldp-oci Jul 3, 2023
d42f0e7
Split test scenarios into separate jobs.
oschwaldp-oci Jul 3, 2023
58b0f32
Revert "Split test scenarios into separate jobs."
oschwaldp-oci Jul 3, 2023
5499dd0
Always run test scenarios.
oschwaldp-oci Jul 3, 2023
ea37b69
make sure to change to the build dir.
oschwaldp-oci Jul 3, 2023
3a0960e
Use full nodeosVersion.
oschwaldp-oci Jul 10, 2023
441f5d3
Read only transaction feature support was added in 4.0, don't test in…
oschwaldp-oci Jul 10, 2023
e6ea54b
Read only transaction feature support was added in 4.0, remove unsupp…
oschwaldp-oci Jul 10, 2023
8cb771a
Fix multiple if statements in steps.
oschwaldp-oci Jul 10, 2023
ff1a837
Shouldn't run read only tests in if < v4.0
oschwaldp-oci Jul 10, 2023
800a37e
Collapse perf tests back into regular expressions to simplifly and re…
oschwaldp-oci Jul 10, 2023
c63042b
Try reducing steps using regex for deb name matching across versions.
oschwaldp-oci Jul 10, 2023
cb447c5
Try removing workaround, as it shouldn't be necessary here.
oschwaldp-oci Jul 10, 2023
b7dea9b
Install the leap deb package to bring along dependencies and then use…
oschwaldp-oci Jul 10, 2023
bc46133
Working to fix install of leap deb pkg.
oschwaldp-oci Jul 10, 2023
b2b22ab
Cleanup.
oschwaldp-oci Jul 10, 2023
265ee66
Sanity check nodeos version.
oschwaldp-oci Jul 10, 2023
1a3ef7d
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 10, 2023
4f158de
Try breaking out build steps into reusable workflow.
oschwaldp-oci Jul 11, 2023
8044aa1
Needs to use this branch's reusable workflow for now, not main
oschwaldp-oci Jul 11, 2023
de40f8a
Inherit secrets.
oschwaldp-oci Jul 11, 2023
7df3af7
Provide packages write permission for Build Platforms job.
oschwaldp-oci Jul 11, 2023
cf7ae29
Give packages write permissions.
oschwaldp-oci Jul 11, 2023
7be77cd
Convert build.yaml to use reusable build-base workflow.
oschwaldp-oci Jul 11, 2023
d46a16a
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 11, 2023
8eb51fc
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 12, 2023
477f62c
Remove hardcoded org and repo and ref.
oschwaldp-oci Jul 12, 2023
e0b3caa
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 12, 2023
495d6ea
Try to rework permissions to leave top level read, but pass write to …
oschwaldp-oci Jul 12, 2023
0da3e7b
Fix path to workflow.
oschwaldp-oci Jul 12, 2023
c3db754
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 12, 2023
4e19e36
Somehow put the wrong permission here.
oschwaldp-oci Jul 12, 2023
56c0027
fix permission.
oschwaldp-oci Jul 13, 2023
b59fede
Merge branch 'main' into GH-1156-ph-cicd-nodeos-versions
oschwaldp-oci Jul 13, 2023
bfa1685
Add names to jobs for better UI experience.
oschwaldp-oci Jul 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 20 additions & 80 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,12 @@ defaults:
shell: bash

jobs:
d:
name: Discover Platforms
runs-on: ubuntu-latest
outputs:
missing-platforms: ${{steps.discover.outputs.missing-platforms}}
p: ${{steps.discover.outputs.platforms}}
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders
build-base:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this job (that uses the reusable workflow) doesn't have a name it seems to show up as simply build-base in the GUI in various places. I'm a little surprises it doesn't inherit the callee workflow name. Maybe we could consider giving this a name (even just Build) to show up nicer.

Screenshot 2023-07-13 at 22-22-58 PH Create workflow to test backward compatibility of performance harness · AntelopeIO_leap@b59fede


Screenshot 2023-07-13 at 22-23-21 AntelopeIO_leap C implementation of the Antelope protocol

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with name Run Build Workflow:
image
image

uses: ./.github/workflows/build_base.yaml
permissions:
packages: write
contents: read

v:
name: Discover Versions
runs-on: ubuntu-latest
Expand Down Expand Up @@ -72,69 +64,17 @@ jobs:
if [[ "${{inputs.override-eos-system-contracts}}" != "" ]]; then
echo eos-system-contracts-ref=${{inputs.override-eos-system-contracts}} >> $GITHUB_OUTPUT
fi
build-platforms:
name: Build Platforms
needs: d
if: needs.d.outputs.missing-platforms != '[]'
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}}
runs-on: ["self-hosted", "enf-x86-beefy"]
permissions:
packages: write
contents: read
steps:
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}}

Build:
needs: [d, build-platforms]
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped')
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-beefy"]
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
id: build
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: ${{matrix.platform}}-build
path: build.tar.zst

dev-package:
name: Build leap-dev package
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -163,15 +103,15 @@ jobs:

tests:
name: Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-hightier"]
container:
image: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
image: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v3
Expand All @@ -189,8 +129,8 @@ jobs:

np-tests:
name: NP Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -205,7 +145,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]'
log-tarball-prefix: ${{matrix.platform}}
tests-label: nonparallelizable_tests
Expand All @@ -219,8 +159,8 @@ jobs:

lr-tests:
name: LR Tests
needs: [d, Build]
if: always() && needs.Build.result == 'success'
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -235,7 +175,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]'
log-tarball-prefix: ${{matrix.platform}}
tests-label: long_running_tests
Expand All @@ -249,15 +189,15 @@ jobs:

libtester-tests:
name: libtester tests
needs: [d, v, Build, dev-package]
needs: [build-base, v, dev-package]
if: always() && needs.v.result == 'success' && needs.dev-package.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
test: [build-tree, make-dev-install, deb-install]
runs-on: ["self-hosted", "enf-x86-midtier"]
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.d.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.build-base.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
steps:
# LEAP
- if: ${{ matrix.test != 'deb-install' }}
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: "Build leap"

on:
workflow_dispatch:
workflow_call:
outputs:
p:
description: "Discovered Build Platforms"
value: ${{ jobs.d.outputs.p }}

permissions:
packages: read
contents: read

defaults:
run:
shell: bash

jobs:
d:
name: Discover Platforms
runs-on: ubuntu-latest
outputs:
missing-platforms: ${{steps.discover.outputs.missing-platforms}}
p: ${{steps.discover.outputs.platforms}}
steps:
- name: Discover Platforms
id: discover
uses: AntelopeIO/discover-platforms-action@v1
with:
platform-file: .cicd/platforms.json
password: ${{secrets.GITHUB_TOKEN}}
package-name: builders

build-platforms:
name: Build Platforms
needs: d
if: needs.d.outputs.missing-platforms != '[]'
strategy:
fail-fast: false
matrix:
platform: ${{fromJSON(needs.d.outputs.missing-platforms)}}
runs-on: ["self-hosted", "enf-x86-beefy"]
permissions:
packages: write
contents: read
steps:
- name: Login to Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{github.repository_owner}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Build and push
uses: docker/build-push-action@v3
with:
push: true
tags: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
file: ${{fromJSON(needs.d.outputs.p)[matrix.platform].dockerfile}}

Build:
needs: [d, build-platforms]
if: always() && needs.d.result == 'success' && (needs.build-platforms.result == 'success' || needs.build-platforms.result == 'skipped')
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-beefy"]
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
id: build
run: |
# https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -GNinja
cmake --build build
tar -pc --exclude "*.o" build | zstd --long -T0 -9 > build.tar.zst
- name: Upload builddir
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: ${{matrix.platform}}-build
path: build.tar.zst
58 changes: 53 additions & 5 deletions .github/workflows/ph_backward_compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,58 @@ defaults:
shell: bash

jobs:
tmp:
name: Stub
runs-on: ubuntu-latest
build-base:
uses: ./.github/workflows/build_base.yaml
permissions:
packages: write
contents: read

tests:
name: Tests
needs: [build-base]
if: always() && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
release: [3.1, 3.2, 4.0]
runs-on: ["self-hosted", "enf-x86-lowtier"]
container:
image: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
options: --security-opt seccomp=unconfined
steps:
- name: Workflow Stub
- uses: actions/checkout@v3
- name: Download builddir
uses: actions/download-artifact@v3
with:
name: ${{matrix.platform}}-build
- name: Extract Build Directory
run: |
zstdcat build.tar.zst | tar x
- name: Download Prev Leap Version
uses: AntelopeIO/asset-artifact-download-action@v2
with:
owner: AntelopeIO
repo: leap
file: '(leap).*${{matrix.platform}}.04.*(x86_64|amd64).deb'
target: '${{matrix.release}}'
token: ${{github.token}}
- name: Install leap & replace binaries for PH use
run: |
apt-get update
apt-get install -y ./leap*.deb
rm build/bin/nodeos
rm build/bin/cleos
cp /usr/bin/nodeos build/bin
cp /usr/bin/cleos build/bin
./build/bin/nodeos --version
- if: ${{ matrix.release == '3.1' || matrix.release == '3.2' }}
name: Run Performance Tests (<v4.0)
run: |
cd build
ctest --output-on-failure -R performance_test -E read_only --timeout 480
- if: ${{ matrix.release != '3.1' && matrix.release != '3.2' }}
name: Run Performance Tests (>=v4.0)
run: |
echo "Workflow Stub"
cd build
ctest --output-on-failure -R performance_test --timeout 480
7 changes: 5 additions & 2 deletions tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,20 @@ def configureVersion(self):
self.fetchBlock = lambda blockNum: self.processUrllibRequest("chain", "get_block", {"block_num_or_id":blockNum}, silentErrors=False, exitOnError=True)
self.fetchKeyCommand = lambda: "[trx][trx][ref_block_num]"
self.fetchRefBlock = lambda trans: trans["trx"]["trx"]["ref_block_num"]
self.cleosLimit = ""
self.fetchHeadBlock = lambda node, headBlock: node.processUrllibRequest("chain", "get_block", {"block_num_or_id":headBlock}, silentErrors=False, exitOnError=True)
self.cleosLimit = ""

else:
self.fetchTransactionCommand = lambda: "get transaction_trace"
self.fetchTransactionFromTrace = lambda trx: trx['id']
self.fetchBlock = lambda blockNum: self.processUrllibRequest("trace_api", "get_block", {"block_num":blockNum}, silentErrors=False, exitOnError=True)
self.fetchKeyCommand = lambda: "[transaction][transaction_header][ref_block_num]"
self.fetchRefBlock = lambda trans: trans["block_num"]
self.cleosLimit = "--time-limit 999"
self.fetchHeadBlock = lambda node, headBlock: node.processUrllibRequest("chain", "get_block_info", {"block_num":headBlock}, silentErrors=False, exitOnError=True)
if 'v3.1' in self.nodeosVers:
self.cleosLimit = ""
else:
self.cleosLimit = "--time-limit 999"

def __str__(self):
return "Host: %s, Port:%d, NodeNum:%s, Pid:%s" % (self.host, self.port, self.nodeId, self.pid)
Expand Down
Loading