Skip to content

Commit 4792eb7

Browse files
Fix weekly test issue [skip-ci] (#746)
### Description Based on Project-MONAI/MONAI#8394 , we can use the latest MONAI to fix weekly test issues. ### Status **Ready/Work in progress/Hold** ### Please ensure all the checkboxes: <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Codeformat tests passed locally by running `./runtests.sh --codeformat`. - [ ] In-line docstrings updated. - [ ] Update `version` and `changelog` in `metadata.json` if changing an existing bundle. - [ ] Please ensure the naming rules in config files meet our requirements (please refer to: `CONTRIBUTING.md`). - [ ] Ensure versions of packages such as `monai`, `pytorch` and `numpy` are correct in `metadata.json`. - [ ] Descriptions should be consistent with the content, such as `eval_metrics` of the provided weights and TorchScript modules. - [ ] Files larger than 25MB are excluded and replaced by providing download links in `large_file.yml`. - [ ] Avoid using path that contains personal information within config files (such as use `/home/your_name/` for `"bundle_root"`). --------- Signed-off-by: Yiheng Wang <[email protected]>
1 parent f7daa60 commit 4792eb7

File tree

3 files changed

+41
-26
lines changed

3 files changed

+41
-26
lines changed

.github/workflows/weekly-tests-cpu.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Set up Python 3.9
15+
- name: Set up Python 3.10
1616
uses: actions/setup-python@v4
1717
with:
18-
python-version: 3.9
18+
python-version: 3.10.14
1919
- name: cache weekly timestamp
2020
id: pip-cache
2121
run: |
@@ -29,7 +29,8 @@ jobs:
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip wheel
32-
python -m pip install -r requirements-dev.txt
32+
python -m pip install --upgrade setuptools
33+
python -m pip install -r requirements.txt
3334
- name: get bundle list
3435
id: get-bundle-list
3536
run: |
@@ -47,10 +48,10 @@ jobs:
4748
runs-on: ubuntu-latest
4849
steps:
4950
- uses: actions/checkout@v4
50-
- name: Set up Python 3.9
51+
- name: Set up Python 3.10
5152
uses: actions/setup-python@v4
5253
with:
53-
python-version: 3.9
54+
python-version: 3.10.14
5455
- name: cache weekly timestamp
5556
id: pip-cache
5657
run: |

ci/run_premerge_cpu.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fi
3333
# Usually, CPU test is required, but for some bundles that are too large to run in Github Actions, we can exclude them.
3434
exclude_test_list=("maisi_ct_generative")
3535
is_excluded() {
36-
for item in "${exclude_list[@]}"; do
36+
for item in "${exclude_test_list[@]}"; do # Use exclude_test_list here
3737
if [ "$1" == "$item" ]; then
3838
return 0 # Return true (0) if excluded
3939
fi

ci/run_regular_tests_cpu.sh

+34-20
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,44 @@ elif [[ $# -gt 1 ]]; then
3030
exit 1
3131
fi
3232

33+
# Usually, CPU test is required, but for some bundles that are too large to run in Github Actions, we can exclude them.
34+
exclude_test_list=("maisi_ct_generative")
35+
is_excluded() {
36+
for item in "${exclude_test_list[@]}"; do # Use exclude_test_list here
37+
if [ "$1" == "$item" ]; then
38+
return 0 # Return true (0) if excluded
39+
fi
40+
done
41+
return 1 # Return false (1) if not excluded
42+
}
43+
3344
verify_release_bundle() {
3445
echo 'Run verify bundle...'
35-
# get all bundles
36-
download_path="download"
37-
pip install git+https://github.com/Project-MONAI/MONAI.git@dev # project-monai/model-zoo issue #505
38-
pip install jsonschema gdown
39-
# download bundle from releases
40-
python $(pwd)/ci/download_latest_bundle.py --b "$bundle" --models_path $(pwd)/models --p "$download_path"
41-
# get required libraries according to the bundle's metadata file
42-
requirements_file="requirements_$bundle.txt"
43-
python $(pwd)/ci/get_bundle_requirements.py --b "$bundle" --requirements_file "$requirements_file"
44-
# check if ALLOW_MONAI_RC is set to 1, if so, append --pre to the pip install command
45-
if [ $ALLOW_MONAI_RC = true ]; then
46-
include_pre_release="--pre"
46+
if is_excluded "$bundle"; then
47+
echo "skip '$bundle' weekly cpu tests."
4748
else
48-
include_pre_release=""
49-
fi
50-
# Check if the requirements file exists and is not empty
51-
if [ -s "$requirements_file" ]; then
52-
echo "install required libraries for bundle: $bundle"
53-
pip install $include_pre_release -r "$requirements_file"
49+
download_path="download"
50+
pip install git+https://github.com/Project-MONAI/MONAI.git@dev # project-monai/model-zoo issue #505
51+
pip install jsonschema gdown huggingface_hub==0.29.3
52+
# download bundle from releases
53+
python $(pwd)/ci/download_latest_bundle.py --b "$bundle" --models_path $(pwd)/models --p "$download_path"
54+
# get required libraries according to the bundle's metadata file
55+
requirements_file="requirements_$bundle.txt"
56+
python $(pwd)/ci/get_bundle_requirements.py --b "$bundle" --requirements_file "$requirements_file"
57+
# check if ALLOW_MONAI_RC is set to 1, if so, append --pre to the pip install command
58+
if [ $ALLOW_MONAI_RC = true ]; then
59+
include_pre_release="--pre"
60+
else
61+
include_pre_release=""
62+
fi
63+
# Check if the requirements file exists and is not empty
64+
if [ -s "$requirements_file" ]; then
65+
echo "install required libraries for bundle: $bundle"
66+
pip install $include_pre_release -r "$requirements_file"
67+
fi
68+
# verify bundle
69+
python $(pwd)/ci/verify_bundle.py -b "$bundle" -p "$download_path" -m "regular" # regular tests on cpu
5470
fi
55-
# verify bundle
56-
python $(pwd)/ci/verify_bundle.py -b "$bundle" -p "$download_path" -m "regular" # regular tests on cpu
5771
}
5872

5973

0 commit comments

Comments
 (0)