-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-1485] Modularize update potential PHI fields (#155)
* initial commit * add missing commas * update production default * remove short flag * remove comma * add auth, logging * correct dry-run, adjust activity pos * update tests in readme
- Loading branch information
Showing
10 changed files
with
422 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @Sage-Bionetworks/genie_admins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build and Push Docker Images | ||
|
||
on: | ||
push: | ||
branches: [develop, 'GEN*', 'gen*'] | ||
paths: | ||
- 'scripts/references/**' | ||
- '.github/workflows/build-docker-images.yml' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build_references_docker: | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: sage-bionetworks/genie-bpc-pipeline | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Fetch the default branch (develop) for comparison | ||
run: git fetch origin develop:refs/remotes/origin/develop --depth=1 | ||
|
||
- name: Check for Changes in scripts/references | ||
id: check_changes | ||
run: | | ||
# Check for a merge base, fallback to root commit if none exists | ||
if git merge-base --is-ancestor origin/develop HEAD; then | ||
DIFF_BASE="origin/develop" | ||
else | ||
DIFF_BASE=$(git rev-list --max-parents=0 HEAD) # Use the initial commit as fallback | ||
fi | ||
# Compare changes between DIFF_BASE and HEAD | ||
if git diff --name-only $DIFF_BASE -- scripts/references | grep -q .; then | ||
echo "CHANGED=true" >> $GITHUB_ENV | ||
else | ||
echo "CHANGED=false" >> $GITHUB_ENV | ||
fi | ||
- name: Log in to GitHub Container Registry | ||
if: env.CHANGED == 'true' | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push Docker Image for scripts/references | ||
if: env.CHANGED == 'true' | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: scripts/references | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:references-${{ github.ref_name }} | ||
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:references-${{ github.ref_name }}-cache | ||
cache-to: type=inline,mode=max | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
Updates the potential pHI fields table with any new variables to redact | ||
*/ | ||
process update_potential_phi_fields_table { | ||
|
||
container "$params.references_docker" | ||
secret 'SYNAPSE_AUTH_TOKEN' | ||
debug true | ||
|
||
input: | ||
val comment | ||
val production | ||
|
||
output: | ||
stdout | ||
|
||
script: | ||
if (production) { | ||
""" | ||
cd /usr/local/src/myscripts/ | ||
Rscript update_potential_phi_fields_table.R -c $comment --production | ||
""" | ||
} | ||
else { | ||
""" | ||
cd /usr/local/src/myscripts/ | ||
Rscript update_potential_phi_fields_table.R -c $comment | ||
""" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,34 @@ | ||
FROM r-base:4.0.0 | ||
FROM rstudio/r-base:4.0-bullseye | ||
|
||
# Set working directory | ||
WORKDIR /usr/local/src/myscripts | ||
|
||
# Set environment variable for renv version | ||
ENV RENV_VERSION 0.14.0 | ||
|
||
RUN rm /etc/apt/apt.conf.d/default | ||
RUN apt-get update -y | ||
RUN apt-get install -y dpkg-dev zlib1g-dev libssl-dev libffi-dev | ||
# procps is required for nextflow tower | ||
RUN apt-get install -y curl libcurl4-openssl-dev procps | ||
RUN R -e "install.packages('synapser', repos=c('http://ran.synapse.org', 'http://cran.fhcrc.org'))" | ||
# Update apt-get and install system dependencies (only install required) | ||
RUN apt-get update -y && \ | ||
apt-get install -y --no-install-recommends \ | ||
dpkg-dev zlib1g-dev libssl-dev libffi-dev \ | ||
libcurl4-openssl-dev curl procps && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PYTHON /usr/local/lib/R/site-library/PythonEmbedInR/bin/python3.6 | ||
# Install R packages including remotes and renv | ||
RUN R -e "install.packages('remotes', repos = 'https://cloud.r-project.org')" && \ | ||
R -e "remotes::install_github('rstudio/renv', ref = '${RENV_VERSION}')" || true | ||
|
||
RUN R -e "install.packages('remotes', repos = c(CRAN = 'https://cloud.r-project.org'))" | ||
RUN R -e "remotes::install_github('rstudio/renv@${RENV_VERSION}')" | ||
# Install synapser with specific version | ||
RUN R -e "remotes::install_version('synapser', version = '0.11.7', repos = c('http://ran.synapse.org', 'http://cran.fhcrc.org'))" | ||
|
||
COPY . . | ||
# Set Python environment variable for R | ||
ENV PYTHON /usr/local/lib/R/site-library/PythonEmbedInR/bin/python3.6 | ||
|
||
# Copy only renv.lock first to leverage docker cache for dependencies | ||
COPY renv.lock renv.lock | ||
|
||
# Restore R environment with renv | ||
RUN R -e "renv::restore()" | ||
|
||
# Copy the local project files into the container | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.