Skip to content

Commit

Permalink
fix: errors in build-container-images.yml
Browse files Browse the repository at this point in the history
* pin to rocker/tidyverse:4.2
* update Dockerfile to use pak and rspm for package installation
* add workflow_dispatch button
  • Loading branch information
dsweber2 authored and dshemetov committed Apr 25, 2024
1 parent 16a2128 commit 20693a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ name: Build indicator container images and upload to registry

on:
push:
branches: [ main, prod ]
branches: [main, prod]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
packages: [ backfill_corrections ]
packages: [backfill_corrections]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down
17 changes: 6 additions & 11 deletions backfill_corrections/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM gurobi/optimizer:9.5.1 as gurobi

## Install R and tidyverse
FROM rocker/tidyverse:latest
FROM rocker/tidyverse:4.2

WORKDIR /opt/gurobi
COPY --from=gurobi /opt/gurobi .
Expand All @@ -15,22 +15,17 @@ ENV LD_LIBRARY_PATH $GUROBI_HOME/lib
RUN ln -s -f /usr/share/zoneinfo/America/New_York /etc/localtime

RUN apt-get update && apt-get install -qq -y \
libglpk-dev\
apt-file \
python3-venv \
python3-dev \
python3-pip

RUN install2.r --error \
roxygen2 \
Rglpk \
argparser

RUN R -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
RUN R -e 'install.packages(c("rspm"))'
RUN --mount=type=secret,id=GITHUB_TOKEN \
export GITHUB_PAT="$(cat /run/secrets/GITHUB_TOKEN)" && \
R -e 'devtools::install_version("bettermc", version = "1.1.2")' && \
R -e 'devtools::install_github("cmu-delphi/covidcast", ref = "evalcast", subdir = "R-packages/evalcast")' && \
R -e 'devtools::install_github(repo="ryantibs/quantgen", subdir="quantgen")' && \
R -e 'install.packages(list.files(path="/opt/gurobi/linux64/R/", pattern="^gurobi_.*[.]tar[.]gz$", full.names = TRUE), repos=NULL)'
R -e 'rspm::enable(); pak::pkg_install(c("roxygen2", "Rglpk", "argparser", "gfkse/[email protected]", "cmu-delphi/covidcast/R-packages/evalcast@evalcast", "ryantibs/quantgen/quantgen"))'
RUN R -e 'install.packages(list.files(path="/opt/gurobi/linux64/R/", pattern="^gurobi_.*[.]tar[.]gz$", full.names = TRUE), repos=NULL)'

WORKDIR /backfill_corrections/
ADD ./delphiBackfillCorrection ./delphiBackfillCorrection/
Expand Down

0 comments on commit 20693a2

Please sign in to comment.