Skip to content
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

Testing Continuous Deployment to NIDAP #139

Merged
merged 28 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
eeeecd1
fix(DEG): changed error checking code
maggiecam Sep 1, 2023
65f7614
fix(DEG): New config for yml file
maggiecam Sep 1, 2023
6e4482a
fix(DEG): format change
maggiecam Sep 1, 2023
9fd601f
fix(kidney integration test): Updated kidney test markdown for testin…
escauley Sep 20, 2023
3f6c011
feat(segmentID list): Added initial list of segment IDs before filtering
escauley Sep 20, 2023
2322b1e
fix(initialization):Added slide name to segmentID
escauley Sep 20, 2023
2c8b69a
fix(DESCRIPTION): Relaxed version spec for depends
escauley Oct 19, 2023
e09371f
fix(DESCRIPTION): Setting explicit versions for depends ggplot2, ggfo…
escauley Oct 19, 2023
f9deb63
Merge pull request #132 from NIDAP-Community/dev
escauley Oct 19, 2023
191badc
fix(DESCRIPTION)
escauley Oct 19, 2023
31113a7
Merge branch 'fix_dependencies' of https://github.com/NIDAP-Community…
escauley Oct 19, 2023
7270e32
fix(study design): Updated Sankey plot for updated ggplot2 and ggforc…
escauley Oct 20, 2023
995b40d
fix(filtering): Updates for sankey plot in filtering
escauley Oct 20, 2023
d69b216
fix(docs): Updated function documentation
escauley Oct 20, 2023
b1719d0
Merge pull request #133 from NIDAP-Community/fix_dependencies
escauley Oct 23, 2023
b96dba8
Merge pull request #134 from NIDAP-Community/fix_sankey
escauley Oct 23, 2023
df9ac61
Merge branch 'dev' into filter_segment_selection
escauley Oct 23, 2023
62140eb
Merge pull request #135 from NIDAP-Community/filter_segment_selection
escauley Oct 23, 2023
5bebe06
Merge branch 'dev' into defix_830
escauley Oct 23, 2023
25cd950
Merge pull request #136 from NIDAP-Community/defix_830
escauley Oct 23, 2023
b880f9e
Kidney Integration test: Update for QC parameters
escauley Jan 19, 2024
3fab7b1
Merge branch 'dev' of https://github.com/NIDAP-Community/DSPWorkflow …
escauley Jan 19, 2024
33b76b1
Update to Kidney Integration Test
escauley Jan 19, 2024
6f434ab
feat: QC output for specific flagged segments and probes
escauley Jan 26, 2024
f3f5879
feat: Updates to QC flag print out and associated markdown vignettes,…
escauley Jan 30, 2024
046f5e6
Merge pull request #137 from NIDAP-Community/QC_flag_report_feature
ruiheesi Jan 30, 2024
ae18de3
feat: CI/CD and Conda Recipe
ruiheesi Jan 30, 2024
a675d0b
Merge pull request #138 from NIDAP-Community/update_cd
ruiheesi Jan 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions .github/workflows/Manual_Deployment_to_NIDAP.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Manual Deployment to NIDAP
run-name: Manual Deployment to NIDAP by ${{ github.actor }}

on:
workflow_dispatch:
inputs:

image_to_use:
required: true
default: "<Replace with your image>"
type: string

package_to_deploy:
required: true
type: string

artifact_rid:
required: true
default: "<Replace with your artifact RID>"
type: string

token_to_use:
required: true
type: string


jobs:
Adding_documentation_files_and_publish_page:
runs-on: ubuntu-latest
container:
image: ${{ inputs.image_to_use }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

steps:
- run: echo "Checking in ${{ inputs.image_to_use }}"
- uses: actions/checkout@v3
with:
token: ${{secrets.GITHUB_TOKEN}}

- name: Continuous Deployment to NIDAP
id: nidap-cd
run: |
export current_wd="/__w/${GITHUB_REPOSITORY#*/}/${GITHUB_REPOSITORY#*/}"
cd $current_wd

export MY_GIT_TOKEN=${{ secrets.GITHUB_TOKEN }}
export MY_GIT_USERNAME=${{ github.actor }}
export MY_GIT_EMAIL=${{ github.event.pusher.email }}

git config --global user.name "$MY_GIT_USERNAME"
git config --global user.email "$MY_GIT_EMAIL"
git config --global url."https://api:[email protected]/".insteadOf "https://github.com/"
git config --global url."https://ssh:[email protected]/".insteadOf "ssh://[email protected]/"
git config --global url."https://git:[email protected]/".insteadOf "[email protected]:"

git config --global --add safe.directory "$current_wd"

git clone https://github.com/${GITHUB_REPOSITORY}.git

cd ${GITHUB_REPOSITORY#*/}

BRANCH_NAME="Conda_Package"

git checkout $BRANCH_NAME

echo "########## Git setup complete, moving to deployment... ##########"

conda install curl

current_pkg="${{ inputs.package_to_deploy }}"

echo "Package to Upload: $current_pkg"

TOKEN="${{ inputs.token_to_use }}"
PACKAGE="$current_pkg"
PLATFORM="linux-64" # replace with the package platform (e.g. noarch, linux-64, osx-64)
response=$(curl \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@$PACKAGE" \
-XPUT "https://nidap.nih.gov/artifacts/api/repositories/${{ inputs.artifact_rid }}/contents/release/conda/$PLATFORM/$PACKAGE" \
2>&1)


echo "#########################################################"

current_datetime="$(date +"%Y-%m-%d %H:%M:%S")"

# Check if the response contains an error message
if echo "$response" | grep -q "errorCode"; then
status=$(echo "$response" | grep -o '"errorName":"[^"]*' | awk -F'"' '{print $4}')
echo "Error message: $status"
echo "<br>Deployment Time: $current_datetime; Deployment Status: $status" >> README.md
else
status="Success"
echo "Update Success!"
echo "Package ${{ env.current_pkg }} is now on NIDAP."
echo "<br>Deployment Time: $current_datetime; Deployment Status: Success" >> README.md
fi

git commit -a -m "Deployment Performed on $current_datetime with Status: $status."

git push -f origin $BRANCH_NAME
16 changes: 11 additions & 5 deletions .github/workflows/gitflow-R-action.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: Gitflow Action for R Package Development
run-name: ${{ github.actor }} now ${{ github.event_name }} to ${{ github.ref_name }}
run-name: ${{ github.actor }} ${{ github.event_name }} to ${{ github.ref_name }}

on:
push:
branches: ['*', '!dev', '!main']
branches: ['*', '!dev', '!main', '!release_dev', '!Conda_Package', '!github_page']

pull_request:
types: ['opened', 'closed']
branches: ['main', 'release*']

jobs:
Activating_Parser:
uses: fnlcr-bids-sdsi/gitflow-R/.github/workflows/parser.yml@DSPWorkflow
uses: fnlcr-bids-sdsi/gitflow-R/.github/workflows/parser.yml@master
with:
image_to_use: ghcr.io/nidap-community/dsp_github_workflow_env:DSPv0.9.5

image_to_use: ghcr.io/nidap-community/dsp_ci_cd:latest
package_name: "r-dspworkflow"
r_version: "4.1.3"
artifact_rid_production: "ri.artifacts.main.repository.20ce29a2-3803-4eae-b325-8fe367d47d1e"
artifact_rid_development: "ri.stemma.main.repository.2172e505-c98f-43d4-881a-47e170aadbe1"
secrets:
NIDAP_TOKEN_PRODUCTION: ${{ secrets.NIDAP_TOKEN_PRODUCTION }}
NIDAP_TOKEN_DEVELOPMENT: ${{ secrets.NIDAP_TOKEN_DEVELOPMENT }}
109 changes: 109 additions & 0 deletions Conda_Recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{% set version = '<CURRENT_VERSION>' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
name: r-dspworkflow-test
version: {{ version|replace("-", "_") }}

channels:
- conda-forge
- bioconda
- file:///local_channel

source:

git_url: https://github.com/NIDAP-Community/DSPWorkflow/
git_tag: continuous_deployment

build:
merge_build_host: True # [win]
# If this is a new build for the same version, increment the build number.
number: 0
# no skip

# This is required to make R link correctly on Linux.
rpaths:
- lib/R/lib/
- lib/

# Suggests: testthat (== 3.1.4)
requirements:
build:
- {{ posix }}filesystem # [win]
- {{ posix }}git
- {{ posix }}zip # [win]

host:
- r-base =4.1.3=h2f963a2_5
- bioconductor-biobase =2.54.0=r41hc0cfd56_2
- bioconductor-biocgenerics =0.40.0=r41hdfd78af_0
- bioconductor-geomxtools =3.1.1=r41hdfd78af_0
- bioconductor-nanostringnctools =1.2.0
- bioconductor-spatialdecon =1.4.3
- bioconductor-complexheatmap =2.10.0=r41hdfd78af_0
- bioconductor-genomeinfodbdata =1.2.6
- r-cowplot =1.1.1=r41hc72bb7e_1
- r-dplyr =1.0.9=r41h7525677_0
- r-ggforce =0.3.4=r41h7525677_0
- r-ggplot2 =3.3.6=r41hc72bb7e_1
- r-gridextra =2.3=r41hc72bb7e_1004
- r-gtable =0.3.0=r41hc72bb7e_3
- r-knitr =1.40=r41hc72bb7e_1
- r-patchwork =1.1.2=r41hc72bb7e_1
- r-reshape2 =1.4.4=r41h7525677_2
- r-scales =1.2.1=r41hc72bb7e_1
- r-tibble =3.1.8=r41h06615bd_1
- r-tidyr =1.2.1=r41h7525677_1
- r-umap =0.2.9.0=r41h7525677_1
- r-rtsne =0.16=r41h37cf8d7_1
- r-magrittr =2.0.3=r41h06615bd_1
- r-rlang =1.1.0=r41h38f115c_0
- r-ggiraph=0.7.10=r41h03ef668_0

run:
- r-base =4.1.3=h2f963a2_5
- bioconductor-biobase =2.54.0=r41hc0cfd56_2
- bioconductor-biocgenerics =0.40.0=r41hdfd78af_0
- bioconductor-geomxtools =3.1.1=r41hdfd78af_0
- bioconductor-nanostringnctools =1.2.0
- bioconductor-spatialdecon =1.4.3
- bioconductor-complexheatmap =2.10.0=r41hdfd78af_0
- bioconductor-genomeinfodbdata =1.2.6
- r-cowplot =1.1.1=r41hc72bb7e_1
- r-dplyr =1.0.9=r41h7525677_0
- r-ggforce =0.3.4=r41h7525677_0
- r-ggplot2 =3.3.6=r41hc72bb7e_1
- r-gridextra =2.3=r41hc72bb7e_1004
- r-gtable =0.3.0=r41hc72bb7e_3
- r-knitr =1.40=r41hc72bb7e_1
- r-patchwork =1.1.2=r41hc72bb7e_1
- r-reshape2 =1.4.4=r41h7525677_2
- r-scales =1.2.1=r41hc72bb7e_1
- r-tibble =3.1.8=r41h06615bd_1
- r-tidyr =1.2.1=r41h7525677_1
- r-umap =0.2.9.0=r41h7525677_1
- r-rtsne =0.16=r41h37cf8d7_1
- r-magrittr =2.0.3=r41h06615bd_1
- r-rlang =1.1.0=r41h38f115c_0
- r-ggiraph=0.7.10=r41h03ef668_0

test:
commands:
# You can put additional test commands to be run here.
- $R -e "library('DSPWorkflow')" # [not win]
- "\"%R%\" -e \"library('DSPWorkflow')\"" # [win]

about:
home: https://github.com/NIDAP-Community/DSPWorkflow
license: MIT
summary: A set of functions for analyzing RNA data from the spatial transcriptomics approach
Digital Spatial Profiling (Nanostring). The user provides read count data and annotations,
and the package outputs normalized differential expression of genes and further
visualizations and analysis based on user input. It can be run in a docker container
and in user-friendly web-based interactive notebooks (NIDAP, Palantir Foundry).
license_family: MIT
license_file:
- '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
- LICENSE
46 changes: 23 additions & 23 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
biocViews:
Suggests:
testthat (== 3.1.4)
testthat (>= 3.1.4)
Depends:
R (>= 4.1.3)
Imports:
Biobase (>= 2.54.0),
BiocGenerics (== 0.40.0),
cowplot (== 1.1.1),
dplyr (== 1.0.9),
GeomxTools (== 3.1.1),
ggforce (== 0.3.4),
ggplot2 (== 3.3.6),
gridExtra (== 2.3),
grid (== 4.1.3),
gtable (== 0.3.0),
knitr (== 1.40),
NanoStringNCTools (== 1.2.0),
patchwork (== 1.1.2),
reshape2 (== 1.4.4),
Rtsne (== 0.16),
scales (== 1.2.1),
stats (== 4.1.3),
SpatialDecon (== 1.4.3),
tibble (== 3.1.8),
tidyr (== 1.2.1),
umap (== 0.2.9.0),
magrittr (== 2.0.3),
ComplexHeatmap (== 2.10.0)
BiocGenerics (>= 0.40.0),
cowplot (>= 1.1.1),
dplyr (>= 1.0.9),
GeomxTools (>= 3.1.1),
ggforce (>= 0.3.4),
ggplot2 (>= 3.3.6),
gridExtra (>= 2.3),
grid (>= 4.1.3),
gtable (>= 0.3.0),
knitr (>= 1.40),
NanoStringNCTools (>= 1.2.0),
patchwork (>= 1.1.2),
reshape2 (>= 1.4.4),
Rtsne (>= 0.16),
scales (>= 1.2.1),
stats (>= 4.1.3),
SpatialDecon (>= 1.4.3),
tibble (>= 3.1.8),
tidyr (>= 1.2.1),
umap (>= 0.2.9.0),
magrittr (>= 2.0.3),
ComplexHeatmap (>= 2.10.0)
Config/testthat/edition: 3
41 changes: 41 additions & 0 deletions Dockerfile/Conda_container/Building_R_environment/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Type: project
Description: Digital-Spatial-Profiling v3.1.1 environment for DSP package.
Repository:
CRAN,
biocsoftv314,
biocsoftv315,
biocanadatav313,
biocexpdatav314,
biocworkflowv314
Depends:
backports (== 1.4.1),
Biobase (== 2.54.0),
BiocGenerics (== 0.40.0),
cowplot (== 1.1.1),
dplyr (== 1.0.9),
GeomxTools (== 3.1.1),
ggforce (== 0.3.4),
ggplot2 (== 3.3.6),
ggiraph (== 0.8.3),
dbplyr (== 2.2.1),
gridExtra (== 2.3),
gtable (== 0.3.0),
knitr (== 1.40),
NanoStringNCTools (== 1.4.0),
patchwork (== 1.1.2),
reshape2 (== 1.4.4),
Rmpfr (== 0.8-9),
Rtsne (== 0.16),
scales (== 1.2.1),
stats (== 4.1.3),
SpatialDecon (== 1.4.3),
tibble (== 3.1.8),
tidyr (== 1.2.1),
tidyverse (== 1.3.2),
umap (== 0.2.9.0),
pheatmap (== 1.0.12),
stringr
Remotes:
url::https://bioconductor.org/packages/3.15/workflows/src/contrib/GeoMxWorkflows_1.2.0.tar.gz,
git::https://github.com/Nanostring-Biostats/SpatialOmicsOverlay.git,
git::https://github.com/Nanostring-Biostats/GeomxTools.git
44 changes: 44 additions & 0 deletions Dockerfile/Conda_container/Building_R_environment/Generate_Renv.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 9/13/2022 [email protected]
# Creating renv environment now

#############################################################

print("Loading repos...")
repos <- c(CRAN = "https://cloud.r-project.org",
biocsoftv314 = "https://bioconductor.org/packages/3.14/bioc/",
biocsoftv315 = "https://bioconductor.org/packages/3.15/bioc/",
biocanadatav313 = "https://bioconductor.org/packages/3.14/data/annotation/",
biocexpdatav314 = "https://bioconductor.org/packages/3.14/data/experiment/",
biocworkflowv314 = "https://bioconductor.org/packages/3.14/workflows/")
options(repos = repos)
print("Repos loaded.")

###############################################################

print("Setting up plain R environment now...")

if(!file.exists("DESCRIPTION")){

print("No existing DESCRIPTION file in current working directory:")
print(getwd())
print("Exiting Environment setup now.")

auto.snapshot <- getOption("renv.config.auto.snapshot")
options(renv.config.auto.snapshot = TRUE)
break

}else{

print("Installing Packages from DESCRIPTION now...")

renv::install()

print("Packages installed.")


auto.snapshot <- getOption("renv.config.auto.snapshot")
options(renv.config.auto.snapshot = TRUE)

}


Loading
Loading