Skip to content

Commit 28c5e53

Browse files
authored
Merge pull request #352 from getwilds/skip-cellranger
Scaling back CellRanger to a template and private distribution
2 parents 635da9b + c27b71d commit 28c5e53

8 files changed

Lines changed: 195 additions & 279 deletions

File tree

.github/scripts/docker_update.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,34 @@ def load_amd64_only_tools():
7575
AMD64_ONLY_TOOLS = load_amd64_only_tools()
7676

7777

78+
def load_ci_skip_tools():
79+
"""
80+
Load the list of tools to skip in CI from ci_skip_tools.txt.
81+
82+
These tools are excluded from the automated build-and-push pipeline,
83+
typically due to licensing restrictions that prevent automated downloads.
84+
Their images are maintained manually outside of CI.
85+
86+
Returns:
87+
set: Set of tool names that should be skipped in CI
88+
"""
89+
ci_skip_file = os.path.join(
90+
os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
91+
"ci_skip_tools.txt"
92+
)
93+
try:
94+
with open(ci_skip_file, "r") as f:
95+
return {line.strip() for line in f if line.strip()}
96+
except FileNotFoundError:
97+
logger.warning(f"ci_skip_tools.txt not found at {ci_skip_file}, using empty set")
98+
return set()
99+
100+
101+
# Tools to skip entirely in CI (e.g., due to licensing restrictions)
102+
# Loaded from ci_skip_tools.txt
103+
CI_SKIP_TOOLS = load_ci_skip_tools()
104+
105+
78106
def get_image_size(image_name):
79107
"""
80108
Get the size of a Docker image in bytes using docker manifest inspect.
@@ -521,6 +549,11 @@ def build_and_push_images(docker_files):
521549
tool_name = os.path.dirname(dockerfile)
522550
tag = os.path.basename(dockerfile).split("_")[-1]
523551

552+
# Skip tools that are excluded from CI (e.g., due to licensing restrictions)
553+
if tool_name in CI_SKIP_TOOLS:
554+
logger.info(f"Skipping {tool_name}:{tag} (listed in ci_skip_tools.txt)")
555+
continue
556+
524557
logger.info(f"Building image for {tool_name}:{tag}")
525558

526559
# Check if this image should be AMD64-only
@@ -591,6 +624,12 @@ def update_dockerhub_descriptions(affected_dirs):
591624
continue
592625

593626
repo_name = os.path.basename(directory)
627+
628+
# Skip tools excluded from CI (no DockerHub repo to update)
629+
if repo_name in CI_SKIP_TOOLS:
630+
logger.info(f"Skipping {repo_name}: excluded from CI (ci_skip_tools.txt)")
631+
continue
632+
594633
logger.info(f"Processing repository: getwilds/{repo_name}")
595634

596635
# Check for README.md

cellranger/CVEs_10.0.0.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

cellranger/CVEs_6.0.2.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

cellranger/Dockerfile_10.0.0

Lines changed: 0 additions & 59 deletions
This file was deleted.

cellranger/Dockerfile_6.0.2

Lines changed: 0 additions & 59 deletions
This file was deleted.

cellranger/Dockerfile_latest

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
# Using the Ubuntu base image
33
FROM ubuntu:24.04
44

5+
# Build arguments for Cell Ranger version and download URL
6+
# Users must obtain their own download URL from 10x Genomics after accepting
7+
# their license agreement: https://www.10xgenomics.com/support/software/cell-ranger/downloads
8+
ARG CELLRANGER_VERSION
9+
ARG CELLRANGER_URL
10+
511
# Adding labels for the GitHub Container Registry
612
LABEL org.opencontainers.image.title="cellranger"
713
LABEL org.opencontainers.image.description="Container image for the use of Cell Ranger in Fred Hutch OCDO's WILDS"
8-
LABEL org.opencontainers.image.version="10.0.0"
14+
LABEL org.opencontainers.image.version="${CELLRANGER_VERSION}"
915
LABEL org.opencontainers.image.authors="wilds@fredhutch.org"
1016
LABEL org.opencontainers.image.url=https://hutchdatascience.org/
1117
LABEL org.opencontainers.image.documentation=https://getwilds.org/
@@ -15,6 +21,19 @@ LABEL org.opencontainers.image.licenses=MIT
1521
# Set the shell option to fail if any command in a pipe fails
1622
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1723

24+
# Validate that required build arguments were provided
25+
RUN if [ -z "${CELLRANGER_VERSION}" ]; then \
26+
echo "ERROR: CELLRANGER_VERSION build argument is required." && \
27+
echo "Example: --build-arg CELLRANGER_VERSION=10.0.0" && \
28+
exit 1; \
29+
fi
30+
RUN if [ -z "${CELLRANGER_URL}" ]; then \
31+
echo "ERROR: CELLRANGER_URL build argument is required." && \
32+
echo "Please obtain a download URL from 10x Genomics:" && \
33+
echo "https://www.10xgenomics.com/support/software/cell-ranger/downloads" && \
34+
exit 1; \
35+
fi
36+
1837
# Installing prerequisites
1938
RUN apt-get update \
2039
&& BUILD_ESSENTIAL_VERSION=$(apt-cache policy build-essential | grep Candidate | awk '{print $2}') \
@@ -41,19 +60,18 @@ RUN apt-get update \
4160
&& rm -rf /var/lib/apt/lists/*
4261

4362
# Download and install Cell Ranger pre-built binary
44-
# Note: The download URL contains a signed key that expires.
45-
# A new download URL should be obtained from 10x Genomics each time this Dockerfile is updated.
46-
RUN wget -q --no-check-certificate -O cellranger-10.0.0.tar.gz \
47-
"https://cf.10xgenomics.com/releases/cell-exp/cellranger-10.0.0.tar.gz?Expires=1766424907&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA&Signature=Se7y~SfN80~5Q61MkUOLIgsO40FlwMj6BuJjAmP6S74H7ZI6PSI8CCZgOHMoz3BUYZKhKwI~oC5sUqUqMbzw3wbmJcmrhPneNagGvnDwRmULTA6Smyn4K7A-k0t7qjVW5W8aiERueW5057JJk4LKPZJHKoV7tqMVA5beAU4Ari2Deu5K5hHKfNK0OWIYl9mxlAP8mg2Go6KzhOVFKAQy-VzoqpGFSOW3jSnHAMrOhHtpX4jdhshm-Kca2NeSAZome4j6uPfUyKYdQRWTwOI1EgXcyRFRBHEQe6TVsOt4IqxtCYKEgjLm3SDt5f5Nzds5plRJ~V2jpcG-ew5ABnUXNg__" \
48-
&& tar -xzf cellranger-10.0.0.tar.gz \
49-
&& rm -rf cellranger-10.0.0.tar.gz
63+
# The download URL must be obtained from 10x Genomics after accepting their license agreement.
64+
# URLs contain a signed key that expires, so a fresh URL is needed for each build.
65+
RUN wget -q --no-check-certificate -O "cellranger-${CELLRANGER_VERSION}.tar.gz" \
66+
"${CELLRANGER_URL}" \
67+
&& tar -xzf "cellranger-${CELLRANGER_VERSION}.tar.gz" \
68+
&& rm -rf "cellranger-${CELLRANGER_VERSION}.tar.gz"
5069

5170
# Set environment variables
52-
ENV PATH="${PATH}:/cellranger-10.0.0"
71+
ENV PATH="${PATH}:/cellranger-${CELLRANGER_VERSION}"
5372

5473
# Set working directory
5574
WORKDIR /data
5675

5776
# Smoke test (NOTE: Cell Ranger only works on x86_64 Linux)
5877
RUN cellranger --version
59-

0 commit comments

Comments
 (0)