Skip to content

Commit 6dc2a1d

Browse files
fix: update Dockerfile (#78)
* ci: add gha workflows from MOSuite * ci: run on dev branches * ci: force R version 4.1.3 * chore: delete pryr from deps * chore: add dev deps * ci(pkgdown): use custom installation * chore: pin seurat & matrix * chore: Matrix version with period instead of hyphen * chore: fix pkg version format * chore: remove duplicate suggests field * chore: usethis::use_tidy_description() * chore(docker): set R version 4.1.3 * ci(docker): add dockerfile from Rich Co-authored-by: Rich Finney <finneyr@users.noreply.github.com> * chore(docker): switch to use remotes::install_version instead of biowulf pkgs * chore(docker): use heredoc syntax to reduce line length * ci(docker): install local SCWorkflow * ci(docker): install dev deps * ci(docker): check that all deps installed * chore: add rs413s Dockerfile with mamba installation (#88) * ci(docker): try pinning mamba pkg versions based on rs413s docker * ci(docker): remove unused scripts * ci(docker): check all pkgs installed * ci(docker): try pinning only the seurat version --------- Co-authored-by: Rich Finney <finneyr@users.noreply.github.com>
1 parent b573004 commit 6dc2a1d

9 files changed

Lines changed: 770 additions & 35 deletions

File tree

.github/package-versions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
any::Seurat@4.1.1, any::Matrix@1.5.1

.github/workflows/R-CMD-check.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master, dev, DEV]
5+
branches: [ main, master, dev, DEV ]
66
pull_request:
7-
branches: [main, master, dev, DEV]
7+
branches: [ main, master, dev, DEV ]
88
workflow_dispatch:
99

1010
name: R-CMD-check
@@ -19,35 +19,40 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
config:
22-
- { os: ubuntu-latest, r: '4.1.3' }
22+
- { os: ubuntu-latest, r: "4.1.3" }
2323
#- { os: ubuntu-latest, r: 'oldrel-1' }
2424
#- { os: macos-latest, r: 'release' }
2525
runs-on: ${{ matrix.config.os }}
2626
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
2727
env:
2828
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
2929
R_KEEP_PKG_SOURCE: yes
30-
container:
31-
image: nciccbr/scworkflow:v1.0.2_79e5d37
3230
steps:
3331
- uses: actions/checkout@v4
34-
- uses: r-lib/actions/setup-r-dependencies@v2
32+
33+
- uses: CCBR/actions/install-r-pak@main
3534
with:
35+
versions-file: .github/package-versions.txt
3636
extra-packages: local::.
3737
needs: dev
38+
r-version: ${{ matrix.config.r }}
39+
http-user-agent: ${{ matrix.config.http-user-agent }}
40+
3841
- uses: r-lib/actions/check-r-package@v2
3942
with:
4043
upload-snapshots: true
4144

4245
lint:
4346
runs-on: ubuntu-latest
44-
container:
45-
image: nciccbr/scworkflow:v1.0.2_79e5d37
4647
steps:
4748
- uses: actions/checkout@v4
48-
- uses: r-lib/actions/setup-r-dependencies@v2
49+
50+
- uses: CCBR/actions/install-r-pak@main
4951
with:
52+
r-version: 4.1.3
53+
versions-file: .github/package-versions.txt
5054
needs: dev
55+
5156
- name: Good Practice checks
5257
shell: Rscript {0}
5358
run: |
@@ -103,11 +108,12 @@ jobs:
103108
name: coverage-test-failures
104109
path: ${{ runner.temp }}/package
105110

106-
check: # make sure all check jobs pass. https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
111+
check:
112+
# make sure all check jobs pass. https://github.com/orgs/community/discussions/4324#discussioncomment-3477871
107113
runs-on: ubuntu-latest
108114
container:
109115
image: nciccbr/scworkflow:v1.0.2_79e5d37
110-
needs: [R-CMD-check, lint, test-coverage]
116+
needs: [ R-CMD-check, lint, test-coverage ]
111117
if: always()
112118
steps:
113119
- name: Successful build

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
BUILD_DATE=${{ steps.vars.outputs.DATE }}
5757
BUILD_TAG=${{ steps.vars.outputs.VERSION_TAG }}
5858
REPONAME=${{ env.IMAGE_NAME }}
59-
R_VERSION=4.3.2
59+
R_VERSION=4.1.3

.github/workflows/pkgdown.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main, master]
5+
branches: [ main, master ]
66
pull_request:
7-
branches: [main, master]
7+
branches: [ main, master ]
88
release:
9-
types: [published]
9+
types: [ published ]
1010
workflow_dispatch:
1111

1212
name: pkgdown
@@ -27,9 +27,10 @@ jobs:
2727
image: nciccbr/scworkflow:v1.0.2_79e5d37
2828
steps:
2929
- uses: actions/checkout@v3
30-
31-
- uses: r-lib/actions/setup-r-dependencies@v2
30+
- uses: CCBR/actions/install-r-pak@main
3231
with:
32+
r-version: 4.1.3
33+
versions-file: .github/package-versions.txt
3334
extra-packages: local::.
3435
needs: dev
3536

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
2+
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
3+
on:
4+
push:
5+
branches: [main, master, dev, DEV]
6+
pull_request:
7+
branches: [main, master, dev, DEV]
8+
9+
name: test-coverage
10+
11+
permissions: read-all
12+
13+
jobs:
14+
test-coverage:
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: CCBR/actions/install-r-pak@main
23+
with:
24+
r-version: 4.1.3
25+
versions-file: .github/package-versions.txt
26+
needs: dev
27+
28+
- name: Test coverage
29+
run: |
30+
cov <- covr::package_coverage(
31+
quiet = FALSE,
32+
clean = FALSE,
33+
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
34+
)
35+
covr::to_cobertura(cov)
36+
shell: Rscript {0}
37+
38+
- uses: codecov/codecov-action@v4
39+
with:
40+
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }}
41+
file: ./cobertura.xml
42+
plugin: noop
43+
disable_search: true
44+
token: ${{ secrets.CODECOV_TOKEN }}
45+
46+
- name: Show testthat output
47+
if: always()
48+
run: |
49+
## --------------------------------------------------------------------
50+
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true
51+
shell: bash
52+
53+
- name: Upload test results
54+
if: failure()
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: coverage-test-failures
58+
path: ${{ runner.temp }}/package

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ tests/testthat/fixtures/
99
tests/testthat/output/
1010

1111
.Rproj.user
12-
1312
inst/doc
1413
/doc/
1514
/Meta/
1615

1716
.github.zip
1817
decision_log.md
18+

DESCRIPTION

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Imports:
3434
callr (>= 3.7.1),
3535
celldex,
3636
colorspace,
37-
colorspace,
3837
ComplexHeatmap (>= 2.10.0),
3938
cowplot (>= 1.1.1),
4039
data.table (>= 1.14.2),
@@ -52,23 +51,45 @@ Imports:
5251
ggplot2 (>= 3.3.6),
5352
ggpubr (>= 0.4.0),
5453
ggrepel,
54+
globals (>= 0.16.1),
5555
gridBase (>= 0.4-7),
5656
gridExtra (>= 2.3),
5757
gtable (>= 0.3.1),
58+
harmony (>= 0.1.1),
59+
hdf5r (>= 1.3.5),
5860
htmlwidgets,
61+
httpuv (>= 1.6.5),
5962
httr,
6063
jsonlite,
64+
leiden (>= 0.4.2),
65+
limma (>= 3.50.3),
66+
magrittr (>= 2.0.3),
67+
markdown (>= 1.1),
6168
MAST (>= 1.20.0),
62-
patchwork,
69+
methods (>= 4.1.3),
6370
pheatmap,
71+
plotly (>= 4.10.0),
6472
plyr,
6573
png,
74+
progressr (>= 0.10.1),
75+
purrr (>= 0.3.4),
76+
quantmod (>= 0.4.20),
6677
RColorBrewer (>= 1.1-3),
78+
reshape2 (>= 1.4.4),
79+
reticulate (>= 1.25),
80+
rlang (>= 1.0.6),
6781
scales,
6882
scDblFinder,
6983
Seurat (>= 4.1.1),
7084
SingleR (>= 1.8.1),
85+
statmod (>= 1.4.37),
86+
stringr (>= 1.4.1),
87+
svglite (>= 2.1.0),
88+
tibble (>= 3.1.8),
7189
tidyr,
90+
tidyverse (>= 1.3.2),
91+
viridisLite (>= 0.4.0),
92+
xfun (>= 0.32),
7293
zip (>= 2.2.0)
7394
Suggests:
7495
knitr,

Dockerfile

Lines changed: 115 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,139 @@ RUN conda config --add channels conda-forge \
2626
&& conda config --set channel_priority strict
2727

2828
# install conda packages
29-
RUN mamba install -y -c conda-forge \
29+
# Note: Most version pins removed to allow conda to resolve compatible versions with R 4.1.3
30+
# Only R version is pinned per requirement
31+
RUN mamba install -y \
3032
r-base=${R_VERSION} \
31-
r-devtools \
33+
r-anndata \
34+
r-biocmanager \
35+
r-callr \
36+
bioconductor-celldex \
37+
r-colorspace \
38+
bioconductor-complexheatmap \
39+
r-cowplot \
40+
r-data.table \
41+
r-dendextend \
42+
r-dendsort \
43+
r-digest \
44+
r-dplyr \
45+
bioconductor-edger \
46+
r-future \
47+
r-future.apply \
48+
r-gargle \
49+
r-gdata \
50+
r-ggextra \
3251
r-ggplot2 \
33-
r-ggrepel r-viridis r-upsetr r-patchwork r-plotly \
34-
r-matrix r-mgcv r-survival \
35-
bioconductor-genomicranges \
36-
bioconductor-summarizedexperiment \
37-
bioconductor-delayedarray \
38-
bioconductor-s4arrays \
39-
bioconductor-annotationdbi \
40-
bioconductor-annotate \
41-
bioconductor-keggrest \
52+
r-ggpubr \
53+
r-ggrepel \
54+
r-globals \
55+
r-gridbase \
56+
r-gridextra \
57+
r-gtable \
58+
r-harmony \
59+
r-hdf5r \
60+
r-htmlwidgets \
61+
r-httpuv \
62+
r-httr \
63+
r-jsonlite \
64+
r-leiden \
65+
bioconductor-limma \
66+
r-magrittr \
67+
r-markdown \
68+
bioconductor-mast \
69+
r-pheatmap \
70+
r-plotly \
71+
r-plyr \
72+
r-png \
73+
r-progressr \
74+
r-purrr \
75+
r-quantmod \
76+
r-rcolorbrewer \
77+
r-reshape2 \
78+
r-reticulate \
79+
r-rlang \
80+
r-scales \
81+
bioconductor-scdblfinder \
82+
r-seurat=4.1.1 \
83+
bioconductor-singler \
84+
r-statmod \
85+
r-stringr \
86+
r-svglite \
87+
r-tibble \
88+
r-tidyr \
89+
r-tidyverse \
90+
r-viridislite \
91+
r-xfun \
92+
r-zip \
93+
r-knitr \
94+
r-rmarkdown \
95+
r-roxygen2 \
96+
r-testthat \
97+
r-usethis \
98+
r-cffr \
99+
r-covr \
100+
r-goodpractice \
101+
r-here \
102+
r-lintr \
103+
r-pkgdown \
104+
r-rcmdcheck \
42105
&& conda clean -afy
43106

44107
# install R package
45108
COPY . /opt2/SCWorkflow
46-
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, repos='http://cran.rstudio.com')"
109+
RUN R -e "devtools::install_local('/opt2/SCWorkflow', dependencies = TRUE, upgrade = 'never', repos='http://cran.rstudio.com')"
47110

48111
# add scworkflow exec to the path
49112
# RUN chmod -R +x /opt2/conda/lib/R/library/SCWorkflow/exec
50113
# ENV PATH="$PATH:/opt2/conda/lib/R/library/SCWorkflow/exec"
51114
# RUN scworkflow --help
52115

53116
# copy example script & json to data
54-
COPY ./inst/extdata/example_script.sh /data2/
55-
COPY ./inst/extdata/json_args/ /data2/json_args/
117+
# COPY ./inst/extdata/example_script.sh /data2/
118+
# COPY ./inst/extdata/json_args/ /data2/json_args/
56119

57120
# Save Dockerfile in the docker
58121
COPY Dockerfile /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
59122
RUN chmod a+r /opt2/Dockerfile_${REPONAME}.${BUILD_TAG}
60123

124+
# Verify all dependencies from DESCRIPTION are installed
125+
RUN cat > /tmp/check_description_deps.R << 'EOF'
126+
# Parse DESCRIPTION file and check if all dependencies are installed
127+
desc_file <- "/opt2/SCWorkflow/DESCRIPTION"
128+
if (!file.exists(desc_file)) {
129+
stop("DESCRIPTION file not found at ", desc_file)
130+
}
131+
# Read and parse DESCRIPTION
132+
desc <- read.dcf(desc_file)
133+
# Extract dependencies
134+
extract_packages <- function(str) {
135+
if (is.na(str) || str == "") return(character(0))
136+
# Split by comma and clean up whitespace and version specs
137+
pkgs <- strsplit(str, ",")[[1]]
138+
pkgs <- trimws(pkgs)
139+
pkgs <- gsub("\\s*\\(.*\\)$", "", pkgs) # Remove version specs
140+
pkgs <- pkgs[pkgs != ""]
141+
pkgs
142+
}
143+
deps <- unique(c(
144+
extract_packages(desc[1, "Depends"]),
145+
extract_packages(desc[1, "Imports"]),
146+
extract_packages(desc[1, "Suggests"]),
147+
extract_packages(desc[1, "Config/Needs/dev"])
148+
))
149+
# Remove base R
150+
deps <- deps[!grepl("^R$", deps)]
151+
# Check if each dependency is installed
152+
missing <- deps[!vapply(deps, requireNamespace, quietly = TRUE, FUN.VALUE = logical(1))]
153+
if (length(missing) > 0) {
154+
stop("The following dependencies are missing: ", paste(missing, collapse = ", "))
155+
} else {
156+
message("All dependencies are installed.")
157+
}
158+
EOF
159+
RUN R --vanilla --slave --file=/tmp/check_description_deps.R
160+
61161
# cleanup
62162
WORKDIR /data2
63163
RUN apt-get clean && apt-get purge \
64-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
164+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

0 commit comments

Comments
 (0)