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 for manually dispatching performance harness runs #1378

Merged
merged 64 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
f7f246a
Initial attempt of configurable ph run in cicd.
oschwaldp-oci Jul 7, 2023
78564fa
Fix yaml file syntax. Minor cleanup.
oschwaldp-oci Jul 7, 2023
7518f78
Fix yaml file syntax.
oschwaldp-oci Jul 7, 2023
1f2ca01
Fix yaml file syntax 'uses' already defined.
oschwaldp-oci Jul 7, 2023
975426a
Add dependency needs.
oschwaldp-oci Jul 7, 2023
947770e
Pre-calculate the report location for use in upload step.
oschwaldp-oci Jul 7, 2023
8f01104
Use normal upload-artifact action.
oschwaldp-oci Jul 7, 2023
e3ae3a3
Try finding and uploading report via wildcard.
oschwaldp-oci Jul 7, 2023
dc92ab5
Merge branch 'main' into ph-manual-workflow
oschwaldp-oci Jul 10, 2023
6b4f745
Some cleanup.
oschwaldp-oci Jul 10, 2023
8919364
Merge branch 'main' into ph-manual-workflow
oschwaldp-oci Jul 17, 2023
feffc03
Try to automatically parse platform matrix in script.
oschwaldp-oci Jul 18, 2023
be9452b
Attempt to use the json object directly.
oschwaldp-oci Jul 18, 2023
754638d
Attempt to fix github variable reference in script.
oschwaldp-oci Jul 18, 2023
cb73a84
Attempt to use constructed platform matrix in build job.
oschwaldp-oci Jul 18, 2023
b0075c0
Put matrix-out into github output for use later.
oschwaldp-oci Jul 18, 2023
a414b8c
Try quotes.
oschwaldp-oci Jul 18, 2023
3f13595
Try using fromJSON parsing.
oschwaldp-oci Jul 18, 2023
a83266b
Debugging output.
oschwaldp-oci Jul 18, 2023
158ad55
Don't needs backslashes to break lines up.
oschwaldp-oci Jul 18, 2023
ba738b8
Add input to override build platform matrix.
oschwaldp-oci Jul 18, 2023
282cfe0
Use fromJSON.
oschwaldp-oci Jul 18, 2023
1de5698
Try again.
oschwaldp-oci Jul 18, 2023
c7695c0
Try again.
oschwaldp-oci Jul 18, 2023
0385511
Remove extra training quote.
oschwaldp-oci Jul 18, 2023
f3097a2
Try fromJSON in output.
oschwaldp-oci Jul 18, 2023
4e2ebb0
Working to get array
oschwaldp-oci Jul 18, 2023
f027744
echo out GITHUB_OUTPUT
oschwaldp-oci Jul 18, 2023
2d7e8c4
Try this again.
oschwaldp-oci Jul 18, 2023
96b3d71
Try this again.
oschwaldp-oci Jul 18, 2023
fd54f6c
Try this again.
oschwaldp-oci Jul 18, 2023
d0c1e2c
Try to debug output
oschwaldp-oci Jul 18, 2023
f995e47
Try to debug output
oschwaldp-oci Jul 18, 2023
41a1824
Fix syntax.
oschwaldp-oci Jul 18, 2023
a1bcf4b
Try escaping quotes.
oschwaldp-oci Jul 18, 2023
f4b7998
Fix syntax.
oschwaldp-oci Jul 18, 2023
56e7a9d
Debugging results.
oschwaldp-oci Jul 18, 2023
7a12930
Surround with single quotes to force not escaping internal quotes.
oschwaldp-oci Jul 18, 2023
b1862f2
Remove surrounding escaped quotes.
oschwaldp-oci Jul 18, 2023
d1e099c
Update workflow for using reusable workflow.
oschwaldp-oci Jul 18, 2023
1e562e8
Make override option into an array for matrix.
oschwaldp-oci Jul 18, 2023
90f0852
Replace accidentally removed dependency on job v.
oschwaldp-oci Jul 18, 2023
a155889
Add quotes around input param for if check.
oschwaldp-oci Jul 18, 2023
6c86da5
Cleanup previous jobs now replaced by build-base reusable workflow.
oschwaldp-oci Jul 18, 2023
1b9f64a
Try to make build step optional if build for current commit has alrea…
oschwaldp-oci Jul 18, 2023
6c2758f
Pipe leap-ref selection/override through workflows.
oschwaldp-oci Jul 18, 2023
47ddeb6
Fix spacing.
oschwaldp-oci Jul 18, 2023
4f3c5ef
Revert "Fix spacing."
oschwaldp-oci Jul 18, 2023
f49f8c9
Revert "Pipe leap-ref selection/override through workflows."
oschwaldp-oci Jul 18, 2023
c597816
Remove attempt to override leap ref for this workflow.
oschwaldp-oci Jul 18, 2023
7670690
Merge branch 'main' into ph-manual-workflow
oschwaldp-oci Jul 19, 2023
e5139d6
Try using asset-artifact-download-action@v3 to pull down past build i…
oschwaldp-oci Jul 26, 2023
1a96850
Fix file name in asset-artifact-download-action
oschwaldp-oci Jul 26, 2023
775cce4
Split out platforms workflow into separate reusable workflow.
oschwaldp-oci Jul 27, 2023
13424e2
Remove workflow_dispatch from reusable workflows.
oschwaldp-oci Jul 27, 2023
78b16c5
Fix call to build-base with proper new inputs.
oschwaldp-oci Jul 27, 2023
b30be9c
Merge branch 'main' into ph-manual-workflow
oschwaldp-oci Jul 28, 2023
4cb312e
Try using something other than empty string.
oschwaldp-oci Jul 28, 2023
45b6c77
Get the output directly from the step output.
oschwaldp-oci Jul 28, 2023
bf95111
Remove override input as build will always use the full platforms.jso…
oschwaldp-oci Jul 31, 2023
8c47cce
Address peer review comments.
oschwaldp-oci Aug 2, 2023
cd872b3
Remove debugging step and unnecessary echo.
oschwaldp-oci Aug 2, 2023
d50381b
Remove unnecessary token input.
oschwaldp-oci Aug 2, 2023
b710831
Merge branch 'main' into ph-manual-workflow
oschwaldp-oci Aug 2, 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
41 changes: 26 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,20 @@ defaults:
shell: bash

jobs:
platforms:
name: Run Platforms Workflow
uses: ./.github/workflows/platforms.yaml
permissions:
packages: write
contents: read

build-base:
name: Run Build Workflow
uses: ./.github/workflows/build_base.yaml
needs: [platforms]
with:
p: ${{needs.platforms.outputs.p}}
platform-matrix: ${{needs.platforms.outputs.platform-matrix}}
permissions:
packages: write
contents: read
Expand Down Expand Up @@ -68,14 +79,14 @@ jobs:
dev-package:
name: Build leap-dev package
needs: [build-base]
if: always() && needs.build-base.result == 'success'
needs: [platforms, build-base]
if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ubuntu-latest
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.platforms.outputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -104,15 +115,15 @@ jobs:

tests:
name: Tests
needs: [build-base]
if: always() && needs.build-base.result == 'success'
needs: [platforms, build-base]
if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
runs-on: ["self-hosted", "enf-x86-hightier"]
container:
image: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
image: ${{fromJSON(needs.platforms.outputs.p)[matrix.platform].image}}
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v3
Expand All @@ -130,8 +141,8 @@ jobs:
np-tests:
name: NP Tests
needs: [build-base]
if: always() && needs.build-base.result == 'success'
needs: [platforms, build-base]
if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -146,7 +157,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.platforms.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 @@ -160,8 +171,8 @@ jobs:

lr-tests:
name: LR Tests
needs: [build-base]
if: always() && needs.build-base.result == 'success'
needs: [platforms, build-base]
if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
Expand All @@ -176,7 +187,7 @@ jobs:
- name: Run tests in parallel containers
uses: ./.github/actions/parallel-ctest-containers
with:
container: ${{fromJSON(needs.build-base.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(needs.platforms.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 @@ -190,15 +201,15 @@ jobs:

libtester-tests:
name: libtester tests
needs: [build-base, v, dev-package]
if: always() && needs.v.result == 'success' && needs.dev-package.result == 'success'
needs: [platforms, build-base, v, dev-package]
if: always() && needs.platforms.result == 'success' && 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.build-base.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
container: ${{ matrix.test != 'deb-install' && fromJSON(needs.platforms.outputs.p)[matrix.platform].image || matrix.platform == 'ubuntu20' && 'ubuntu:focal' || 'ubuntu:jammy' }}
env:
DEBIAN_FRONTEND: noninteractive
TZ: Etc/UTC
Expand Down
57 changes: 9 additions & 48 deletions .github/workflows/build_base.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: "Build leap"

on:
workflow_dispatch:
workflow_call:
outputs:
inputs:
p:
description: "Discovered Build Platforms"
value: ${{ jobs.d.outputs.p }}
type: string
required: true
platform-matrix:
description: "Platform Matrix"
type: string
required: true

permissions:
packages: read
Expand All @@ -17,57 +21,14 @@ 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-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:
name: Build leap
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]
platform: ${{fromJSON(inputs.platform-matrix)}}
runs-on: ["self-hosted", "enf-x86-beefy"]
container: ${{fromJSON(needs.d.outputs.p)[matrix.platform].image}}
container: ${{fromJSON(inputs.p)[matrix.platform].image}}
steps:
- uses: actions/checkout@v3
with:
Expand Down
110 changes: 106 additions & 4 deletions .github/workflows/performance_harness_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ name: "Performance Harness Run"

on:
workflow_dispatch:
inputs:
platform-choice:
description: 'Override build platform'
Copy link
Member

Choose a reason for hiding this comment

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

I guess this isn't really overriding the platform but rather picking which platform

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct. Here it is a platform selection, however down in platforms.yaml it serves to override the auto-generated platform matrix (from platforms.json). I'll update the verbiage here. Addressed: 8c47cce

type: choice
options:
- ubuntu20
- ubuntu22
override-test-params:
description: 'Override perf harness params'
type: string

permissions:
packages: read
Expand All @@ -12,10 +22,102 @@ defaults:
shell: bash

jobs:
tmp:
name: Stub

v:
name: Discover Inputs
runs-on: ubuntu-latest
outputs:
test-params: ${{steps.overrides.outputs.test-params}}
steps:
- name: Setup Input Params
id: overrides
env:
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
Copy link
Member

Choose a reason for hiding this comment

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

this used any where?

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed: 8c47cce

run: |
echo test-params=testBpOpMode >> $GITHUB_OUTPUT

if [[ "${{inputs.override-test-params}}" != "" ]]; then
echo test-params=${{inputs.override-test-params}} >> $GITHUB_OUTPUT
fi

platforms:
name: Run Platforms Workflow
uses: ./.github/workflows/platforms.yaml
with:
override-build-matrix: ${{github.event.inputs.platform-choice}}
permissions:
packages: write
contents: read

reuse-build:
name: Reuse leap build
needs: [v]
if: |
always() &&
needs.v.result == 'success'
runs-on: ubuntu-latest
outputs:
build-artifact: ${{steps.downloadBuild.outputs.downloaded-file}}
steps:
- name: Download builddir
id: downloadBuild
uses: AntelopeIO/asset-artifact-download-action@v3
with:
owner: AntelopeIO
repo: leap
file: build.tar.zst
target: ${{github.sha}}
artifact-name: ${{github.event.inputs.platform-choice}}-build
fail-on-missing-target: false
token: ${{github.token}}
Copy link
Member

Choose a reason for hiding this comment

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

with v3 you don't need this line, if you want to save a line

Copy link
Member Author

Choose a reason for hiding this comment

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

Done: d50381b


- name: Upload builddir
if: steps.downloadBuild.outputs.downloaded-file != ''
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: ${{github.event.inputs.platform-choice}}-build
path: build.tar.zst
Copy link
Member

Choose a reason for hiding this comment

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

Similar comments as #1356 (comment): we shouldn't be copy pasting all of this, we need to come up with a better approach.

Copy link
Member Author

Choose a reason for hiding this comment

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

@spoonincode - I have refactored the build to be a reusable workflow in PR#1356. Hoping to have that PR go into main first, then I will pull those changes into this branch and refactor the workflow to use build-base as well.


build-base:
name: Run Build Workflow
needs: [platforms, reuse-build]
if: always() && needs.platforms.result == 'success' && needs.reuse-build.outputs.build-artifact == ''
uses: ./.github/workflows/build_base.yaml
with:
p: ${{needs.platforms.outputs.p}}
platform-matrix: ${{needs.platforms.outputs.platform-matrix}}
permissions:
packages: write
contents: read

tests:
name: Tests
needs: [v, platforms, reuse-build, build-base]
if: always() && needs.platforms.result == 'success' && (needs.build-base.result == 'success' || needs.reuse-build.result == 'success')
Copy link
Member

Choose a reason for hiding this comment

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

we really need to find a way to get #283 in good shape to avoid these tricky always() chains

runs-on: ubuntu-latest
Copy link
Member

Choose a reason for hiding this comment

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

This means it runs on a github owned runner, is that what you wanted?

Copy link
Member Author

Choose a reason for hiding this comment

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

@spoonincode - Correct. I was using the github owned runner for initial testing and verification of the workflow. Now that this is closer to complete, do you have a suggestion for a runner to use (enf-x86-beefy-long)? I know that most of the enf runners have time limits on them which could be problematic for performance runs depending on how a user configures the run.

container:
image: ${{fromJSON(needs.platforms.outputs.p)[github.event.inputs.platform-choice].image}}
steps:
- name: Workflow Stub
- name: Download builddir
uses: actions/download-artifact@v3
with:
name: ${{github.event.inputs.platform-choice}}-build
- name: Run Performance Test
run: |
zstdcat build.tar.zst | tar x
cd build
./tests/performance_tests/performance_test.py ${{needs.v.outputs.test-params}}
- name: Prepare results
id: prep-results
run: |
echo "Workflow Stub"
tar -pc build/performance_test | zstd --long -T0 -9 > performance_test_logs.tar.zst
- name: Upload results
uses: AntelopeIO/upload-artifact-large-chunks-action@v1
with:
name: performance-test-results
path: performance_test_logs.tar.zst
- name: Upload report
uses: actions/upload-artifact@v3
with:
name: performance-test-report
path: ./build/performance_test/**/report.json
19 changes: 15 additions & 4 deletions .github/workflows/ph_backward_compatibility.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,36 @@ defaults:
shell: bash

jobs:
platforms:
name: Run Platforms Workflow
uses: ./.github/workflows/platforms.yaml
permissions:
packages: write
contents: read

build-base:
name: Run Build Workflow
uses: ./.github/workflows/build_base.yaml
needs: [platforms]
with:
p: ${{needs.platforms.outputs.p}}
platform-matrix: ${{needs.platforms.outputs.platform-matrix}}
permissions:
packages: write
contents: read

tests:
name: Tests
needs: [build-base]
if: always() && needs.build-base.result == 'success'
needs: [platforms, build-base]
if: always() && needs.platforms.result == 'success' && needs.build-base.result == 'success'
strategy:
fail-fast: false
matrix:
platform: [ubuntu20, ubuntu22]
platform: ${{fromJSON(needs.platforms.outputs.platform-matrix)}}
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}}
image: ${{fromJSON(needs.platforms.outputs.p)[matrix.platform].image}}
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v3
Expand Down
Loading