-
Notifications
You must be signed in to change notification settings - Fork 33
Add CI for tests #111
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
Merged
Merged
Add CI for tests #111
Changes from 39 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
553ae69
Add single node CI workflow
mawad-amd 8759a7e
Run on the branch
mawad-amd 79a5acf
Check docker
mawad-amd 4fc89c0
Start the docker daemon
mawad-amd ba69f6f
Check for version
mawad-amd 76a097a
Install docker
mawad-amd f9527ad
Add docker setup step
mawad-amd f629465
Build the container
mawad-amd b1222ed
Checkout the repo
mawad-amd 9764984
Add ranks matrix
mawad-amd 371387a
Rename runner label
mawad-amd 09d8685
Rerun
mawad-amd d31b0db
Push to hub
mawad-amd 997c4a8
Change the dockerfile
mawad-amd 82a7f54
Add test
mawad-amd c11c538
Remove CI on branch
mawad-amd e5a9c7c
Do not use the cache
mawad-amd 312ad15
Remove unused args
mawad-amd 8af7ddc
Space cleanup
mawad-amd c29a02c
Disable test
mawad-amd bd68b83
Use docker prune
mawad-amd c7b7b3e
Remove bad files
mawad-amd a634ef4
Desto old docker
mawad-amd 126ec2a
Test new runner
mawad-amd 1b6c31a
Do not delete files
mawad-amd 8da0d08
Go back to default
mawad-amd 7082414
Remove prune command
mawad-amd 1b5b2c3
Add apptainer flow
mawad-amd 4f8d8e8
Remove bad command
mawad-amd e7da8aa
Fix apptainer install command
mawad-amd 0848a1e
Fix apptianer install command
mawad-amd 8c7d70b
Run tests
mawad-amd 3687b99
Run tests
mawad-amd 3d473ac
Install and test in one go
mawad-amd f4e3bce
Remove apptainer install
mawad-amd 4ff36d2
Barrier after initialization
mawad-amd 92a243c
Change alias to function
mawad-amd 3459e68
Run one test at a time
mawad-amd bde698d
Cleanup
mawad-amd 9047677
Use source branch for PRs
mawad-amd 27dd2ce
Revert dockerfile changes
mawad-amd 3ff980c
Remove debug code
mawad-amd d5bc6b5
Remove unneded if
mawad-amd 0a1179f
Remove rank from concurrency setting
mawad-amd c0cdfa9
Fix concurrency groups
mawad-amd db54fc2
Improve name
mawad-amd b08b56f
Improve name
mawad-amd 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,78 @@ | ||
| name: Iris Tests with Apptainer | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-apptainer-image: | ||
| runs-on: [self-hosted, mi3008x] | ||
| timeout-minutes: 90 | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Apptainer | ||
| run: | | ||
| apt-get update && apt-get install -y software-properties-common | ||
| add-apt-repository -y ppa:apptainer/ppa | ||
| apt-get update && apt-get install -y apptainer | ||
| apptainer --version | ||
|
|
||
| - name: Build Iris Apptainer container | ||
| run: | | ||
| df -h / | ||
| # Create persistent Apptainer directory | ||
| mkdir -p ~/apptainer | ||
|
|
||
| # Build Apptainer image from definition file (only if it doesn't exist) | ||
| if [ ! -f ~/apptainer/iris-dev.sif ]; then | ||
| echo "Building new Apptainer image..." | ||
| apptainer build ~/apptainer/iris-dev.sif apptainer/iris.def | ||
| else | ||
| echo "Using existing Apptainer image" | ||
| fi | ||
| run-tests: | ||
| needs: build-apptainer-image | ||
| runs-on: [self-hosted, mi3008x] | ||
| timeout-minutes: 20 | ||
| strategy: | ||
| matrix: | ||
| ranks: [1, 2, 4, 8] | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.ranks }} | ||
mawad-amd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| cancel-in-progress: true | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run Iris Tests with ${{ matrix.ranks }} MPI ranks | ||
| run: | | ||
| apptainer exec ~/apptainer/iris-dev.sif bash -c " | ||
| # Install iris first | ||
| pip install -e . | ||
|
|
||
| # Create function for mpirun with root permissions | ||
| mpirun-root() { mpirun --allow-run-as-root \"\$@\"; } | ||
|
|
||
| # Run examples tests one at a time | ||
| echo 'Running examples tests one at a time...' | ||
| for test_file in tests/examples/test_*.py; do | ||
| if [ -f \"\$test_file\" ]; then | ||
| echo \"Testing: \$test_file with ${{ matrix.ranks }} MPI ranks\" | ||
| mpirun-root -np ${{ matrix.ranks }} python -m pytest \"\$test_file\" -v --tb=short | ||
| fi | ||
| done | ||
|
|
||
| # Run unit tests one at a time | ||
| echo 'Running unit tests one at a time...' | ||
| for test_file in tests/unittests/test_*.py; do | ||
| if [ -f \"\$test_file\" ]; then | ||
| echo \"Testing: \$test_file with ${{ matrix.ranks }} MPI ranks\" | ||
| mpirun-root -np ${{ matrix.ranks }} python -m pytest \"\$test_file\" -v --tb=short | ||
| fi | ||
| done | ||
| " | ||
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 |
|---|---|---|
|
|
@@ -10,4 +10,4 @@ pushd "$SCRIPT_DIR" > /dev/null | |
|
|
||
| docker build -t $IMAGE_NAME . | ||
|
|
||
| popd > /dev/null | ||
| popd > /dev/null | ||
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.