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
8 changes: 6 additions & 2 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
env:
EVENT_NAME: ${{ github.event_name }}
BEFORE_SHA: ${{ github.event.before }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
DOCKERFILE: ${{ inputs.dockerfile }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
Expand All @@ -51,7 +52,11 @@ jobs:
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
changed_files="$DOCKERFILE"
elif [[ "$BEFORE_SHA" =~ ^0+$ ]]; then
changed_files="$(git ls-tree -r --name-only "$GITHUB_SHA")"
# A branch's first push has no predecessor SHA. Compare it with
# the default branch instead of treating every repository file as
# newly added.
base_sha="$(git merge-base "origin/$DEFAULT_BRANCH" "$GITHUB_SHA")"
changed_files="$(git diff --name-only --diff-filter=AMR "$base_sha" "$GITHUB_SHA")"
else
changed_files="$(git diff --name-only --diff-filter=AMR "$BEFORE_SHA" "$GITHUB_SHA")"
fi
Expand Down Expand Up @@ -106,7 +111,6 @@ jobs:
--label "org.opencontainers.image.url=$source_url" \
--label "org.opencontainers.image.title=$image_name" \
--provenance=mode=max \
--sbom=true \
--push \
"$context"
done
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## Unreleased

### Fixed

- Updated the ChipSeeker 1.32 image's Jupyter base and fixed the Bioconductor
data-package post-install hook so its R dependencies install successfully;
the ChipSeeker package is now pinned to version 1.32.0.
- Fixed first-push Dockerfile detection and removed BuildKit SBOM attachment
generation, which can exceed GitHub Container Registry's size limit for
large images; provenance remains enabled.

### Added

- GitHub Actions publishing of changed Dockerfiles to GitHub Container Registry
Expand Down
46 changes: 38 additions & 8 deletions images/chipseeker/1.32/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
################## BASE IMAGE ######################

FROM jupyter/datascience-notebook:hub-2.2.2
FROM jupyter/datascience-notebook:latest

################## METADATA ######################

LABEL base_image="jupyter/datascience-notebook:hub-2.2.2"
LABEL base_image="jupyter/datascience-notebook:latest"
LABEL version="1"
LABEL software="R, Python3"
LABEL software.version="1.32"
Expand All @@ -15,10 +15,6 @@ LABEL about.license="Artistic-2.0"
LABEL about.tags=""
LABEL about.publication="https://doi.org/10.1093/bioinformatics/btv145"

################## MAINTAINER ######################
MAINTAINER Brian Yee <brian.alan.yee@gmail.com>


USER root

COPY apt-packages.txt /tmp/apt-packages.txt
Expand All @@ -27,10 +23,44 @@ COPY conda-packages.txt /tmp/conda-packages.txt
# Update image, install additional distro packages
RUN apt-get update && xargs apt-get install -y < /tmp/apt-packages.txt

# Bioconda data-package hooks need raw yq scalar output and a single R
# architecture. Without those, current Conda transactions can attempt to load
# a temporary "R.c~" executable as a second architecture.
RUN for attempt in 1 2 3; do \
mamba install -y -c bioconda -c conda-forge bioconductor-data-packages && break; \
if [ "$attempt" = 3 ]; then exit 1; fi; \
mamba clean --all -y; \
done && \
sed -i \
-e 's/yq /yq -r /g' \
-e 's/R CMD INSTALL /R CMD INSTALL --no-multiarch /' \
/opt/conda/bin/installBiocDataPackage.sh

# Install additional R packages from conda-forge using mamba
RUN mamba install -y -c bioconda -c r -c conda-forge -c anaconda --file /tmp/conda-packages.txt
RUN for attempt in 1 2 3; do \
mamba install -y -c bioconda -c r -c conda-forge -c anaconda --file /tmp/conda-packages.txt && break; \
if [ "$attempt" = 3 ]; then exit 1; fi; \
mamba clean --all -y; \
done

# Older Bioconda data packages ship package-specific post-link scripts that
# current mamba versions do not reliably execute. Run the required hooks in
# dependency order, with the same single-architecture R workaround, then
# confirm ChIPseeker can load.
RUN set -eux; \
for hook in \
/opt/conda/bin/.bioconductor-genomeinfodbdata-post-link.sh \
/opt/conda/bin/.bioconductor-go.db-post-link.sh \
/opt/conda/bin/.bioconductor-do.db-post-link.sh \
/opt/conda/bin/.bioconductor-org.hs.eg.db-post-link.sh \
/opt/conda/bin/.bioconductor-txdb.hsapiens.ucsc.hg19.knowngene-post-link.sh \
/opt/conda/bin/.bioconductor-txdb.hsapiens.ucsc.hg38.knowngene-post-link.sh \
/opt/conda/bin/.bioconductor-ensdb.hsapiens.v75-post-link.sh; do \
sed -i -e '2i set -e' -e 's/R CMD INSTALL /R CMD INSTALL --no-multiarch /' "$hook"; \
PREFIX=/opt/conda PKG_NAME=bioconductor-data PKG_VERSION=manual PKG_BUILDNUM=0 bash "$hook"; \
done; \
Rscript -e 'library(ChIPseeker); stopifnot(as.character(packageVersion("ChIPseeker")) == "1.32.0")'

RUN Rscript -e 'IRkernel::installspec(name = "r-chipseeker-1.32", displayname = "R (ChIPseeker-1.32)", user = FALSE)'

USER $NB_UID

2 changes: 1 addition & 1 deletion images/chipseeker/1.32/conda-packages.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bioconductor-chipseeker
bioconductor-chipseeker=1.32.0
bioconductor-txdb.hsapiens.ucsc.hg38.knowngene
bioconductor-ensdb.hsapiens.v75
bioconductor-clusterprofiler
Expand Down
Loading