-
Notifications
You must be signed in to change notification settings - Fork 15
Add pip install test workflow with Apptainer and rank matrix #171
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
Open
mawad-amd
wants to merge
15
commits into
main
Choose a base branch
from
muhaawad/ci-install
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ca6fe29
Add pip install test workflow with Apptainer and rank matrix
mawad-amd 6a64cb9
Make sure we exit on failures
mawad-amd 7562146
Apply Ruff auto-fixes
github-actions[bot] 618f9fe
Add simple external test
mawad-amd 19c837d
Indent the yml
mawad-amd a8061a1
Get test from gist
mawad-amd 2aba558
Fix bad char
mawad-amd 2e8dd17
Add dependancies
mawad-amd 9964112
Update link
mawad-amd b9e49c6
Remove bad dependancy
mawad-amd c964e36
Uninstall
mawad-amd 12ce282
Always force reinstall
mawad-amd 76e86f1
Add `--no-deps
mawad-amd e4e5214
More cleanup
mawad-amd 0f98869
Merge branch 'main' into muhaawad/ci-install
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,72 @@ | ||
name: Iris External Validation Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
jobs: | ||
build-apptainer-image: | ||
runs-on: [self-hosted, mi3008x] | ||
timeout-minutes: 90 | ||
|
||
steps: | ||
- 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 | ||
|
||
- name: Build Iris Apptainer container | ||
run: | | ||
# 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 | ||
|
||
external-validation-test: | ||
name: External Validation Test | ||
needs: build-apptainer-image | ||
runs-on: [self-hosted, mi3008x] | ||
timeout-minutes: 30 | ||
|
||
steps: | ||
- name: Run External Validation Test with Apptainer | ||
run: | | ||
apptainer exec ~/apptainer/iris-dev.sif bash -c " | ||
set -e # Exit on any error | ||
|
||
# Setup Python | ||
python3 -m pip install --upgrade pip | ||
|
||
# Uninstall any existing Iris installations | ||
echo 'Uninstalling any existing Iris packages...' | ||
pip uninstall -y Iris iris || echo 'No existing Iris packages found or uninstall failed' | ||
rm -rf build dist *.egg-info | ||
|
||
# Install iris from the current repository | ||
echo 'Installing iris from current repository...' | ||
pip install --force-reinstall --no-deps git+https://github.com/${{ github.repository }}.git@${{ github.sha }} | ||
|
||
# Download test script from gist | ||
echo 'Downloading test script from gist...' | ||
wget -O test_iris_distributed.py https://gist.githubusercontent.com/mawad-amd/6375dc078e39e256828f379e03310ec7/raw/a527c3192bee4615292769e340b1c73676f6945a/test_iris_distributed.py | ||
|
||
# Run the external validation test | ||
echo 'Running iris external validation test...' | ||
python test_iris_distributed.py | ||
|
||
echo 'External validation test completed successfully!' | ||
" |
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,88 @@ | ||
name: Iris Pip Install Test | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
||
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 | ||
|
||
- name: Build Iris Apptainer container | ||
run: | | ||
# 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 | ||
|
||
pip-install-test: | ||
name: ${{ matrix.ranks }}-rank Pip Install Test | ||
needs: [build-apptainer-image] | ||
runs-on: [self-hosted, mi3008x] | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
ranks: [1, 2, 4, 8] | ||
max-parallel: 1 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run Pip Install Test with Apptainer | ||
run: | | ||
apptainer exec ~/apptainer/iris-dev.sif bash -c " | ||
set -e # Exit on any error | ||
|
||
# Setup Python | ||
python3 -m pip install --upgrade pip | ||
pip install pytest | ||
|
||
# Uninstall any existing Iris installations | ||
echo 'Uninstalling any existing Iris packages...' | ||
pip uninstall -y Iris iris || echo 'No existing Iris packages found or uninstall failed' | ||
rm -rf build dist *.egg-info | ||
|
||
# Install iris from the current repository | ||
pip install --force-reinstall --no-deps git+https://github.com/${{ github.repository }}.git@${{ github.sha }} | ||
|
||
# Run examples tests one at a time using distributed wrapper | ||
echo 'Running examples tests one at a time...' | ||
for test_file in tests/examples/test_*.py; do | ||
echo \"Testing: \$test_file with ${{ matrix.ranks }} ranks\" | ||
python tests/run_tests_distributed.py --num_ranks ${{ matrix.ranks }} \"\$test_file\" -v --tb=short | ||
done | ||
|
||
# Run unit tests one at a time using distributed wrapper | ||
echo 'Running unit tests one at a time...' | ||
for test_file in tests/unittests/test_*.py; do | ||
echo \"Testing: \$test_file with ${{ matrix.ranks }} ranks\" | ||
python tests/run_tests_distributed.py --num_ranks ${{ matrix.ranks }} \"\$test_file\" -v --tb=short | ||
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
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.