-
Notifications
You must be signed in to change notification settings - Fork 16
first attempt at fixing broken backfill build #1958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,57 +10,37 @@ name: R backfill corrections | |
|
||
on: | ||
push: | ||
branches: [ main, prod ] | ||
branches: [main, prod] | ||
pull_request: | ||
types: [ opened, synchronize, reopened, ready_for_review ] | ||
branches: [ main, prod ] | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
branches: [main, prod] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.draft == false | ||
strategy: | ||
matrix: | ||
r-version: [4.2.1] | ||
defaults: | ||
run: | ||
working-directory: backfill_corrections/delphiBackfillCorrection | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up R ${{ matrix.r-version }} | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up R 4.2 | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.r-version }} | ||
use-public-rspm: true | ||
- name: Install linux dependencies | ||
run: | | ||
sudo apt-get install \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: we don't need this section because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
libcurl4-openssl-dev \ | ||
libgdal-dev \ | ||
libudunits2-dev \ | ||
libglpk-dev \ | ||
libharfbuzz-dev \ | ||
libfribidi-dev | ||
- name: Get date | ||
id: get-date | ||
run: | | ||
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")" | ||
- name: Cache R packages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. praise:
Nice! Good simplification here and above. |
||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ runner.os }}-r-backfillcorr-${{ steps.get-date.outputs.date }} | ||
restore-keys: | | ||
${{ runner.os }}-r-backfillcorr- | ||
r-version: 4.2 | ||
|
||
- name: Install and cache dependencies | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
working-directory: backfill_corrections/delphiBackfillCorrection | ||
upgrade: 'TRUE' | ||
upgrade: "TRUE" | ||
|
||
- name: Check package | ||
uses: r-lib/actions/check-r-package@v2 | ||
with: | ||
|
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 . | ||
|
@@ -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/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (optional): maybe we want to keep the
matrix
way of providingr-version
for future flexibility? In some other packages, we specify several different R versions to run tests on.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just add that in when we need it, CI-wise it'll be about the same amount of work then.