From 7de4986fd42783424057968dd00bf1007f903a6e Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:10:20 -0700 Subject: [PATCH 01/13] bumb checkout version --- .github/workflows/deploy-shinyapps-io.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 58d4176..10ab366 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -21,7 +21,7 @@ jobs: sudo apt-get update sudo apt-get install -y pip python3-venv libcurl4-openssl-dev - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: disable renv run: | From 74f76de9fa8accdbfde8506a220cfc0913a3b94c Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:10:58 -0700 Subject: [PATCH 02/13] don't disable renv (didn't work anyway) --- .github/workflows/deploy-shinyapps-io.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 10ab366..836ab8f 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -23,12 +23,6 @@ jobs: - uses: actions/checkout@v4 - - name: disable renv - run: | - rm .Rprofile - rm renv.lock - rm -rf renv - - name: Install R packages run: | # The binary package distributions from R Studio dramatically speed up installation time From 03d1881667f07bde94fb2e023aad94edc6be9b8a Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:23:02 -0700 Subject: [PATCH 03/13] update to latest version of workflow from r-lib --- .github/workflows/deploy-shinyapps-io.yaml | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 836ab8f..8afd438 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -1,4 +1,4 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/master/examples +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help name: shinyapps-io-deploy @@ -13,23 +13,23 @@ jobs: shinyapps-io-deploy: if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: + - uses: actions/checkout@v4 - - name: Install System Dependencies - run: | - sudo apt-get update - sudo apt-get install -y pip python3-venv libcurl4-openssl-dev + - uses: r-lib/actions/setup-pandoc@v2 - - uses: actions/checkout@v4 + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true - - name: Install R packages - run: | - # The binary package distributions from R Studio dramatically speed up installation time - options(repos = c(REPO_NAME = "https://packagemanager.rstudio.com/all/__linux__/focal/latest", - getOption("repos"))) - install.packages(c("dplyr", "purrr", "reactable", "shiny", "rsconnect", "rjson", "httr")) - shell: sudo Rscript {0} # running this step as 'sudo' is necessary to be able to install packages in default library + - uses: r-lib/actions/setup-renv@v2 + + - name: Install rsconnect + run: install.packages("rsconnect") + shell: Rscript {0} - name: Authorize and deploy app run: | From 879b3b764fef812c3bb4e88ee6fb3d95ea4f137d Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:30:14 -0700 Subject: [PATCH 04/13] don't install from renv during gh action --- .github/workflows/deploy-shinyapps-io.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 8afd438..48723f2 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -21,9 +21,9 @@ jobs: - uses: r-lib/actions/setup-pandoc@v2 - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true + # - uses: r-lib/actions/setup-r@v2 + # with: + # use-public-rspm: true - uses: r-lib/actions/setup-renv@v2 From 5dfce26ea2c2487133027ebeda6952f2f8d5323a Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:35:33 -0700 Subject: [PATCH 05/13] don't install from renv during action --- .github/workflows/deploy-shinyapps-io.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 8afd438..a5ced56 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -25,7 +25,7 @@ jobs: with: use-public-rspm: true - - uses: r-lib/actions/setup-renv@v2 + #- uses: r-lib/actions/setup-renv@v2 - name: Install rsconnect run: install.packages("rsconnect") From 14d147c86310be4533bdd0accc44f3a7804000af Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:42:05 -0700 Subject: [PATCH 06/13] definitely need renv --- .github/workflows/deploy-shinyapps-io.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index a5ced56..8afd438 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -25,7 +25,7 @@ jobs: with: use-public-rspm: true - #- uses: r-lib/actions/setup-renv@v2 + - uses: r-lib/actions/setup-renv@v2 - name: Install rsconnect run: install.packages("rsconnect") From 71e1c644b85edbee48f191a9594130c0b3cc504a Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:59:45 -0700 Subject: [PATCH 07/13] ignore large directories during rsconnect deploy --- .rsconnectignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .rsconnectignore diff --git a/.rsconnectignore b/.rsconnectignore new file mode 100644 index 0000000..e839f4f --- /dev/null +++ b/.rsconnectignore @@ -0,0 +1,5 @@ +renv/ +.git/ +.Rproj.user/ +*.Rproj +*.log From bc36733293669d4b0a85f845f8bb091c8cc63751 Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:07:03 -0700 Subject: [PATCH 08/13] rsconnect ignore Rprofile --- .rsconnectignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.rsconnectignore b/.rsconnectignore index e839f4f..cac7b27 100644 --- a/.rsconnectignore +++ b/.rsconnectignore @@ -3,3 +3,4 @@ renv/ .Rproj.user/ *.Rproj *.log +.Rprofile From 335e51144a8ce6ffdc355710c85c2aeddef145ab Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:12:33 -0700 Subject: [PATCH 09/13] rename rsconnect ignore file --- .rscignore | 6 ++++++ .rsconnectignore | 1 + 2 files changed, 7 insertions(+) create mode 100644 .rscignore diff --git a/.rscignore b/.rscignore new file mode 100644 index 0000000..a163d85 --- /dev/null +++ b/.rscignore @@ -0,0 +1,6 @@ +renv/ +.Rprofile +.git/ +.Rproj.user/ +*.Rproj +*.log diff --git a/.rsconnectignore b/.rsconnectignore index e839f4f..a163d85 100644 --- a/.rsconnectignore +++ b/.rsconnectignore @@ -1,4 +1,5 @@ renv/ +.Rprofile .git/ .Rproj.user/ *.Rproj From 202bb048e85add4d287b101796311bbbdb170825 Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:17:55 -0700 Subject: [PATCH 10/13] this wasn't the right file name --- .rsconnectignore | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .rsconnectignore diff --git a/.rsconnectignore b/.rsconnectignore deleted file mode 100644 index a42da29..0000000 --- a/.rsconnectignore +++ /dev/null @@ -1,7 +0,0 @@ -renv/ -.Rprofile -.git/ -.Rproj.user/ -*.Rproj -*.log -.Rprofile From 450c36b27d350567be84bcd4d1e817bd0db8448d Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:18:16 -0700 Subject: [PATCH 11/13] setting appFiles to all files overrides .rscignore --- .github/workflows/deploy-shinyapps-io.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-shinyapps-io.yaml b/.github/workflows/deploy-shinyapps-io.yaml index 8afd438..5c47ac7 100644 --- a/.github/workflows/deploy-shinyapps-io.yaml +++ b/.github/workflows/deploy-shinyapps-io.yaml @@ -43,7 +43,7 @@ jobs: rsConnectToken <- "${{ secrets.RSCONNECT_TOKEN }}" rsConnectSecret <- "${{ secrets.RSCONNECT_SECRET }}" rsconnect::setAccountInfo(rsConnectUser, rsConnectToken, rsConnectSecret) - appFiles<-dir(all.files=TRUE, include.dirs=TRUE) - rsconnect::deployApp(appName = appName, appFiles=appFiles, forceUpdate = TRUE) + # appDir default is current working directory + rsconnect::deployApp(appName = appName, forceUpdate = TRUE) # important NOT to run this step as sudo, otherwise env var's will be missing shell: Rscript {0} From 72a56af1bcdd36eff6c71ac533fadc8be100c6b2 Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:01:48 -0700 Subject: [PATCH 12/13] Update README.md --- README.md | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index cec8a31..97d1d49 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,24 @@ # AMP-AD Metadata Dictionary -Hosts the dictionary used for metadata in AMP-AD, which is composed of the -[synapseAnnotations](https://github.com/Sage-Bionetworks/synapseAnnotations/) as -well as some custom values that are used only in metadata files, and not as -annotations. +Hosts the dictionary used for metadata in AMP-AD, which is a ReacTable object that displays the production [ADKP data model](https://github.com/adknowledgeportal/data-models/blob/main/AD.model.csv). + +The dictionary app displays all attributes used as manifest columns, and all valid values for those columns. It does not display manifest attributes (where Parent = 'ManifestTemplate'). ### To deploy to ShinyApps.io: -- Enable workflows in the GitHub repository -- Under [secrets](https://github.com/Sage-Bionetworks/amp-ad-metadata-dictionary/settings/secrets/actions) click 'New repository secret' -- Enter secrets for `RSCONNECT_USER`, `RSCONNECT_TOKEN`, and `RSCONNECT_SECRET`, the values for which are saved in Sage's LastPass. -- Push to new branch on Github -- Create pull request with at least one reviewer to master branch -- Upon merge of pull request, the app will deploy to staging. +The shinyapps.io deployment workflow is `deploy-shinyapps-io.yaml`. +- This uses repository secrets to deploy the app to ShinyApps.io via rsconnect: `RSCONNECT_USER`, `RSCONNECT_TOKEN`, and `RSCONNECT_SECRET`. Values for these are saved in Sage's LastPass. +- This workflow runs when a PR is approved and merged into, OR via manual workflow dispatch +- Upon completion of the workflow, the app will deploy to staging. Check out the app here: https://sagebio.shinyapps.io/amp-ad-metadata-dictionary-staging. -- After verifying correctness, create pull request with at least one reviewer to prod branch +- After verifying correctness on `main`, create pull request with at least one reviewer to `prod` branch - Upon merge of pull request, the app will deploy to production. -- The app' will become available at https://sagebio.shinyapps.io/amp-ad-metadata-dictionary +- The production app will become available at https://sagebio.shinyapps.io/amp-ad-metadata-dictionary +- This app is embedded as an iframe on the Synapse wiki here: https://www.synapse.org/Synapse:syn25878249 + +### To deploy to Github Pages via shinylive: + +The shinylive deployment workflow is `deploy-shinylive.yaml`. +- This uses the `shinylive` package to build a static site that is run entirely in the browser (https://posit-dev.github.io/r-shinylive/), and deploy that site to Github pages +- This workflow runs on a push to `main` or via workflow dispatch +- ⚠️ right now this site loads very, very slowly. The static site will not replace the shinyapps.io deployment as our user-facing version unless we can figure out how to speed it up. From 3b1a8a02ef1d30b4950d47e62150e78f60e5da49 Mon Sep 17 00:00:00 2001 From: Abby Vander Linden <11965371+avanlinden@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:02:51 -0700 Subject: [PATCH 13/13] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 97d1d49..69e4835 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Hosts the dictionary used for metadata in AMP-AD, which is a ReacTable object th The dictionary app displays all attributes used as manifest columns, and all valid values for those columns. It does not display manifest attributes (where Parent = 'ManifestTemplate'). +As of August 2024, this app no longer interacts with Synapse since it is pulling from the ADKP data model used for schematic and DCA. The recitulate and synapsclient dependencies have been removed. + ### To deploy to ShinyApps.io: The shinyapps.io deployment workflow is `deploy-shinyapps-io.yaml`.