diff --git a/.github/workflows/weekly-tests-cpu.yml b/.github/workflows/weekly-tests-cpu.yml index 23ca679b..d03b9872 100644 --- a/.github/workflows/weekly-tests-cpu.yml +++ b/.github/workflows/weekly-tests-cpu.yml @@ -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: | @@ -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: | @@ -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: | diff --git a/ci/run_premerge_cpu.sh b/ci/run_premerge_cpu.sh index 87b72426..000424c3 100755 --- a/ci/run_premerge_cpu.sh +++ b/ci/run_premerge_cpu.sh @@ -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 diff --git a/ci/run_regular_tests_cpu.sh b/ci/run_regular_tests_cpu.sh index 183af8d8..253cc86c 100755 --- a/ci/run_regular_tests_cpu.sh +++ b/ci/run_regular_tests_cpu.sh @@ -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 }