Skip to content

Commit 081a673

Browse files
committed
try fix no space left in packaging pipeline
Signed-off-by: Yun Liu <[email protected]>
1 parent d2ab308 commit 081a673

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

.github/workflows/pythonapp.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ jobs:
127127
runs-on: ubuntu-latest
128128
env:
129129
QUICKTEST: True
130+
PIP_DISABLE_PIP_VERSION_CHECK: "1"
130131
shell: bash
131132
steps:
132133
- uses: actions/checkout@v6
@@ -136,26 +137,25 @@ jobs:
136137
uses: actions/setup-python@v6
137138
with:
138139
python-version: '3.9'
139-
- name: cache weekly timestamp
140+
- name: Get pip cache dir
140141
id: pip-cache
141142
run: |
142-
echo "datew=$(date '+%Y-%V')" >> $GITHUB_OUTPUT
143-
- name: cache for pip
143+
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
144+
- name: Cache pip (packaging)
144145
uses: actions/cache@v4
145-
id: cache
146146
with:
147-
path: |
148-
~/.cache/pip
149-
~/.cache/torch
150-
key: ${{ runner.os }}-pip-${{ steps.pip-cache.outputs.datew }}
147+
path: ${{ steps.pip-cache.outputs.dir }}
148+
key: ${{ runner.os }}-packaging-pip-${{ hashFiles('requirements*.txt', 'setup.cfg', 'pyproject.toml') }}
151149
- name: Install dependencies
152150
run: |
151+
df -h
153152
find /opt/hostedtoolcache/* -maxdepth 0 ! -name 'Python' -exec rm -rf {} \;
154153
python -m pip install --user --upgrade pip setuptools wheel twine packaging
155-
# install the latest pytorch for testing
154+
# install CPU-only pytorch for testing to keep runner disk usage manageable
156155
# however, "pip install monai*.tar.gz" will build cpp/cuda with an isolated
157156
# fresh torch installation according to pyproject.toml
158-
python -m pip install torch>=2.5.1 torchvision
157+
python -m pip install --no-cache-dir torch==2.5.1+cpu torchvision==0.20.1+cpu --index-url https://download.pytorch.org/whl/cpu
158+
df -h
159159
- name: Check packages
160160
run: |
161161
pip uninstall monai
@@ -184,7 +184,7 @@ jobs:
184184
working-directory: ${{ steps.mktemp.outputs.tmp_dir }}
185185
run: |
186186
# install from wheel
187-
python -m pip install monai*.whl
187+
python -m pip install --no-cache-dir monai*.whl
188188
python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
189189
python -c 'import monai; print(monai.__file__)'
190190
python -m pip uninstall -y monai
@@ -195,7 +195,8 @@ jobs:
195195
# install from tar.gz
196196
name=$(ls *.tar.gz | head -n1)
197197
echo $name
198-
python -m pip install $name[all]
198+
# avoid installing monai[all] here (it pulls very large optional deps like itk/mlflow/clearml/lpips)
199+
python -m pip install --no-cache-dir "$name"
199200
python -c 'import monai; monai.config.print_config()' 2>&1 | grep -iv "unknown"
200201
python -c 'import monai; print(monai.__file__)'
201202
- name: Quick test
@@ -205,8 +206,8 @@ jobs:
205206
cp ${{ steps.root.outputs.pwd }}/requirements*.txt .
206207
cp -r ${{ steps.root.outputs.pwd }}/tests .
207208
ls -al
208-
python -m pip install -r requirements-dev.txt
209-
python -m unittest -v
209+
python -m pip install -r requirements-min.txt
210+
python -m tests.min_tests
210211
env:
211212
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python # https://github.com/Project-MONAI/MONAI/issues/4354
212213

0 commit comments

Comments
 (0)