Skip to content

Fix weekly test issue [skip-ci] #746

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
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 6 additions & 5 deletions .github/workflows/weekly-tests-cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.10.14
- name: cache weekly timestamp
id: pip-cache
run: |
Expand All @@ -29,7 +29,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements-dev.txt
python -m pip install --upgrade setuptools
python -m pip install -r requirements.txt
- name: get bundle list
id: get-bundle-list
run: |
Expand All @@ -47,10 +48,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.10.14
- name: cache weekly timestamp
id: pip-cache
run: |
Expand Down
2 changes: 1 addition & 1 deletion ci/run_premerge_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
# Usually, CPU test is required, but for some bundles that are too large to run in Github Actions, we can exclude them.
exclude_test_list=("maisi_ct_generative")
is_excluded() {
for item in "${exclude_list[@]}"; do
for item in "${exclude_test_list[@]}"; do # Use exclude_test_list here
if [ "$1" == "$item" ]; then
return 0 # Return true (0) if excluded
fi
Expand Down
54 changes: 34 additions & 20 deletions ci/run_regular_tests_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,44 @@ elif [[ $# -gt 1 ]]; then
exit 1
fi

# Usually, CPU test is required, but for some bundles that are too large to run in Github Actions, we can exclude them.
exclude_test_list=("maisi_ct_generative")
is_excluded() {
for item in "${exclude_test_list[@]}"; do # Use exclude_test_list here
if [ "$1" == "$item" ]; then
return 0 # Return true (0) if excluded
fi
done
return 1 # Return false (1) if not excluded
}

verify_release_bundle() {
echo 'Run verify bundle...'
# get all bundles
download_path="download"
pip install git+https://github.com/Project-MONAI/MONAI.git@dev # project-monai/model-zoo issue #505
pip install jsonschema gdown
# download bundle from releases
python $(pwd)/ci/download_latest_bundle.py --b "$bundle" --models_path $(pwd)/models --p "$download_path"
# get required libraries according to the bundle's metadata file
requirements_file="requirements_$bundle.txt"
python $(pwd)/ci/get_bundle_requirements.py --b "$bundle" --requirements_file "$requirements_file"
# check if ALLOW_MONAI_RC is set to 1, if so, append --pre to the pip install command
if [ $ALLOW_MONAI_RC = true ]; then
include_pre_release="--pre"
if is_excluded "$bundle"; then
echo "skip '$bundle' weekly cpu tests."
else
include_pre_release=""
fi
# Check if the requirements file exists and is not empty
if [ -s "$requirements_file" ]; then
echo "install required libraries for bundle: $bundle"
pip install $include_pre_release -r "$requirements_file"
download_path="download"
pip install git+https://github.com/Project-MONAI/MONAI.git@dev # project-monai/model-zoo issue #505
pip install jsonschema gdown huggingface_hub==0.29.3
# download bundle from releases
python $(pwd)/ci/download_latest_bundle.py --b "$bundle" --models_path $(pwd)/models --p "$download_path"
# get required libraries according to the bundle's metadata file
requirements_file="requirements_$bundle.txt"
python $(pwd)/ci/get_bundle_requirements.py --b "$bundle" --requirements_file "$requirements_file"
# check if ALLOW_MONAI_RC is set to 1, if so, append --pre to the pip install command
if [ $ALLOW_MONAI_RC = true ]; then
include_pre_release="--pre"
else
include_pre_release=""
fi
# Check if the requirements file exists and is not empty
if [ -s "$requirements_file" ]; then
echo "install required libraries for bundle: $bundle"
pip install $include_pre_release -r "$requirements_file"
fi
# verify bundle
python $(pwd)/ci/verify_bundle.py -b "$bundle" -p "$download_path" -m "regular" # regular tests on cpu
fi
# verify bundle
python $(pwd)/ci/verify_bundle.py -b "$bundle" -p "$download_path" -m "regular" # regular tests on cpu
}


Expand Down
Loading