Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,17 @@ jobs:
with:
ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }}

- name: Set source package version
id: source-version
run: |
if [[ "${GITHUB_EVENT_NAME}" == "release" ]]; then
VERSION="${GITHUB_REF_NAME#v}"
else
VERSION="0.0.0.dev0+g$(git rev-parse --short=12 HEAD)"
fi
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
shell: bash

- name: Set pending status on PR
if: github.event_name == 'issue_comment'
run: |
Expand Down Expand Up @@ -142,8 +153,9 @@ jobs:
labels: ${{ steps.meta-base.outputs.labels }}
build-args: |
CUDA_VER=${{ matrix.CUDA_SUFFIX.ver }}
GIT_ID=${{ github.event.pull_request.head.sha || github.sha }}
#cache-from: type=registry,ref=ghcr.io/${{ github.repository }}-deps
build-contexts: |
source=.

- name: Generate artifact attestation for base image
if: github.event_name == 'release'
Expand Down Expand Up @@ -171,10 +183,11 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
CUDA_ARCHS=${{ matrix.CUDA_SUFFIX.label == 'cuda12' && '75-real;80-real;86-real;89-real;90' || '75-real;80-real;86-real;89-real;90-real;100-real;120' }}
GIT_ID=${{ github.event.pull_request.head.sha || github.sha }}
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAPIDS_SINGLECELL=${{ steps.source-version.outputs.version }}
#cache-from: type=registry,ref=ghcr.io/${{ github.repository }}
build-contexts: |
rapids-singlecell-deps=docker-image://${{ fromJSON(steps.meta-base.outputs.json).tags[0] }}
source=.

- name: Generate artifact attestation for main image
if: github.event_name == 'release'
Expand Down
12 changes: 5 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM rapids-singlecell-deps

ARG GIT_ID=main

SHELL ["/bin/bash", "-euo", "pipefail", "-c"]

ENV PATH=/opt/conda/bin:$PATH
Expand All @@ -11,15 +9,15 @@ ENV PATH=/opt/conda/bin:$PATH
# pick up the CUDA-matched librmm instead of a mismatched PyPI wheel.
ENV CMAKE_PREFIX_PATH=/opt/conda
ARG CUDA_ARCHS="75-real;80-real;86-real;89-real;90-real;100-real;120"
ARG SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAPIDS_SINGLECELL=0.0.0

COPY --from=source . /src/rapids_singlecell

RUN <<EOF
# install rapids_singlecell from source (compiled for all supported GPU architectures)
set -x
mkdir /src
cd /src
git clone https://github.com/scverse/rapids_singlecell.git
cd rapids_singlecell
git checkout ${GIT_ID}
export SETUPTOOLS_SCM_PRETEND_VERSION_FOR_RAPIDS_SINGLECELL
cd /src/rapids_singlecell
# Set CUDA architectures directly in pyproject.toml (avoids SKBUILD_CMAKE_ARGS semicolon splitting)
sed -i 's/CMAKE_CUDA_ARCHITECTURES = "native"/CMAKE_CUDA_ARCHITECTURES = "'"${CUDA_ARCHS}"'"/' pyproject.toml
grep CMAKE_CUDA_ARCHITECTURES pyproject.toml
Expand Down
11 changes: 3 additions & 8 deletions docker/Dockerfile.deps
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ ENV PYTHON_VERSION=${PYTHON_VER}
COPY --from=condaforge/miniforge3:26.1.1-3 /opt/conda /opt/conda

COPY rsc_rapids.yml rsc_rapids.yml
COPY --from=source pyproject.toml /tmp/rapids_singlecell_pyproject.toml

ARG GIT_ID=main
ARG DEBIAN_FRONTEND=noninteractive

RUN <<EOF
# install system dependencies
set -x
apt-get -qq update
apt-get -q -o=Dpkg::Use-Pty=0 -y dist-upgrade
apt-get -q install -y -o=Dpkg::Use-Pty=0 git
apt-get -q clean -y
rm -rf /var/lib/apt/lists/*
EOF
Expand Down Expand Up @@ -75,17 +74,13 @@ EOF
RUN <<EOF
# install rapids_singlecell pip dependencies (without building the package)
set -x
cd /tmp
git clone https://github.com/scverse/rapids_singlecell.git
cd rapids_singlecell
git checkout ${GIT_ID}
/opt/conda/bin/python -c "
import tomllib
with open('pyproject.toml', 'rb') as f:
with open('/tmp/rapids_singlecell_pyproject.toml', 'rb') as f:
data = tomllib.load(f)
with open('/tmp/deps.txt', 'w') as f:
f.write('\n'.join(data['project']['dependencies']))
"
/opt/conda/bin/python -m pip install --no-cache-dir -r /tmp/deps.txt
rm -rf /tmp/rapids_singlecell /tmp/deps.txt
rm -f /tmp/rapids_singlecell_pyproject.toml /tmp/deps.txt
EOF
Loading