-
Notifications
You must be signed in to change notification settings - Fork 72
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
[5.0] integrate reproducible build with CI Build & Test workflow #1710
Merged
+53
−27
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0d56a95
integrate reproducible build with CI Build & Test workflow
spoonincode 39ae21c
place 'manual' reproducible source dir in same location as CI
spoonincode f06b2f9
don't change PH workflows for now
spoonincode e63034b
Merge remote-tracking branch 'origin/release/5.0' into HEAD
spoonincode 121ce77
Merge remote-tracking branch 'origin/release/5.0' into HEAD
spoonincode 4ed36f9
fix tweak missed during merge
spoonincode 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 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 |
---|---|---|
|
@@ -39,7 +39,9 @@ jobs: | |
contents: read | ||
with: | ||
runs-on: '["self-hosted", "enf-x86-beefy"]' | ||
platform-files: .cicd/platforms | ||
platform-files: | | ||
.cicd/platforms | ||
tools/reproducible.Dockerfile:builder | ||
|
||
build-base: | ||
name: Run Build Workflow | ||
|
@@ -77,13 +79,13 @@ jobs: | |
echo eos-system-contracts-ref=${{inputs.override-eos-system-contracts}} >> $GITHUB_OUTPUT | ||
fi | ||
|
||
dev-package: | ||
name: Build leap-dev package | ||
package: | ||
name: Build deb packages | ||
needs: [platform-cache, build-base] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu20, ubuntu22] | ||
platform: [ubuntu20, ubuntu22, reproducible] | ||
runs-on: ubuntu-latest | ||
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} | ||
steps: | ||
|
@@ -94,41 +96,55 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}-build | ||
- name: Build dev package | ||
- name: Build packages | ||
run: | | ||
zstdcat build.tar.zst | tar x | ||
cd build | ||
cpack | ||
../tools/tweak-deb.sh leap_*.deb | ||
- name: Install dev package | ||
if: matrix.platform != 'reproducible' | ||
run: | | ||
apt-get update && apt-get upgrade -y | ||
apt-get install -y ./build/leap_*.deb ./build/leap-dev*.deb | ||
- name: Test using TestHarness | ||
if: matrix.platform != 'reproducible' | ||
run: | | ||
python3 -c "from TestHarness import Cluster" | ||
- name: Upload dev package | ||
uses: actions/upload-artifact@v3 | ||
if: matrix.platform != 'reproducible' | ||
with: | ||
name: leap-dev-${{matrix.platform}}-amd64 | ||
path: build/leap-dev*.deb | ||
- name: Upload leap package | ||
uses: actions/upload-artifact@v3 | ||
if: matrix.platform == 'reproducible' | ||
with: | ||
name: leap-deb-amd64 | ||
path: build/leap_*.deb | ||
|
||
tests: | ||
name: Tests | ||
name: Tests (${{matrix.cfg.name}}) | ||
needs: [platform-cache, build-base] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu20, ubuntu22] | ||
include: | ||
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'} | ||
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'} | ||
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'} | ||
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'} | ||
runs-on: ["self-hosted", "enf-x86-hightier"] | ||
container: | ||
image: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} | ||
image: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.cfg.base].image}} | ||
options: --security-opt seccomp=unconfined | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download builddir | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}-build | ||
name: ${{matrix.cfg.builddir}}-build | ||
- name: Run Parallel Tests | ||
run: | | ||
# https://github.com/actions/runner/issues/2033 -- need this because of full version label test looking at git revs | ||
|
@@ -140,66 +156,74 @@ jobs: | |
run: awk 'BEGIN {err = 1} /bmi2/ && /adx/ {err = 0} END {exit err}' /proc/cpuinfo | ||
|
||
np-tests: | ||
name: NP Tests | ||
name: NP Tests (${{matrix.cfg.name}}) | ||
needs: [platform-cache, build-base] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu20, ubuntu22] | ||
include: | ||
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'} | ||
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'} | ||
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'} | ||
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'} | ||
runs-on: ["self-hosted", "enf-x86-midtier"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download builddir | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}-build | ||
name: ${{matrix.cfg.builddir}}-build | ||
- name: Run tests in parallel containers | ||
uses: ./.github/actions/parallel-ctest-containers | ||
with: | ||
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} | ||
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.cfg.base].image}} | ||
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]' | ||
log-tarball-prefix: ${{matrix.platform}} | ||
log-tarball-prefix: ${{matrix.cfg.name}} | ||
tests-label: nonparallelizable_tests | ||
test-timeout: 420 | ||
- name: Upload logs from failed tests | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: ${{matrix.platform}}-np-logs | ||
name: ${{matrix.cfg.name}}-np-logs | ||
path: '*-logs.tar.gz' | ||
|
||
lr-tests: | ||
name: LR Tests | ||
name: LR Tests (${{matrix.cfg.name}}) | ||
needs: [platform-cache, build-base] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: [ubuntu20, ubuntu22] | ||
include: | ||
- cfg: {name: 'ubuntu20', base: 'ubuntu20', builddir: 'ubuntu20'} | ||
- cfg: {name: 'ubuntu22', base: 'ubuntu22', builddir: 'ubuntu22'} | ||
- cfg: {name: 'ubuntu20repro', base: 'ubuntu20', builddir: 'reproducible'} | ||
- cfg: {name: 'ubuntu22repro', base: 'ubuntu22', builddir: 'reproducible'} | ||
runs-on: ["self-hosted", "enf-x86-lowtier"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Download builddir | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{matrix.platform}}-build | ||
name: ${{matrix.cfg.builddir}}-build | ||
- name: Run tests in parallel containers | ||
uses: ./.github/actions/parallel-ctest-containers | ||
with: | ||
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.platform].image}} | ||
container: ${{fromJSON(needs.platform-cache.outputs.platforms)[matrix.cfg.base].image}} | ||
error-log-paths: '["build/etc", "build/var", "build/leap-ignition-wd", "build/TestLogs"]' | ||
log-tarball-prefix: ${{matrix.platform}} | ||
log-tarball-prefix: ${{matrix.cfg.name}} | ||
tests-label: long_running_tests | ||
test-timeout: 1800 | ||
- name: Upload logs from failed tests | ||
uses: actions/upload-artifact@v3 | ||
if: failure() | ||
with: | ||
name: ${{matrix.platform}}-lr-logs | ||
name: ${{matrix.cfg.name}}-lr-logs | ||
path: '*-logs.tar.gz' | ||
|
||
libtester-tests: | ||
name: libtester tests | ||
needs: [platform-cache, build-base, v, dev-package] | ||
needs: [platform-cache, build-base, v, package] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -290,7 +314,7 @@ jobs: | |
|
||
all-passing: | ||
name: All Required Tests Passed | ||
needs: [dev-package, tests, np-tests, libtester-tests] | ||
needs: [tests, np-tests, libtester-tests] | ||
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. Removed |
||
runs-on: ubuntu-latest | ||
steps: | ||
- run: true |
This file contains 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 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
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.
This was not what I was expecting this to end up looking like; I was thinking there would be some sort of JSON file or such that defined the platform hierarchy for building and then testing. But simply ran out of time to explore other approaches. Though, honestly, other then copy pasting it 3 times this isn't too bad. But this is exactly the kind of plumbing this comment chain is discussing some, #1703 (comment)
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.
With care, this kind of copy/paste is OK, avoiding complicating logic.
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'd like to figure out a good way to avoid it, but that can come later. The problem I'm having is that any approach to avoid this repetition seems to introduce significant indirection.
For example, maybe I'd have a JSON or YAML file as part of the repo define the relationships between the platforms we're building, what that gets tested on, what runners are used (in case we ever add ARM etc), whether the libtester tests should run (on anything but ubuntu, no), etc. But that would involve a non-trivial chunk of, I guess, javascript at the start of the job to 'unpack' and process that definition in to various rules used in the workflow: complicating indeed.