diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker_targets.yaml similarity index 83% rename from .github/workflows/docker.yaml rename to .github/workflows/docker_targets.yaml index 063dfab68f..0d13ae5515 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker_targets.yaml @@ -1,4 +1,4 @@ -name: build docker container +name: build targets docker container on: workflow_dispatch: @@ -24,5 +24,6 @@ jobs: uses: docker/build-push-action@v3 with: push: true - tags: eco4cast/rocker-neon4cast:latest + tags: eco4cast/usgsrc4cast-targets:latest build-args: GITHUB_PAT=${{ secrets.PAT }} + file: targets/Dockerfile diff --git a/.github/workflows/targets.yaml b/.github/workflows/targets.yaml index c0d731838e..a221268ac6 100644 --- a/.github/workflows/targets.yaml +++ b/.github/workflows/targets.yaml @@ -16,14 +16,13 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY_SUBMISSIONS }} OSN_KEY: ${{ secrets.OSN_KEY }} OSN_SECRET: ${{ secrets.OSN_SECRET }} - container: rocker/geospatial:latest + container: eco4cast/usgsrc4cast-targets:latest steps: - uses: actions/checkout@v3 - name: Generate targets shell: Rscript {0} run: | - install.packages(c("clustermq", "dataRetrieval", "RCurl", "tarchetypes", "targets")) setwd("targets") targets::tar_make() diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index bef3f2e8d0..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM rocker/geospatial:latest - -# Import GitHub Secret -ARG GITHUB_PAT -ENV GITHUB_PAT=$GITHUB_PAT - -# Declares build arguments -# ARG NB_USER -# ARG NB_UID - -# COPY --chown=${NB_USER} . ${HOME} - -#USER root -RUN apt-get update && apt-get -y install cron -RUN apt-get update && apt-get -y install jags -RUN apt-get update && apt-get -y install libgd-dev -RUN apt-get update && apt-get -y install libnetcdf-dev - -#USER ${NB_USER} - -RUN apt-get -y install python3 python3-pip - -RUN install2.r devtools remotes reticulate - -RUN R -e "remotes::install_github(c('cboettig/minioclient','eco4cast/stac4cast', 'eco4cast/EFIstandards','cboettig/aws.s3','eco4cast/score4cast','EcoForecast/ecoforecastR','eco4cast/neon4cast','cboettig/prov', 'eco4cast/read4cast','eco4cast/gefs4cast'))" - -RUN install2.r arrow renv rjags neonstore ISOweek RNetCDF fable fabletools forecast imputeTS duckdbfs gsheet - -RUN install2.r ncdf4 scoringRules tidybayes tidync udunits2 bench contentid yaml RCurl here feasts future furrr jsonlite - -#RUN R -e "reticulate::install_python(version = '3.9:latest', list = FALSE, force = FALSE)" - -COPY cron.sh /etc/services.d/cron/run diff --git a/targets/Dockerfile b/targets/Dockerfile new file mode 100644 index 0000000000..f34c3fafd8 --- /dev/null +++ b/targets/Dockerfile @@ -0,0 +1,21 @@ +FROM eco4cast/rocker-neon4cast:latest + +# Import GitHub Secret +ARG GITHUB_PAT +ENV GITHUB_PAT=$GITHUB_PAT + +# Declares build arguments +# ARG NB_USER +# ARG NB_UID + +# COPY --chown=${NB_USER} . ${HOME} + +#USER ${NB_USER} +RUN install2.r --error \ + clustermq \ + dataRetrieval \ + tarchetypes \ + targets \ + && rm -rf /tmp/downloaded_packages /tmp/*.rds /tmp/Rtmp* + +COPY cron.sh /etc/services.d/cron/run