From 23cd01cd884cfede7caecee66a9f5d746f6c4a83 Mon Sep 17 00:00:00 2001 From: Nick Wiltsie Date: Fri, 16 Aug 2024 13:12:43 -0700 Subject: [PATCH] Update tool-Docker-action to v2.1.0 (#21) * Update tool-Docker-action to v2.1.0 * Switch to rocker/r-ver for better stability * Strip out library installation directives --- .github/workflows/Docker-build-release.yaml | 20 ------------ .github/workflows/docker-build-release.yaml | 36 +++++++++++++++++++++ Dockerfile | 12 +++---- installer.R | 11 +------ 4 files changed, 41 insertions(+), 38 deletions(-) delete mode 100644 .github/workflows/Docker-build-release.yaml create mode 100644 .github/workflows/docker-build-release.yaml diff --git a/.github/workflows/Docker-build-release.yaml b/.github/workflows/Docker-build-release.yaml deleted file mode 100644 index b2313d4..0000000 --- a/.github/workflows/Docker-build-release.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -on: - push: - branches: ['main'] - tags: ['v*'] - release: - types: [published] - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - name: A job to build and push a docker image - permissions: - contents: read - packages: write - steps: - - id: build-push - uses: uclahs-cds/tool-Docker-action/build-release@latest - with: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/docker-build-release.yaml b/.github/workflows/docker-build-release.yaml new file mode 100644 index 0000000..40ae5da --- /dev/null +++ b/.github/workflows/docker-build-release.yaml @@ -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/tool-Docker-action@v2.1.0 + # Uncomment if you expect to use non-SemVer release tags + # with: + # non-semver-tags: true diff --git a/Dockerfile b/Dockerfile index 4f368ad..c8a6cb1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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 diff --git a/installer.R b/installer.R index b30c810..4c9f491 100644 --- a/installer.R +++ b/installer.R @@ -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', @@ -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();