Skip to content

Commit f29a975

Browse files
authored
fix: slim container image (#314)
This changes switches from rapidsai container image to the smaller miniconda image to remove potential dependency on the tools not needed for the build.
1 parent fd5e8ad commit f29a975

File tree

2 files changed

+60
-13
lines changed

2 files changed

+60
-13
lines changed

.github/workflows/conda-python-build.yaml

Lines changed: 55 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,21 +57,21 @@ jobs:
5757
5858
# Please keep the matrices sorted in ascending order by the following:
5959
#
60-
# [ARCH, PY_VER, CUDA_VER, LINUX_VER]
60+
# [ARCH, PY_VER]
6161
#
6262
export MATRIX="
6363
# amd64
64-
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
65-
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
66-
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
67-
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
68-
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
64+
- { ARCH: 'amd64', PY_VER: '3.10' }
65+
- { ARCH: 'amd64', PY_VER: '3.11' }
66+
- { ARCH: 'amd64', PY_VER: '3.12' }
67+
- { ARCH: 'amd64', PY_VER: '3.13' }
68+
- { ARCH: 'amd64', PY_VER: '3.14' }
6969
# arm64
70-
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
71-
- { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
72-
- { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
73-
- { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
74-
- { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '12.9.1', LINUX_VER: 'rockylinux8' }
70+
- { ARCH: 'arm64', PY_VER: '3.10' }
71+
- { ARCH: 'arm64', PY_VER: '3.11' }
72+
- { ARCH: 'arm64', PY_VER: '3.12' }
73+
- { ARCH: 'arm64', PY_VER: '3.13' }
74+
- { ARCH: 'arm64', PY_VER: '3.14' }
7575
"
7676
7777
MATRIX="$(
@@ -88,8 +88,10 @@ jobs:
8888
runs-on: "linux-${{ matrix.ARCH }}-${{ inputs.node_type }}"
8989
env:
9090
RAPIDS_ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
91+
RAPIDS_CONDA_BLD_OUTPUT_DIR: /tmp/conda-bld-output
92+
RAPIDS_CONDA_BLD_ROOT_DIR: /tmp/conda-bld-workspace
9193
container:
92-
image: rapidsai/ci-conda:cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }}
94+
image: condaforge/miniforge3:26.1.1-3
9395
env:
9496
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }}
9597
steps:
@@ -103,6 +105,46 @@ jobs:
103105
repository: ${{ inputs.repo }}
104106
ref: ${{ inputs.sha }}
105107
fetch-depth: 0
108+
- name: Install required packages
109+
run: |
110+
apt update
111+
apt install -y jq gh unzip curl gettext
112+
- name: Add Rapids tools
113+
run: |
114+
mkdir gha-tools
115+
curl -fsSL https://github.com/rapidsai/gha-tools/archive/refs/tags/v0.0.198.tar.gz | \
116+
tar -xz -C gha-tools --strip-components 1 -f -
117+
- name: Add RAPIDS gha-tools to PATH
118+
run: echo "${GITHUB_WORKSPACE}/gha-tools/tools" | tee -a "${GITHUB_PATH}"
119+
- name: Prepare conda rc file
120+
run: envsubst < ci/condarc.tmpl | tee ~/.condarc
121+
- name: Mark workspace safe for the git command
122+
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
123+
- name: Install sccache
124+
env:
125+
# renovate: datasource=github-releases depName=rapidsai/sccache
126+
SCCACHE_VERSION: 0.14.0-rapids.1
127+
GH_TOKEN: ${{ github.token }}
128+
run: rapids-install-sccache
129+
- name: Update conda and install conda build
130+
run: |
131+
set -x
132+
# Is update really needed?
133+
rapids-mamba-retry update --all -y -n base
134+
conda install -y conda-build
135+
- name: Install python
136+
env:
137+
PYTHON_VERSION: ${{ matrix.PY_VER }}
138+
run: |
139+
PYTHON_MAJOR_VERSION=${PYTHON_VERSION%%.*}
140+
PYTHON_MINOR_VERSION=${PYTHON_VERSION#*.}
141+
PYTHON_UPPER_BOUND="${PYTHON_MAJOR_VERSION}.$((PYTHON_MINOR_VERSION+1)).0a0"
142+
if [[ "${PYTHON_MINOR_VERSION}" -gt 12 ]]; then
143+
PYTHON_ABI_TAG="cp${PYTHON_MAJOR_VERSION}${PYTHON_MINOR_VERSION}"
144+
else
145+
PYTHON_ABI_TAG="cpython"
146+
fi
147+
rapids-mamba-retry install -y -n base "python>=${PYTHON_VERSION},<${PYTHON_UPPER_BOUND}=*_${PYTHON_ABI_TAG}"
106148
- name: Standardize repository information
107149
run: |
108150
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}"
@@ -129,7 +171,7 @@ jobs:
129171
uses: actions/upload-artifact@v7
130172
with:
131173
name: conda-repo-${{ matrix.ARCH }}-${{ matrix.PY_VER }}
132-
path: "/tmp/conda-bld-output"
174+
path: ${{ env.RAPIDS_CONDA_BLD_OUTPUT_DIR }}
133175
- name: Publish Conda Package
134176
if: inputs.upload_to_conda
135177
run: "ci/upload_conda.sh"

ci/condarc.tmpl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
conda-build:
2+
pkg_format: '2'
3+
set_build_id: false
4+
root_dir: $RAPIDS_CONDA_BLD_ROOT_DIR
5+
output_folder: $RAPIDS_CONDA_BLD_OUTPUT_DIR

0 commit comments

Comments
 (0)