From a5022d84cb11395d18c4989414b0052215cb4d4a Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Tue, 13 Dec 2022 15:47:46 -0500 Subject: [PATCH 1/8] add google_billing setting --- child/_child_terra_create_billing_project.Rmd | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/child/_child_terra_create_billing_project.Rmd b/child/_child_terra_create_billing_project.Rmd index 6eb39358..0a17c7ef 100644 --- a/child/_child_terra_create_billing_project.Rmd +++ b/child/_child_terra_create_billing_project.Rmd @@ -1,4 +1,14 @@ -1. [Launch Terra](https://anvil.terra.bio/#workspaces) and sign in with your Google account. **Make sure to use the same Google account that you used to set up Google Billing.** If this is your first time logging in to Terra, you will need to accept the Terms of Service. +```{r, include = FALSE} +if (!exists("AnVIL_module_settings")) { + AnVIL_module_settings <- list( + google_billing = TRUE + ) +} else if (is.null(AnVIL_module_settings$google_billing)) { + AnVIL_module_settings$audience = TRUE +} +``` + +1. [Launch Terra](https://anvil.terra.bio/#workspaces) and sign in with your Google account. `r if(AnVIL_module_settings$google_billing) {'**Make sure to use the same Google account that you used to set up Google Billing.**'}` If this is your first time logging in to Terra, you will need to accept the Terms of Service. 1. In the drop-down menu on the left, navigate to "Billing". Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click "Billing". @@ -6,21 +16,20 @@ ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_2") ``` -1. On the Billing page, click the "+ CREATE" button to create a new Billing Project. If prompted, select the Google account to use. Make sure to use the same Google account that you used to set up Google Billing. If prompted, give Terra permission to manage Google Cloud Platform billing accounts. +1. On the Billing page, click the "+ CREATE" button to create a new Billing Project. If prompted, select the Google account to use. `r if(AnVIL_module_settings$google_billing) {'Make sure to use the same Google account that you used to set up Google Billing.'}` If prompted, give Terra permission to manage Google Cloud Platform billing accounts. ```{r, echo=FALSE, fig.alt='Screenshot of the Terra Billing Page. The "plus" button next to "Billing Projects" is highlighted.'} ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_149") ``` -1. Enter a unique name for your Terra Billing Project and select the appropriate Google Billing Account. The name of the Terra Billing Project must: +1. Enter a **unique** name for your Terra Billing Project and select the appropriate Google Billing Account. The name of the Terra Billing Project must: + Only contain lowercase letters, numbers and hyphens + Start with a lowercase letter + Not end with a hyphen + Be between 6 and 30 characters - + Be unique across all Google Billing Projects ```{r, echo=FALSE, fig.alt='Screenshot of the Terra Add Billing Project dialog box.'} ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_293") ``` -The page doesn't always update as soon as the billing project is created. If it's been a couple of minutes and you don't see a change, try refreshing the page. +The page doesn't always update as soon as the Billing Project is created. If it's been a couple of minutes and you don't see a change, try refreshing the page. From e98c7fa0a5596e4dfbdfbb75bfb9b578b585637b Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Tue, 13 Dec 2022 15:52:46 -0500 Subject: [PATCH 2/8] clear settings at end of module --- child/_child_terra_create_billing_project.Rmd | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/child/_child_terra_create_billing_project.Rmd b/child/_child_terra_create_billing_project.Rmd index 0a17c7ef..641ea56b 100644 --- a/child/_child_terra_create_billing_project.Rmd +++ b/child/_child_terra_create_billing_project.Rmd @@ -33,3 +33,7 @@ ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN ``` The page doesn't always update as soon as the Billing Project is created. If it's been a couple of minutes and you don't see a change, try refreshing the page. + +```{r, include = FALSE} +AnVIL_module_settings <<- NULL +``` From a2b3b4318074f5b73dc1ef427359f1e2091c2da0 Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Tue, 13 Dec 2022 16:01:45 -0500 Subject: [PATCH 3/8] update 05-billing_modules with settings --- 05-billing_modules.Rmd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/05-billing_modules.Rmd b/05-billing_modules.Rmd index cd5fa457..4177e54c 100644 --- a/05-billing_modules.Rmd +++ b/05-billing_modules.Rmd @@ -6,55 +6,79 @@ Modules about billing and Billing Projects on Google Cloud Platform and Terra. ## Create Google Billing Account +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} cow::borrow_chapter( doc_path = "child/_child_google_billing_create_account.Rmd", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: ## Add Terra to Google Billing Account +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} cow::borrow_chapter( doc_path = "child/_child_google_billing_add_terra.Rmd", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: ## Create Terra Billing Project +This module can be modified depending on the audience: + +- If `AnVIL_module_settings$google_billing` is set to `TRUE`, it assumes the audience is also involved in Google Billing and reminds them to use the same Google Account to access Terra +- If `AnVIL_module_settings$google_billing` is `FALSE` or absent, the reminders are not included + +The demo below has the reminders included + +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} +# Specify settings +AnVIL_module_settings <- list( + google_billing = TRUE, +) cow::borrow_chapter( doc_path = "child/_child_terra_create_billing_project.Rmd", + branch = "update-child-create-billing-project", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: ## Add Members to Google Billing Account +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} cow::borrow_chapter( doc_path = "child/_child_google_billing_add_member.Rmd", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: ## Set Alerts for Google Billing +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} cow::borrow_chapter( doc_path = "child/_child_google_billing_set_alerts.Rmd", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: ## View Spend for Google Billing +:::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} cow::borrow_chapter( doc_path = "child/_child_google_billing_view_spend.Rmd", repo_name = "jhudsl/AnVIL_Template" ) ``` +:::: From 2a627dc1b72a23690030ac76ee58dbc5916897d3 Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Tue, 13 Dec 2022 16:06:07 -0500 Subject: [PATCH 4/8] remove extra comma --- 05-billing_modules.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/05-billing_modules.Rmd b/05-billing_modules.Rmd index 4177e54c..7abe08ac 100644 --- a/05-billing_modules.Rmd +++ b/05-billing_modules.Rmd @@ -39,7 +39,7 @@ The demo below has the reminders included ```{r, echo = FALSE, results='asis'} # Specify settings AnVIL_module_settings <- list( - google_billing = TRUE, + google_billing = TRUE ) cow::borrow_chapter( doc_path = "child/_child_terra_create_billing_project.Rmd", From 13340ad36a1a14c1efee4396c99197429e71b11f Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Thu, 15 Dec 2022 14:46:16 -0500 Subject: [PATCH 5/8] remove settings from chapter 5 --- 05-billing_modules.Rmd | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/05-billing_modules.Rmd b/05-billing_modules.Rmd index 7abe08ac..e179f944 100644 --- a/05-billing_modules.Rmd +++ b/05-billing_modules.Rmd @@ -28,22 +28,10 @@ cow::borrow_chapter( ## Create Terra Billing Project -This module can be modified depending on the audience: - -- If `AnVIL_module_settings$google_billing` is set to `TRUE`, it assumes the audience is also involved in Google Billing and reminds them to use the same Google Account to access Terra -- If `AnVIL_module_settings$google_billing` is `FALSE` or absent, the reminders are not included - -The demo below has the reminders included - :::: {.borrowed_chunk} ```{r, echo = FALSE, results='asis'} -# Specify settings -AnVIL_module_settings <- list( - google_billing = TRUE -) cow::borrow_chapter( doc_path = "child/_child_terra_create_billing_project.Rmd", - branch = "update-child-create-billing-project", repo_name = "jhudsl/AnVIL_Template" ) ``` From 79e6c78ec06f247ed452c52406110d8e0cf3d223 Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Thu, 15 Dec 2022 14:47:35 -0500 Subject: [PATCH 6/8] remove settings from child --- child/_child_terra_create_billing_project.Rmd | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/child/_child_terra_create_billing_project.Rmd b/child/_child_terra_create_billing_project.Rmd index 641ea56b..42db3ad2 100644 --- a/child/_child_terra_create_billing_project.Rmd +++ b/child/_child_terra_create_billing_project.Rmd @@ -1,14 +1,4 @@ -```{r, include = FALSE} -if (!exists("AnVIL_module_settings")) { - AnVIL_module_settings <- list( - google_billing = TRUE - ) -} else if (is.null(AnVIL_module_settings$google_billing)) { - AnVIL_module_settings$audience = TRUE -} -``` - -1. [Launch Terra](https://anvil.terra.bio/#workspaces) and sign in with your Google account. `r if(AnVIL_module_settings$google_billing) {'**Make sure to use the same Google account that you used to set up Google Billing.**'}` If this is your first time logging in to Terra, you will need to accept the Terms of Service. +1. [Launch Terra](https://anvil.terra.bio/#workspaces) and sign in with your Google account. If this is your first time logging in to Terra, you will need to accept the Terms of Service. 1. In the drop-down menu on the left, navigate to "Billing". Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click "Billing". @@ -16,7 +6,7 @@ if (!exists("AnVIL_module_settings")) { ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_2") ``` -1. On the Billing page, click the "+ CREATE" button to create a new Billing Project. If prompted, select the Google account to use. `r if(AnVIL_module_settings$google_billing) {'Make sure to use the same Google account that you used to set up Google Billing.'}` If prompted, give Terra permission to manage Google Cloud Platform billing accounts. +1. On the Billing page, click the "+ CREATE" button to create a new Billing Project. If prompted, select the Google account to use. If prompted, give Terra permission to manage Google Cloud Platform billing accounts. ```{r, echo=FALSE, fig.alt='Screenshot of the Terra Billing Page. The "plus" button next to "Billing Projects" is highlighted.'} ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_149") From 518f6800baee4ab0fb7e097b0dca19e9fbcd5183 Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Thu, 15 Dec 2022 14:50:18 -0500 Subject: [PATCH 7/8] remove code chunk clearing settings --- child/_child_terra_create_billing_project.Rmd | 4 ---- 1 file changed, 4 deletions(-) diff --git a/child/_child_terra_create_billing_project.Rmd b/child/_child_terra_create_billing_project.Rmd index 42db3ad2..503f0696 100644 --- a/child/_child_terra_create_billing_project.Rmd +++ b/child/_child_terra_create_billing_project.Rmd @@ -23,7 +23,3 @@ ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN ``` The page doesn't always update as soon as the Billing Project is created. If it's been a couple of minutes and you don't see a change, try refreshing the page. - -```{r, include = FALSE} -AnVIL_module_settings <<- NULL -``` From e744ae401e8cffb4cce1d59882ef175d6aa7b9c6 Mon Sep 17 00:00:00 2001 From: KatherineCox Date: Thu, 15 Dec 2022 15:21:29 -0500 Subject: [PATCH 8/8] add direct link to terra billing --- child/_child_terra_create_billing_project.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/child/_child_terra_create_billing_project.Rmd b/child/_child_terra_create_billing_project.Rmd index 503f0696..8148c3a4 100644 --- a/child/_child_terra_create_billing_project.Rmd +++ b/child/_child_terra_create_billing_project.Rmd @@ -1,6 +1,6 @@ 1. [Launch Terra](https://anvil.terra.bio/#workspaces) and sign in with your Google account. If this is your first time logging in to Terra, you will need to accept the Terms of Service. -1. In the drop-down menu on the left, navigate to "Billing". Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click "Billing". +1. In the drop-down menu on the left, navigate to "Billing". Click the triple bar in the top left corner to access the menu. Click the arrow next to your name to expand the menu, then click "Billing". You can also navigate there directly with this link: https://anvil.terra.bio/#billing ```{r, echo=FALSE, fig.alt='Screenshot of the Terra drop-down menu. Three items are highlighted: 1) the "hamburger" button for extending the drop-down menu, 2) the arrow next to your username, for extending the drop-down submenu, and 3) the submenu item "Billing".'} ottrpal::include_slide("https://docs.google.com/presentation/d/1POwxqv4p6AfPHJlN9VNq0TaT44fA2RAFSpIERIMHdWU/edit#slide=id.g116f8d759be_0_2")