From 65f63eac0809ef6a6344d2b29746e08fe6eafedc Mon Sep 17 00:00:00 2001 From: Radius CI Bot Date: Mon, 22 Jul 2024 21:34:05 +0000 Subject: [PATCH 01/10] Update docs for v0.36.0 --- docs/config.toml | 8 ++++---- docs/layouts/partials/hooks/body-end.html | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index 01ff03b9f..877bac454 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://edge.docs.radapp.io/" +baseURL = "https://docs.radapp.io/" languageCode = "en-us" title = "Radius Docs" theme = "docsy" @@ -67,9 +67,9 @@ tag = "tags" [params] copyright = "The Radius Authors. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see the https://linuxfoundation.org/trademark-usage/ page." -version = "edge" +version = "v0.36" tag_version = "latest" -chart_version = "0.26.0" +chart_version = "0.36.0" # Algolia Search algolia_docsearch = true @@ -77,7 +77,7 @@ algolia_docsearch = true # GitHub Information github_repo = "https://github.com/radius-project/docs" github_subdir = "docs" -github_branch = "edge" +github_branch = "v0.36" github_project_repo = "https://github.com/radius-project/radius" # Versioning diff --git a/docs/layouts/partials/hooks/body-end.html b/docs/layouts/partials/hooks/body-end.html index 3f4109e18..f640ff308 100644 --- a/docs/layouts/partials/hooks/body-end.html +++ b/docs/layouts/partials/hooks/body-end.html @@ -5,7 +5,7 @@ container: '#docsearch', appId: 'ED67NSVSZS', apiKey: '21e2920c3a9c29b98cbc382694413f29', - indexName: 'radapp-dev-edge', + indexName: 'radapp-dev', }); {{ end }} From bc9707a2720d907e0230c3e38b9fd3c83ee8e66e Mon Sep 17 00:00:00 2001 From: rad-ci-bot <103787451+rad-ci-bot@users.noreply.github.com> Date: Tue, 23 Jul 2024 09:45:51 -0700 Subject: [PATCH 02/10] Update auto-generated documentation (#1151) * Autogenerate reference docs Signed-off-by: rad-ci-bot * Update en-custom.txt Signed-off-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> --------- Signed-off-by: rad-ci-bot Signed-off-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> Co-authored-by: rad-ci-bot Co-authored-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> --- .github/config/en-custom.txt | 4 +++ .../2023-10-01-preview/environments/index.md | 33 ++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/config/en-custom.txt b/.github/config/en-custom.txt index e17688da1..de9820ad8 100644 --- a/.github/config/en-custom.txt +++ b/.github/config/en-custom.txt @@ -1249,3 +1249,7 @@ azwi Entra ServiceAccounts pluggable +envSecrets +RecipeConfigPropertiesEnvSecrets +ProviderConfigPropertiesSecrets +SecretReference diff --git a/docs/content/reference/resources/applications/applications.core/2023-10-01-preview/environments/index.md b/docs/content/reference/resources/applications/applications.core/2023-10-01-preview/environments/index.md index 0c817e3e4..583d6359e 100644 --- a/docs/content/reference/resources/applications/applications.core/2023-10-01-preview/environments/index.md +++ b/docs/content/reference/resources/applications/applications.core/2023-10-01-preview/environments/index.md @@ -171,6 +171,7 @@ description: "Detailed reference documentation for applications.core/environment | Property | Type | Description | |----------|------|-------------| | **env** | [EnvironmentVariables](#environmentvariables) | The environment variables injected during Terraform Recipe execution for the recipes in the environment. | +| **envSecrets** | [RecipeConfigPropertiesEnvSecrets](#recipeconfigpropertiesenvsecrets) | Environment variables containing sensitive information can be stored as secrets. The secrets are stored in Applications.Core/SecretStores resource. | | **terraform** | [TerraformConfigProperties](#terraformconfigproperties) | Configuration for Terraform Recipes. Controls how Terraform plans and applies templates as part of Recipe deployment. | ### EnvironmentVariables @@ -183,6 +184,25 @@ description: "Detailed reference documentation for applications.core/environment * **Additional Properties Type**: string +### RecipeConfigPropertiesEnvSecrets + +#### Properties + +* **none** + +#### Additional Properties + +* **Additional Properties Type**: [SecretReference](#secretreference) + +### SecretReference + +#### Properties + +| Property | Type | Description | +|----------|------|-------------| +| **key** | string | The key for the secret in the secret store.
_(required)_ | +| **source** | string | The ID of an Applications.Core/SecretStore resource containing sensitive data required for recipe execution.
_(required)_ | + ### TerraformConfigProperties #### Properties @@ -240,11 +260,22 @@ description: "Detailed reference documentation for applications.core/environment #### Properties +| Property | Type | Description | +|----------|------|-------------| +| **secrets** | [ProviderConfigPropertiesSecrets](#providerconfigpropertiessecrets) | Sensitive data in provider configuration can be stored as secrets. The secrets are stored in Applications.Core/SecretStores resource. | +#### Additional Properties + +* **Additional Properties Type**: any + +### ProviderConfigPropertiesSecrets + +#### Properties + * **none** #### Additional Properties -* **Additional Properties Type**: any +* **Additional Properties Type**: [SecretReference](#secretreference) ### EnvironmentPropertiesRecipes From d5c5e91cdb76433fcf5ec4c6d7f825005eb56f0b Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Thu, 25 Jul 2024 09:34:19 -0700 Subject: [PATCH 03/10] Add HowTo tutorial to configure Terraform Custom Provider (#1162) * add howto doc for tf custom provider config * unsaved files * update per comments * update for conflicts * extra space * extra space * further comments * capitalizing Environment * one more change --------- Signed-off-by: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> --- .github/config/en-custom.txt | 4 + .../terraform/howto-custom-provider/index.md | 87 ++++++++++++++++++ .../snippets/env-complete.bicep | 72 +++++++++++++++ .../howto-custom-provider/snippets/env.bicep | 63 +++++++++++++ .../snippets/postgres.tf | 89 +++++++++++++++++++ 5 files changed, 315 insertions(+) create mode 100644 docs/content/guides/recipes/terraform/howto-custom-provider/index.md create mode 100644 docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep create mode 100644 docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep create mode 100644 docs/content/guides/recipes/terraform/howto-custom-provider/snippets/postgres.tf diff --git a/.github/config/en-custom.txt b/.github/config/en-custom.txt index de9820ad8..79552ae2a 100644 --- a/.github/config/en-custom.txt +++ b/.github/config/en-custom.txt @@ -1253,3 +1253,7 @@ envSecrets RecipeConfigPropertiesEnvSecrets ProviderConfigPropertiesSecrets SecretReference +cyrilgdn +secretStore +postgreSQL +postgres \ No newline at end of file diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/index.md b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md new file mode 100644 index 000000000..b14e2ee32 --- /dev/null +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md @@ -0,0 +1,87 @@ +--- +type: docs +title: "How-To: Configure custom Terraform Providers" +linkTitle: "Custom Terraform Providers" +description: "Learn how to setup your Radius Environment with custom Terraform Providers and deploy Recipes." +weight: 500 +categories: "How-To" +aliases : ["/guides/recipes/terraform/howto-custom-provider"] +tags: ["recipes", "terraform"] +--- + +This how-to guide will describe how to: + +- Configure a custom [Terraform provider](https://registry.terraform.io/browse/providers) in a Radius Environment. +- Configure credentials to authenticate into the Terraform provider. +- Consume the Terraform modules from a custom Terraform provider and use it in a Terraform recipe. + +In this example you're going to configure a [PostgreSQL Terraform provider](https://registry.terraform.io/providers/cyrilgdn/postgresql/latest/docs) in a Radius Environment and deploy a Recipe. + +### Prerequisites + +Before you get started, you'll need to make sure you have the following tools and resources: + +- [rad CLI]({{< ref "installation#step-1-install-the-rad-cli" >}}) +- [Radius Bicep VSCode extension]({{< ref "installation#step-2-install-the-vs-code-extension" >}}) +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +- [Radius initialized with `rad init`]({{< ref howto-environment >}}) +- [Recipes overview]({{< ref "/guides/recipes/overview" >}}) + +## Step 1: Define a secretStore resource for the custom provider + +Configure a [Radius Secret Store]({{< ref "/guides/author-apps/secrets/overview" >}}) with any sensitive information needed as input configuration for the custom Terraform Provider. Define the namespace for the cluster that will contain your [Kubernetes Secret](https://kubernetes.io/docs/concepts/configuration/secret/) with the `resource` property. + +> While this example shows a Radius-managed secret store where Radius creates the underlying secrets infrastructure, you can also bring your own existing secrets. Refer to the [secrets documentation]({{< ref "/guides/author-apps/secrets/overview" >}}) for more information. + +Create a Bicep file `env.bicep` with the secretStore resource: + +{{< rad file="snippets/env.bicep" embed=true marker="//SECRETSTORE" >}} + +> In this example, you're creating a secret with keys `username` and `password` as sensitive data required to authenticate into the Terraform Provider `cyrilgdn/postgresql`. + +## Step 2: Configure Terraform Provider + +`recipeConfig/terraform/providers` allows you to setup configurations for one or multiple Terraform Providers. For more information refer to the [Radius Environment schema]({{< ref environment-schema >}}) page. + +In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages properties from the previously defined secret store. In this example you're also passing in `host` as an environment variable to highlight use cases where, depending on provider configuration requirements, users can pass environment variables to the Terraform recipes runtime. + +{{< rad file="snippets/env.bicep" embed=true marker="//ENV" >}} + +## Step 3: Define a Terraform Recipe + +Create a Terraform recipe which deploys a PostgreSQL database instance using custom Terraform provider `cyrilgdn/postgresql`. + +{{< rad file="snippets/postgres.tf" embed=true marker="//ENV" >}} + +## Step 4: Add a Terraform Recipe to the Environment + +Update your Environment with the Terraform Recipe. + +{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"22-30\"],linenostart=30,lineNos=false}" >}} + +## Step 5: Deploy your Radius Environment + +Deploy your new Radius Environment passing in values for `username` and `password` needed to authenticate into the provider. The superuser for this PostgreSQL Recipe is `postgres` which is the expected input for `username`: + +```bash +rad deploy ./env.bicep -p username=****** -p password=****** +``` + +## Done + +Your Radius Environment is now configured with a custom Terraform Provider which you can use to deploy Radius Terraform Recipes. For more information on Radius Recipes visit the [Recipes overview page]({{< ref "/guides/recipes/overview" >}}). + +## Cleanup + +You can delete the Radius Environment by running the following command: + +```bash +rad env delete my-env +``` + +## Further reading + +- [Recipes overview]({{< ref "/guides/recipes/overview" >}}) +- [Radius Environments]({{< ref "/guides/deploy-apps/environments/overview" >}}) +- [`rad recipe CLI reference`]({{< ref rad_recipe >}}) +- [`rad env CLI reference`]({{< ref rad_env >}}) \ No newline at end of file diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep new file mode 100644 index 000000000..d66f62bd2 --- /dev/null +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep @@ -0,0 +1,72 @@ +//SECRETSTORE +import radius as radius + +@description('username for postgres db') +@secure() +param username string + +@description('password for postgres db') +@secure() +param password string + +resource pgsSecretStore 'Applications.Core/secretStores@2023-10-01-preview' = { + name: 'my-secret-store' + properties: { + resource: 'my-secret-namespace/my-secret-store' + type: 'generic' + data: { + username: { + value: username + } + password: { + value: password + } + } + } +} +//SECRETSTORE + +//ENV +resource env 'Applications.Core/environments@2023-10-01-preview' = { + name: 'my-env' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'my-namespace' + } + recipeConfig: { + terraform: { + providers: { + postgresql: [ { + sslmode: 'disable' + port: 5432 + secrets: { + username: { + source: pgsSecretStore.id + key: username + } + password: { + source: pgsSecretStore.id + key: password + } + } + } ] + } + } + env: { + PGHOST: 'postgres.corerp-resources-terraform-pg-app.svc.cluster.local' + } + } + recipes: { + 'Applications.Core/extenders': { + defaultpostgres: { + templateKind: 'terraform' + // Recipe template path + templatePath: 'git::https://github.com/my-org/my-repo' + } + } + } + } +} +//ENV diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep new file mode 100644 index 000000000..bfc672312 --- /dev/null +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep @@ -0,0 +1,63 @@ +//SECRETSTORE +import radius as radius + +@description('username for PostgreSQL db') +@secure() +param username string + +@description('password for PostgreSQL db') +@secure() +param password string + +resource pgsSecretStore 'Applications.Core/secretStores@2023-10-01-preview' = { + name: 'my-secret-store' + properties: { + resource: 'my-secret-namespace/my-secret-store' + type: 'generic' + data: { + username: { + value: username + } + password: { + value: password + } + } + } +} +//SECRETSTORE + +//ENV +resource env 'Applications.Core/environments@2023-10-01-preview' = { + name: 'my-env' + properties: { + compute: { + kind: 'kubernetes' + resourceId: 'self' + namespace: 'my-namespace' + } + recipeConfig: { + terraform: { + providers: { + postgresql: [ { + sslmode: 'disable' + port: 5432 + secrets: { + username: { + source: pgsSecretStore.id + key: username + } + password: { + source: pgsSecretStore.id + key: password + } + } + } ] + } + } + env: { + PGHOST: 'postgres.corerp-resources-terraform-pg-app.svc.cluster.local' + } + } + } +} +//ENV diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/postgres.tf b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/postgres.tf new file mode 100644 index 000000000..422147ba0 --- /dev/null +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/postgres.tf @@ -0,0 +1,89 @@ +terraform { + required_providers { + kubernetes = { + source = "hashicorp/kubernetes" + version = ">= 2.0" + } + postgresql = { + source = "cyrilgdn/postgresql" + version = "1.16.0" + } + } +} + +variable "context" { + description = "This variable contains Radius recipe context." + type = any +} + +variable "password" { + description = "The password for the PostgreSQL database" + type = string +} + +resource "kubernetes_deployment" "postgres" { + metadata { + name = "postgres" + namespace = var.context.runtime.kubernetes.namespace + } + + spec { + selector { + match_labels = { + app = "postgres" + } + } + + template { + metadata { + labels = { + app = "postgres" + } + } + + spec { + container { + image = "postgres:latest" + name = "postgres" + + env { + name = "POSTGRES_PASSWORD" + value = var.password + } + + port { + container_port = 5432 + } + } + } + } + } +} + +resource "kubernetes_service" "postgres" { + metadata { + name = "postgres" + namespace = var.context.runtime.kubernetes.namespace + } + + spec { + selector = { + app = "postgres" + } + + port { + port = 5432 + target_port = 5432 + } + } +} + +resource "time_sleep" "wait_20_seconds" { + depends_on = [kubernetes_service.postgres] + create_duration = "20s" +} + +resource "postgresql_database" "pg_db_test" { + depends_on = [time_sleep.wait_20_seconds] + name = "pg_db_test" +} From 6bab371ea908fb02b5e393ef3ebf35d61e295e06 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Thu, 25 Jul 2024 11:01:37 -0700 Subject: [PATCH 04/10] correct highlight (#1164) --- .../guides/recipes/terraform/howto-custom-provider/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/index.md b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md index b14e2ee32..bcfc35c7a 100644 --- a/docs/content/guides/recipes/terraform/howto-custom-provider/index.md +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md @@ -57,7 +57,7 @@ Create a Terraform recipe which deploys a PostgreSQL database instance using cus Update your Environment with the Terraform Recipe. -{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"22-30\"],linenostart=30,lineNos=false}" >}} +{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"32-40\"],linenostart=30,lineNos=false}" >}} ## Step 5: Deploy your Radius Environment From 32f01ea0a1455e8ff2b2b36c446c46f9cffac808 Mon Sep 17 00:00:00 2001 From: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> Date: Thu, 25 Jul 2024 16:24:55 -0400 Subject: [PATCH 05/10] Update index.md (#1160) Signed-off-by: Reshma Abdul Rahim <61033581+Reshrahim@users.noreply.github.com> --- docs/content/tutorials/tutorial-dapr/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/tutorials/tutorial-dapr/index.md b/docs/content/tutorials/tutorial-dapr/index.md index fedb7020e..37962f7e5 100644 --- a/docs/content/tutorials/tutorial-dapr/index.md +++ b/docs/content/tutorials/tutorial-dapr/index.md @@ -14,7 +14,7 @@ This tutorial will teach you the following about Dapr: - How to use Radius to deploy a Dapr microservices sample application for an online shop - How [Dapr and Radius]({{< ref "guides/author-apps/dapr" >}}) seamlessly work together -For more details on the app and access to the source code, visit the `tutorials/dapr` directory in the [samples repo](https://github.com/radius-project/samples). +For more details on the app and access to the source code, visit the `samples/dapr` directory in the [samples repo](https://github.com/radius-project/samples). ## Prerequisites From f0b840fd79618adc45326e7e85307b8f345f2250 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:37:12 -0700 Subject: [PATCH 06/10] Add envSecrets block to HowTo Custom Provider tutorial (#1166) * adding envSecrets * updated per suggestion --- .../recipes/terraform/howto-custom-provider/index.md | 4 ++-- .../snippets/env-complete.bicep | 12 ++++++++++-- .../howto-custom-provider/snippets/env.bicep | 11 ++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/index.md b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md index bcfc35c7a..2835a24f4 100644 --- a/docs/content/guides/recipes/terraform/howto-custom-provider/index.md +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/index.md @@ -43,7 +43,7 @@ Create a Bicep file `env.bicep` with the secretStore resource: `recipeConfig/terraform/providers` allows you to setup configurations for one or multiple Terraform Providers. For more information refer to the [Radius Environment schema]({{< ref environment-schema >}}) page. -In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages properties from the previously defined secret store. In this example you're also passing in `host` as an environment variable to highlight use cases where, depending on provider configuration requirements, users can pass environment variables to the Terraform recipes runtime. +In your `env.bicep` file add an Environment resource, along with Recipe configuration which leverages properties from the previously defined secret store. In this example you're also passing in `host` and `port` as environment variables to highlight use cases where, depending on provider configuration requirements, users can pass environment variables as plain text and as secret values in `envSecrets` block to the Terraform recipes runtime. {{< rad file="snippets/env.bicep" embed=true marker="//ENV" >}} @@ -57,7 +57,7 @@ Create a Terraform recipe which deploys a PostgreSQL database instance using cus Update your Environment with the Terraform Recipe. -{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"32-40\"],linenostart=30,lineNos=false}" >}} +{{< rad file="snippets/env-complete.bicep" embed=true marker="//ENV" markdownConfig="{linenos=table,hl_lines=[\"37-45\"],linenostart=30,lineNos=false}" >}} ## Step 5: Deploy your Radius Environment diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep index d66f62bd2..5d163c92c 100644 --- a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env-complete.bicep @@ -21,6 +21,9 @@ resource pgsSecretStore 'Applications.Core/secretStores@2023-10-01-preview' = { password: { value: password } + host: { + value: 'my-postgres-host' + } } } } @@ -40,7 +43,6 @@ resource env 'Applications.Core/environments@2023-10-01-preview' = { providers: { postgresql: [ { sslmode: 'disable' - port: 5432 secrets: { username: { source: pgsSecretStore.id @@ -55,7 +57,13 @@ resource env 'Applications.Core/environments@2023-10-01-preview' = { } } env: { - PGHOST: 'postgres.corerp-resources-terraform-pg-app.svc.cluster.local' + PGPORT: '5432' + } + envSecrets: { + PGHOST: { + source: pgsSecretStore.id + key: 'host' + } } } recipes: { diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep index bfc672312..85c999efe 100644 --- a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep @@ -21,6 +21,9 @@ resource pgsSecretStore 'Applications.Core/secretStores@2023-10-01-preview' = { password: { value: password } + host: { + value: 'my-postgres-host' + } } } } @@ -55,7 +58,13 @@ resource env 'Applications.Core/environments@2023-10-01-preview' = { } } env: { - PGHOST: 'postgres.corerp-resources-terraform-pg-app.svc.cluster.local' + PGPORT: '5432' + } + envSecrets: { + PGHOST: { + source: pgsSecretStore.id + key: 'host' + } } } } From 84f9f6e183e58c8fe666564796672cbd0271d1a1 Mon Sep 17 00:00:00 2001 From: Lakshmi Javadekar <103459615+lakshmimsft@users.noreply.github.com> Date: Mon, 29 Jul 2024 09:31:08 -0700 Subject: [PATCH 07/10] removing port input in config (#1167) --- .../recipes/terraform/howto-custom-provider/snippets/env.bicep | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep index 85c999efe..baa2814bd 100644 --- a/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep +++ b/docs/content/guides/recipes/terraform/howto-custom-provider/snippets/env.bicep @@ -43,7 +43,6 @@ resource env 'Applications.Core/environments@2023-10-01-preview' = { providers: { postgresql: [ { sslmode: 'disable' - port: 5432 secrets: { username: { source: pgsSecretStore.id From 3f751f6d093f6ebe48788509139fb1dd412884f1 Mon Sep 17 00:00:00 2001 From: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> Date: Wed, 14 Aug 2024 15:40:32 -0700 Subject: [PATCH 08/10] Fix upmerge workflow error when no changes (#1192) Signed-off-by: Brooke Hamilton <45323234+brooke-hamilton@users.noreply.github.com> --- .github/workflows/upmerge.yaml | 56 ++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/.github/workflows/upmerge.yaml b/.github/workflows/upmerge.yaml index 397b8aaa3..69e1cd82b 100644 --- a/.github/workflows/upmerge.yaml +++ b/.github/workflows/upmerge.yaml @@ -1,3 +1,27 @@ +# This workflow automates the process of upmerging changes from the current release branch to the edge branch. +# During the course of a release, the release branch is the default branch so that PRs can be immediately +# brought into the release without waiting for a new release. This workflow merges those changes into +# the edge branch so that edge can be used as the basis for the next release branch. +# +# This workflow assumes that it is being triggered from the current release branch, but it could be triggered from +# any branch, and it uses that branch as the source branch for merging into the edge branch. +# The workflow is triggered manually via the workflow_dispatch event. +# +# The workflow performs the following steps: +# 1. Checks out the edge branch. +# 2. Configures git with a user name and email. +# 3. Creates a new branch from edge. +# 4. Merges changes from the branch executing the workflow into the edge branch created in the previous step. +# 5. Pushes the new branch if there are changes. +# 6. Creates a pull request to merge the new branch into edge. + +# Example: +# The current release branch is v0.36. We are creating the new release for v0.37. +# The release person manually triggers this workflow from branch v0.36. The workflow runs, which does the following +# 1. A new branch is created named upmerge/2024-07-31-98b9. The source branch is edge. +# 2. Changes from branch v0.36 are merged into branch upmerge/2024-07-31-98b9. +# 3. A PR is created from branch upmerge/2024-07-31-98b9 --> edge. The workflow finishes and reports success. + name: Upmerge docs to edge on: @@ -8,31 +32,51 @@ jobs: name: Upmerge docs to edge runs-on: ubuntu-latest steps: + + # Checkout the edge branch - uses: actions/checkout@v4 with: ref: edge # https://github.com/actions/checkout/issues/125#issuecomment-570254411 fetch-depth: 0 + - name: Configure git run: | git config --global user.email "radiuscoreteam@service.microsoft.com" git config --global user.name "Radius CI Bot" + + # Create a new branch from edge. This branch will be used to PR back into edge. - name: Create new branch run: | export DATE=$(date +%Y-%m-%d) export RAND=$(openssl rand -hex 2) - echo "BRANCH_NAME=upmerge/$DATE-$RAND" >> $GITHUB_ENV - git checkout -b upmerge/$DATE-$RAND + export BRANCH_NAME=upmerge/$DATE-$RAND + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV + git checkout -b $BRANCH_NAME + + # Merge changes from the github.ref branch, i.e., the branch from which the workflow is triggered. That + # branch is assumed to be the current release branch, but could be any branch. + # If there are no changes, stop the workflow. - name: Upmerge docs run: | export SOURCE_BRANCH=$(basename ${{ github.ref }}) echo "Upmerging docs from $SOURCE_BRANCH to edge" git fetch origin $SOURCE_BRANCH - git merge --no-commit origin/$SOURCE_BRANCH - git reset HEAD docs/config.toml docs/layouts/partials/hooks/body-end.html - git commit -m "Upmerge to edge" - git push --set-upstream origin $BRANCH_NAME + + git merge -m "Upmerge to edge" origin/$SOURCE_BRANCH + + if git diff --quiet edge; then + echo "No changes to merge from $SOURCE_BRANCH to edge" + echo "NO_CHANGES=true" >> $GITHUB_ENV + else + echo "Pushing $BRANCH_NAME for PR to edge" + git reset HEAD docs/config.toml docs/layouts/partials/hooks/body-end.html + git push --set-upstream origin $BRANCH_NAME + fi + + # Create a PR from the new branch to edge - name: Create pull request + if: env.NO_CHANGES != 'true' env: GITHUB_TOKEN: ${{ secrets.GH_RAD_CI_BOT_PAT}} run: gh pr create --title "Upmerge to edge" --body "Upmerge to edge (kicked off by @${{ github.triggering_actor }})" --base edge --head $BRANCH_NAME From 353a007ec7c86614d133a82cfef9ca3f8d915805 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath Date: Fri, 16 Aug 2024 11:32:18 -0700 Subject: [PATCH 09/10] addressing comments Signed-off-by: Vishwanath Hiremath --- docs/config.toml | 8 ++++---- docs/layouts/partials/hooks/body-end.html | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/config.toml b/docs/config.toml index 877bac454..01ff03b9f 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -1,4 +1,4 @@ -baseURL = "https://docs.radapp.io/" +baseURL = "https://edge.docs.radapp.io/" languageCode = "en-us" title = "Radius Docs" theme = "docsy" @@ -67,9 +67,9 @@ tag = "tags" [params] copyright = "The Radius Authors. The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see the https://linuxfoundation.org/trademark-usage/ page." -version = "v0.36" +version = "edge" tag_version = "latest" -chart_version = "0.36.0" +chart_version = "0.26.0" # Algolia Search algolia_docsearch = true @@ -77,7 +77,7 @@ algolia_docsearch = true # GitHub Information github_repo = "https://github.com/radius-project/docs" github_subdir = "docs" -github_branch = "v0.36" +github_branch = "edge" github_project_repo = "https://github.com/radius-project/radius" # Versioning diff --git a/docs/layouts/partials/hooks/body-end.html b/docs/layouts/partials/hooks/body-end.html index f640ff308..2e4551ab3 100644 --- a/docs/layouts/partials/hooks/body-end.html +++ b/docs/layouts/partials/hooks/body-end.html @@ -5,9 +5,9 @@ container: '#docsearch', appId: 'ED67NSVSZS', apiKey: '21e2920c3a9c29b98cbc382694413f29', - indexName: 'radapp-dev', + indexName: 'radapp-dev-edge', }); {{ end }} - + \ No newline at end of file From e89cab642ac839640cec716f971c611ef8f7e9e2 Mon Sep 17 00:00:00 2001 From: Vishwanath Hiremath Date: Fri, 16 Aug 2024 11:33:05 -0700 Subject: [PATCH 10/10] addressing comments Signed-off-by: Vishwanath Hiremath --- docs/layouts/partials/hooks/body-end.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/layouts/partials/hooks/body-end.html b/docs/layouts/partials/hooks/body-end.html index 2e4551ab3..3f4109e18 100644 --- a/docs/layouts/partials/hooks/body-end.html +++ b/docs/layouts/partials/hooks/body-end.html @@ -10,4 +10,4 @@ {{ end }} - \ No newline at end of file +