Skip to content

Commit

Permalink
Merge branch 'develop' into ncvar_put-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mdietze authored Jan 10, 2023
2 parents 3cb907e + d027384 commit bcc8fc8
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

steps:
# checkout source code
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# install rmarkdown
- name: Install rmarkdown
run: |
Expand All @@ -44,14 +44,14 @@ jobs:
cd book_source
Rscript -e 'options(bookdown.render.file_scope=FALSE); bookdown::render_book("index.Rmd", "bookdown::gitbook")'
# save artifact
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: pecan-documentation
path: book_source/_book/
# download documentation repo
- name: Checkout documentation repo
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/pecan-documentation
path: pecan-documentation
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/depends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ jobs:
with:
set-safe-directory: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
buildkitd-flags: --debug
install: true

# calculate some variables that are used later
- name: github branch
# build Rdevel only on Mondays, others every day (but not twice on Mondays)
Expand All @@ -59,7 +66,7 @@ jobs:
# this will publish to the actor (person) github packages
- name: Publish to GitHub
if: env.TAG != ''
uses: elgohr/Publish-Docker-Github-Action@2.22
uses: elgohr/Publish-Docker-Github-Action@v4
env:
R_VERSION: ${{ matrix.R }}
with:
Expand All @@ -74,7 +81,7 @@ jobs:
# this will publish to the clowder dockerhub repo
- name: Publish to Docker Hub
if: env.TAG != ''
uses: elgohr/Publish-Docker-Github-Action@2.18
uses: elgohr/Publish-Docker-Github-Action@v4
env:
R_VERSION: ${{ matrix.R }}
with:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
env:
MASTER_REPO: PecanProject/pecan
DOCKERHUB_ORG: pecan
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

jobs:
docker:
Expand All @@ -41,6 +42,12 @@ jobs:
- uses: actions/checkout@v3
with:
set-safe-directory: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver: docker
buildkitd-flags: --debug
install: true

# calculate some variables that are used later
- name: get version tag
Expand Down Expand Up @@ -72,7 +79,7 @@ jobs:
env:
PECAN_GIT_CHECKSUM: ${{ github.sha }}
PECAN_GIT_BRANCH: ${GITHUB_BRANCH}
VERSION: ${PECAN_VERSION}
VERSION: ${{ env.PECAN_VERSION }}

# push all images to github
- name: Publish to GitHub
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/stale@v4
- uses: actions/stale@v6
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'This issue is stale because it has been open 365 days with no activity.'
Expand Down
4 changes: 3 additions & 1 deletion apps/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ EXPOSE 8000
# --------------------------------------------------------------------------

# COMMAND TO RUN
RUN apt-get update \
RUN --mount=type=secret,id=github_token \
export GITHUB_PAT=`cat /run/secrets/github_token` \
&& apt-get update \
&& apt-get install libsodium-dev -y \
&& rm -rf /var/lib/apt/lists/* \
&& Rscript -e "devtools::install_version('promises', '1.1.0')" \
Expand Down
3 changes: 3 additions & 0 deletions docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ echo "# ----------------------------------------------------------------------"
if [ "${DEPEND}" == "build" ]; then
${DEBUG} docker build \
--pull \
--secret id=github_token,env=GITHUB_PAT \
--build-arg R_VERSION=${R_VERSION} ${GITHUB_WORKFLOW_ARG} \
--tag pecan/depends:${IMAGE_VERSION} \
docker/depends
Expand All @@ -146,6 +147,7 @@ echo ""
# require all of PEcAn to build
for x in base web docs; do
${DEBUG} docker build \
--secret id=github_token,env=GITHUB_PAT \
--tag pecan/$x:${IMAGE_VERSION} \
--build-arg FROM_IMAGE="${FROM_IMAGE:-depends}" \
--build-arg IMAGE_VERSION="${IMAGE_VERSION}" ${GITHUB_WORKFLOW_ARG} \
Expand Down Expand Up @@ -230,6 +232,7 @@ done
# build apps
for x in api; do
${DEBUG} docker build \
--secret id=github_token,env=GITHUB_PAT \
--tag pecan/$x:${IMAGE_VERSION} \
--build-arg IMAGE_VERSION="${IMAGE_VERSION}" ${GITHUB_WORKFLOW_ARG} \
--build-arg PECAN_VERSION="${VERSION}" \
Expand Down
4 changes: 3 additions & 1 deletion docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ COPY models /pecan/models/
# install all PEcAn packages
# `make clean` is to remove artifacts copied in from host system
# (e.g. basgra.so)
RUN cd /pecan \
RUN --mount=type=secret,id=github_token \
export GITHUB_PAT=`cat /run/secrets/github_token` \
&& cd /pecan \
&& make clean \
&& make \
&& rm -rf /tmp/downloaded_packages
Expand Down
4 changes: 3 additions & 1 deletion docker/depends/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ RUN apt-get update \
# INSTALL DEPENDENCIES
# ----------------------------------------------------------------------
COPY pecan.depends.R /
RUN Rscript -e "install.packages(c('devtools'))" \
RUN --mount=type=secret,id=github_token \
export GITHUB_PAT=`cat /run/secrets/github_token` \
&& Rscript -e "install.packages(c('devtools'))" \
&& Rscript -e "devtools::install_version('roxygen2', '7.1.2', repos = 'cran.r-project.org')" \
&& R_LIBS_USER='/usr/local/lib/R/site-library' Rscript /pecan.depends.R \
&& rm -rf /tmp/*
Expand Down

0 comments on commit bcc8fc8

Please sign in to comment.