Skip to content

Commit 9f81c68

Browse files
ci(docker): use rocker base image & enforce Seurat version
ci(docker): optional version tag with workflow dispatch ci(docker): make sure verstion tag input is optional ci(docker): fix permissions for R library ci(docker): tweak R pkg installation ci(docker): pre-install deps fix: install cmake etc ci(docker): apt-get update & upgrade before install ci(docker): tweak apt-get install ci(docker): install automake ci(docker): throw spaghetti at the wall ci(docker): install all deps used by bioconductor https://github.com/Bioconductor/bioconductor_docker/blob/7335f85420199679432d2a328c3a59b551b6cfd0/bioc_scripts/install_bioc_sysdeps.sh ci(docker): remove libmariadb fix: set version range for Seurat & SeuratObject also need Matrix ci(docker): assert Matrix >= 1.6.4 ci(docker): fix Matrix version spec chore: order may matter for version range ci(docker): install_local is not adhering to version spec in description explicitly install correct seurat version fix: SeuratObject version ci(docker): try removing min Seurat version? Revert "ci(docker): try removing min Seurat version?" This reverts commit 1c33388. ci(docker): set remotes::install_local(upgrade = "never") ci: tweak manual docker tag
1 parent e353323 commit 9f81c68

File tree

3 files changed

+137
-59
lines changed

3 files changed

+137
-59
lines changed

.github/workflows/docker.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@ name: docker
22

33
on:
44
workflow_dispatch:
5+
inputs:
6+
version_tag:
7+
type: string
8+
description: Container version tag. If not set, it will be created automatically based on the released version and commit hash.
9+
required: false
10+
default: ''
511
release:
612
types: [published]
713

814
env:
915
IMAGE_NAME: "scworkflow" # must be lowercase
1016
CONTEXT: "./"
1117
NAMESPACE: "nciccbr"
18+
USE_INPUT_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version_tag != '' }}
1219

1320
permissions: read-all
1421

@@ -23,9 +30,15 @@ jobs:
2330
echo "DATE=$(date +"%Y-%m-%d")" >> "$GITHUB_OUTPUT"
2431
2532
if [ '${{ github.event_name }}' == 'release' ]; then
33+
# include latest tag since this is a release
2634
VERSION=${{ github.ref_name }}
2735
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION},${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:latest
36+
elif [ '${{ env.USE_INPUT_TAG }}' == 'true' ]; then
37+
# use manual tag
38+
VERSION=${{ github.event.inputs.version_tag }}
39+
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION}
2840
else
41+
# set tag from last release and current commit
2942
HASH=$(git rev-parse --short HEAD)
3043
VERSION="$(grep 'Version:' $CONTEXT/DESCRIPTION | sed 's/Version: /v/')_${HASH}"
3144
DOCKER_TAGS=${{ env.NAMESPACE }}/${{ env.IMAGE_NAME }}:${VERSION}
@@ -35,9 +48,9 @@ jobs:
3548
3649
- name: debug
3750
run: |
38-
echo "the github tag is ${{ github.ref_name }}"
39-
echo "github event_name is ${{ github.event_name }}"
40-
echo "the version tag is ${{ steps.vars.outputs.VERSION_TAG }}"
51+
echo "Github tag: ${{ github.ref_name }}"
52+
echo "Github event_name: ${{ github.event_name }}"
53+
echo "Container version tag: ${{ steps.vars.outputs.VERSION_TAG }}"
4154
4255
- name: Login to DockerHub
4356
if: ${{ github.event_name != 'pull_request' }}
@@ -49,11 +62,10 @@ jobs:
4962
uses: docker/build-push-action@v4
5063
with:
5164
push: ${{ github.event_name != 'pull_request' }}
52-
tags: ${{ steps.vars.outputs.DOCKER_TAGS }} # include 'latest' tag if this is a release
65+
tags: ${{ steps.vars.outputs.DOCKER_TAGS }}
5366
context: ${{ env.CONTEXT }}
5467
file: ${{ env.CONTEXT }}/Dockerfile
5568
build-args: |
5669
BUILD_DATE=${{ steps.vars.outputs.DATE }}
5770
BUILD_TAG=${{ steps.vars.outputs.VERSION_TAG }}
5871
REPONAME=${{ env.IMAGE_NAME }}
59-
R_VERSION=4.3.2

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ Depends:
2929
R (>= 4.0)
3030
Imports:
3131
anndata (>= 0.7.5.2),
32-
BiocManager,
3332
callr (>= 3.7.1),
3433
celldex,
3534
colorspace,
@@ -65,6 +64,7 @@ Imports:
6564
magrittr (>= 2.0.3),
6665
markdown (>= 1.1),
6766
MAST (>= 1.20.0),
67+
Matrix,
6868
methods (>= 4.1.3),
6969
pheatmap,
7070
plotly (>= 4.10.0),
@@ -80,8 +80,10 @@ Imports:
8080
rlang (>= 1.0.6),
8181
scales,
8282
scDblFinder,
83-
Seurat (== 4.3.0),
84-
SeuratObject (== 4.1.3),
83+
Seurat (< 5.0.0),
84+
Seurat (>= 4.3.0),
85+
SeuratObject (< 5.0.0),
86+
SeuratObject (>= 4.1.3),
8587
SingleR (>= 1.8.1),
8688
statmod (>= 1.4.37),
8789
stringr (>= 1.4.1),

Dockerfile

Lines changed: 115 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM nciccbr/ccbr_ubuntu_22.04:v4
1+
FROM rocker/tidyverse:4.3.2
22

33
# build time variables
44
ARG BUILD_DATE="000000"
@@ -8,66 +8,130 @@ ENV BUILD_TAG=${BUILD_TAG}
88
ARG REPONAME="000000"
99
ENV REPONAME=${REPONAME}
1010

11-
ARG R_VERSION=4.3.2
12-
ENV R_VERSION=${R_VERSION}
13-
1411
SHELL ["/bin/bash", "-lc"]
1512

16-
# Install conda and give write permissions to conda folder
17-
RUN echo 'export PATH=/opt2/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
18-
wget --quiet "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" -O ~/miniforge3.sh && \
19-
/bin/bash ~/miniforge3.sh -b -p /opt2/conda && \
20-
rm ~/miniforge3.sh && chmod 777 -R /opt2/conda/
21-
ENV PATH="/opt2/conda/bin:$PATH"
22-
23-
# Pin channels and update
24-
RUN conda config --add channels conda-forge \
25-
&& conda config --add channels bioconda \
26-
&& conda config --set channel_priority strict
13+
RUN chmod 777 /usr/local/lib/R/site-library /usr/local/lib/R/library
2714

28-
# install conda packages
29-
RUN mamba install -y -c conda-forge \
30-
r-base=${R_VERSION} \
31-
r-devtools r-testthat \
32-
r-anndata \
33-
r-callr r-colorspace r-cowplot \
34-
r-data.table r-dendextend r-dendsort r-digest r-dplyr \
35-
r-future r-future.apply \
36-
r-gargle r-gdata r-ggExtra r-ggplot2 r-ggpubr r-ggrepel r-globals r-glue r-gridBase r-gridExtra r-gtable \
37-
r-harmony r-hdf5r r-htmlwidgets r-httpuv r-httr \
38-
r-jsonlite \
39-
r-leiden \
40-
r-magrittr r-markdown \
41-
r-pheatmap r-plotly r-plyr r-png r-progressr r-pryr r-purrr \
42-
r-quantmod \
43-
r-RColorBrewer r-reshape2 r-reticulate r-rlang \
44-
r-scales r-Seurat r-statmod r-stringr r-svglite \
45-
r-tibble r-tidyr r-tidyverse \
46-
r-viridisLite \
47-
r-xfun \
48-
r-zip \
49-
bioconductor-celldex bioconductor-ComplexHeatmap \
50-
bioconductor-edger \
51-
bioconductor-limma \
52-
bioconductor-MAST \
53-
bioconductor-scDblFinder bioconductor-SingleR \
54-
bioconductor-genomicranges \
55-
bioconductor-summarizedexperiment \
56-
&& conda clean -afy
15+
# https://github.com/Bioconductor/bioconductor_docker/blob/7335f85420199679432d2a328c3a59b551b6cfd0/bioc_scripts/install_bioc_sysdeps.sh
16+
RUN apt-get update && apt-get upgrade -y && \
17+
apt-get install -y --no-install-recommends --allow-unauthenticated \
18+
automake \
19+
biber \
20+
byacc \
21+
cmake \
22+
coinor-libcgl-dev \
23+
coinor-libsymphony-dev \
24+
coinor-libsymphony-doc \
25+
curl \
26+
default-jdk \
27+
default-libmysqlclient-dev \
28+
fortran77-compiler \
29+
ggobi \
30+
graphviz \
31+
imagemagick \
32+
jags \
33+
libapparmor-dev \
34+
libarchive-dev \
35+
libarchive-extract-perl \
36+
libavfilter-dev \
37+
libboost-dev \
38+
libbz2-dev \
39+
libcairo2-dev \
40+
libcgi-pm-perl \
41+
libdbd-mysql-perl \
42+
libdbi-perl \
43+
libeigen3-dev \
44+
libfftw3-dev \
45+
libfile-copy-recursive-perl \
46+
libfuse-dev \
47+
libgdal-dev \
48+
libgeos-dev \
49+
libgit2-dev \
50+
libgl1-mesa-dev \
51+
libglpk-dev \
52+
libglu1-mesa-dev \
53+
libgmp3-dev \
54+
libgsl0-dev \
55+
libgslcblas0 \
56+
libgtk2.0-dev \
57+
libgtkmm-2.4-dev \
58+
libhdf5-dev \
59+
libhdf5-serial-dev \
60+
libhiredis-dev \
61+
libjpeg-dev \
62+
libjpeg-turbo8-dev \
63+
libjpeg8-dev \
64+
liblapack-dev \
65+
liblzma-dev \
66+
libmagick++-dev \
67+
libmodule-build-perl \
68+
libmpfr-dev \
69+
libmysqlclient-dev \
70+
libncurses-dev \
71+
libnetcdf-dev \
72+
libopenbabel-dev \
73+
libopenmpi-dev \
74+
libpcre2-dev \
75+
libperl-dev \
76+
libpng-dev \
77+
libpoppler-cpp-dev \
78+
libpoppler-glib-dev \
79+
libpq-dev \
80+
libproj-dev \
81+
libprotobuf-dev \
82+
libprotoc-dev \
83+
librdf0-dev \
84+
libreadline-dev \
85+
librtmp-dev \
86+
libsasl2-dev \
87+
libsbml5-dev \
88+
libssl-dev \
89+
libtiff5-dev \
90+
libudunits2-dev \
91+
libv8-dev \
92+
libxml-simple-perl \
93+
libxml2-dev \
94+
libxpm-dev \
95+
libxt-dev \
96+
libz-dev \
97+
libzmq3-dev \
98+
mono-runtime \
99+
mpi-default-bin \
100+
ocl-icd-opencl-dev \
101+
openmpi-bin \
102+
openmpi-common \
103+
openmpi-doc \
104+
protobuf-compiler \
105+
python3-pip \
106+
sqlite3 \
107+
tabix \
108+
tcl8.6-dev \
109+
tk-dev \
110+
xfonts-100dpi \
111+
xfonts-75dpi \
112+
liblz4-dev \
113+
automake \
114+
cmake \
115+
default-jre \
116+
g++ \
117+
gcc \
118+
gdb \
119+
gfortran \
120+
libcurl4-gnutls-dev \
121+
make \
122+
pkg-config
57123

58124
# install R package
59125
COPY . /opt2/SCWorkflow
60-
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, repos='http://cran.rstudio.com')"
126+
RUN R -e 'remotes::install_version("Seurat", version="4.3.0"); remotes::install_version("SeuratObject", version="4.1.3")' && \
127+
R -e "remotes::install_local('/opt2/SCWorkflow', dependencies = TRUE, upgrade='never', repos='http://cran.rstudio.com'); library(SCWorkflow)" && \
128+
R -s -e "readr::write_tsv(tibble::as_tibble(installed.packages()), '/mnt/r-packages.tsv')"
61129

62130
# add scworkflow exec to the path
63-
RUN chmod -R +x /opt2/conda/lib/R/library/SCWorkflow/exec
64-
ENV PATH="$PATH:/opt2/conda/lib/R/library/SCWorkflow/exec"
131+
RUN chmod -R +x /usr/local/lib/R/site-library/SCWorkflow/exec
132+
ENV PATH="$PATH:/usr/local/lib/R/site-library/SCWorkflow/exec"
65133
RUN scworkflow --help
66134

67-
# copy example script & json to data
68-
COPY ./inst/extdata/TestRunjson.sh /data2/
69-
COPY ./inst/extdata/json_args/ /data2/json_args/
70-
71135
# Save Dockerfile in the docker
72136
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
73137
RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}

0 commit comments

Comments
 (0)