Skip to content

Commit

Permalink
ENH: Reduce downloads in self-hosted Github runners
Browse files Browse the repository at this point in the history
To use new versions of ITKPythonBuilds, one will have to manually remove
the old version on the runner.
  • Loading branch information
Simon Rit committed Nov 19, 2022
1 parent de2796e commit 58ffcd1
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,22 @@ jobs:
- name: 'Fetch build script'
run: |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
sed -i "s/^rm/\#rm/g" dockcross-manylinux-download-cache-and-build-module-wheels.sh
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
- name: 'Build 🐍 Python 📦 package'
run: |
export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }}
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda116:/home/srit/Downloads/cuda116/targets/x86_64-linux/lib:/home/srit/Downloads/cuda116/lib64/stubs"
if test -e ../../ITKPythonBuilds-linux-manylinux2014.tar.zst ; then
mv ../../*zst .
fi
for tarball in "-manylinux_2_28" "-manylinux2014"; do
rm -rf ITKPythonPackage
export TARBALL_SPECIALIZATION=${tarball}
./dockcross-manylinux-download-cache-and-build-module-wheels.sh -c "-DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc -DCUDACOMMON_CUDA_VERSION=11.6" -x "libcuda.so;libcuda.so.1;libcudart.so;libcudart.so.11.0;libcublas.so;libcublas.so.11;libcublasLt.so;libcublasLt.so.11;libcufft.so;libcufft.so.10" cp${{ matrix.python-version }}
done
mv *zst ../..
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v1
Expand Down Expand Up @@ -183,18 +187,30 @@ jobs:
- name: self-hosted cleanup
shell: bash
run: |
if test -f ../../im/ITKPythonBuilds-windows.zip; then
mv ../../im/*.zip .
fi
rm -fr ../../im
- name: 'Fetch build dependencies'
shell: bash
run: |
if test -f ITKPythonBuilds-windows.zip; then
mv *.zip im
fi
mv im ../../
cd ../../im
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
if ! test -f ITKPythonBuilds-windows.zip; then
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
fi
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
if ! test -f doxygen-1.8.11.windows.bin.zip; then
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
fi
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
if ! test -f grep-win.zip; then
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
fi
7z x grep-win.zip -o/c/P/grep -aoa -r
- name: 'Build 🐍 Python 📦 package'
Expand Down

0 comments on commit 58ffcd1

Please sign in to comment.