Skip to content

Commit

Permalink
Update tool-Docker-action to v2.1.0 (#21)
Browse files Browse the repository at this point in the history
* Update tool-Docker-action to v2.1.0

* Switch to rocker/r-ver for better stability

* Strip out library installation directives
  • Loading branch information
nwiltsie authored Aug 16, 2024
1 parent 7843dc7 commit 23cd01c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/Docker-build-release.yaml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/docker-build-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: Update image in GHCR

run-name: >
${{
github.event_name == 'delete' && format(
'Delete `{0}{1}`',
github.event.ref_type == 'branch' && 'branch-' || '',
github.event.ref
)
|| github.ref == 'refs/heads/main' && 'Update `dev`'
|| format(
'Update `{0}{1}`',
!startsWith(github.ref, 'refs/tags') && 'branch-' || '',
github.ref_name
)
}} docker tag
on:
push:
branches-ignore: ['gh-pages']
tags: ['v*']
delete:

jobs:
push-or-delete-image:
runs-on: ubuntu-latest
name: Update GitHub Container Registry
permissions:
contents: read
packages: write
steps:
- uses: uclahs-cds/[email protected]
# Uncomment if you expect to use non-SemVer release tags
# with:
# non-semver-tags: true
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ RUN mamba create -qy -p /usr/local \
cancerit-allelecount==${ALLELECOUNT_VERSION} \
impute2==${IMPUTE2_VERSION}

FROM ubuntu:20.04
FROM r-base:4.4.1
FROM rocker/r-ver:4.4.1
COPY --from=builder /usr/local /usr/local

RUN apt-get update \
Expand All @@ -40,23 +39,20 @@ ARG ASCAT="VanLoo-lab/ascat/ASCAT@v${ASCAT_VERSION}"
ARG COPYNUMBER="igordot/copynumber@${COPYNUMBER_VERSION}"
ARG BATTENBERG="Wedge-lab/battenberg@v${BATTENBERG_VERSION}"

# R library path to install the above packages
ARG LIBRARY="/usr/lib/R/site-library"

# Install Package Dependency toolkit
RUN library=${LIBRARY} R -e 'install.packages(c("argparse", "BiocManager", "pkgdepends", "optparse"), lib = Sys.getenv("library"))' && \
RUN R -e 'install.packages(c("argparse", "BiocManager", "pkgdepends", "optparse"))' && \
R -q -e 'BiocManager::install(c("ellipsis", "splines", "VariantAnnotation"))'

# Install Battenberg
COPY installer.R /usr/local/bin/installer.R
RUN chmod +x /usr/local/bin/installer.R

RUN Rscript /usr/local/bin/installer.R -l ${LIBRARY} -d ${COPYNUMBER} ${ASCAT} ${BATTENBERG}
RUN Rscript /usr/local/bin/installer.R -d ${COPYNUMBER} ${ASCAT} ${BATTENBERG}

# Modify paths to reference files
COPY modify_reference_path.sh /usr/local/bin/modify_reference_path.sh
RUN chmod +x /usr/local/bin/modify_reference_path.sh && \
bash /usr/local/bin/modify_reference_path.sh /usr/lib/R/site-library/Battenberg/example/battenberg_wgs.R /usr/local/bin/battenberg_wgs.R
bash /usr/local/bin/modify_reference_path.sh /usr/local/lib/R/site-library/Battenberg/example/battenberg_wgs.R /usr/local/bin/battenberg_wgs.R

RUN ln -sf /usr/local/lib/R/site-library/Battenberg/example/filter_sv_brass.R /usr/local/bin/filter_sv_brass.R && \
ln -sf /usr/local/lib/R/site-library/Battenberg/example/battenberg_cleanup.sh /usr/local/bin/battenberg_cleanup.sh
Expand Down
11 changes: 1 addition & 10 deletions installer.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ library(pkgdepends);

parser <- ArgumentParser();

parser$add_argument(
'-l',
'--lib',
help = 'Library path to install the tools'
);
parser$add_argument(
'-d',
'--dependencies',
Expand All @@ -18,12 +13,8 @@ parser$add_argument(
args <- parser$parse_args();

tools <- args$dependencies;
lib <- args$lib;

pkg.installation.proposal <- new_pkg_installation_proposal(
tools,
config = list(library = lib)
);
pkg.installation.proposal <- new_pkg_installation_proposal(tools);
pkg.installation.proposal$solve();
pkg.installation.proposal$download();
pkg.installation.proposal$install();

0 comments on commit 23cd01c

Please sign in to comment.