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

tag inheritance solution fixed #215

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@ developer_settings:

# If you want to use TRE_URL to point to your local TRE API instance or be configured to another cloud provider
# uncomment and set this variable
# tre_url: __CHANGE_ME__
# tre_url: __CHANGE_ME__
19 changes: 19 additions & 0 deletions core/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions doit-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set -o errexit
set -o pipefail

export LETSENCRYPT_DROP_ALL_RULES=1

make bootstrap mgmt-deploy auth images \
deploy-core build-and-deploy-ui letsencrypt \
firewall-install db-migrate show-core-output



echo "Now Running ./only-the-good-bits.sh .... "
./only-the-good-bits.sh
echo "only-the-good-bits.sh is done Now running Make bundle publish register all.... "

make bundle-publish-register-all

echo "Hurrayyyyyyyyyy----- All done"
51 changes: 51 additions & 0 deletions only-the-good-bits.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash
set -o errexit
set -o pipefail

here=$(pwd)
targets="bundle-build bundle-publish bundle-register"
# targets="bundle-build bundle-publish"
# targets="bundle-build"

# templates/shared_services/certs
# templates/shared_services/firewall
# templates/shared_services/gitea
# templates/shared_services/sonatype-nexus-vm
for bundle in certs gitea sonatype-nexus-vm firewall
do
# shellcheck disable=SC2086
make ${targets} \
DIR="${here}/templates/shared_services/${bundle}" \
BUNDLE_TYPE=shared_service
done

# templates/workspaces/base
# shellcheck disable=SC2043
for bundle in base
do
# shellcheck disable=SC2086
make ${targets} \
DIR="${here}/templates/workspaces/${bundle}" \
BUNDLE_TYPE=workspace
done

# templates/workspace_services/guacamole
# shellcheck disable=SC2043
for bundle in guacamole
do
# shellcheck disable=SC2086
make ${targets} \
DIR="${here}/templates/workspace_services/${bundle}" \
BUNDLE_TYPE=workspace_service
done

for bundle in guacamole-azure-linuxvm guacamole-azure-windowsvm
do
# shellcheck disable=SC2086
make ${targets} \
DIR="${here}/templates/workspace_services/guacamole/user_resources/${bundle}" \
BUNDLE_TYPE=user_resource \
WORKSPACE_SERVICE_NAME=tre-service-guacamole
done

echo "Run ... make bundle-publish-register-all"
2 changes: 2 additions & 0 deletions templates/workspace_services/azureml/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"

}
}
2 changes: 1 addition & 1 deletion templates/workspace_services/azuresql/terraform/locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
locals {

core_resource_group_name = "rg-${var.tre_id}"

workspace_short_id = substr(var.workspace_id, -4, -1)
workspace_resource_name_suffix = "${var.tre_id}-ws-${local.workspace_short_id}"
workspace_resource_group_name = "rg-${local.workspace_resource_name_suffix}"
Expand Down Expand Up @@ -31,5 +30,6 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
}
1 change: 1 addition & 0 deletions templates/workspace_services/gitea/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
web_app_diagnostic_categories_enabled = [
"AppServiceHTTPLogs", "AppServiceConsoleLogs", "AppServiceAppLogs",
Expand Down
1 change: 1 addition & 0 deletions templates/workspace_services/guacamole/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
guacamole_diagnostic_categories_enabled = [
"AppServiceHTTPLogs", "AppServiceConsoleLogs", "AppServiceAppLogs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ locals {
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.parent_service_id
tre_user_resource_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"

}

# Load VM SKU/image details from porter.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ locals {
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.parent_service_id
tre_user_resource_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}

# Load VM SKU/image details from porter.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ locals {
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.parent_service_id
tre_user_resource_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
nexus_proxy_url = "https://nexus-${data.azurerm_public_ip.app_gateway_ip.fqdn}"
# Load VM SKU/image details from porter.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ locals {
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.parent_service_id
tre_user_resource_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
nexus_proxy_url = "https://nexus-${data.azurerm_public_ip.app_gateway_ip.fqdn}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
}
1 change: 1 addition & 0 deletions templates/workspace_services/innereye/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
}
1 change: 1 addition & 0 deletions templates/workspace_services/mlflow/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
web_app_diagnostic_categories_enabled = [
"AppServiceHTTPLogs", "AppServiceConsoleLogs", "AppServiceAppLogs",
Expand Down
1 change: 1 addition & 0 deletions templates/workspace_services/mysql/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}
}
1 change: 1 addition & 0 deletions templates/workspace_services/ohdsi/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ locals {
tre_id = var.tre_id
tre_workspace_id = var.workspace_id
tre_workspace_service_id = var.tre_resource_id
workspace = "${data.azurerm_resource_group.ws.tags["workspace"]}"
}

# Data Source configuration
Expand Down
6 changes: 6 additions & 0 deletions templates/workspaces/base-adf/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
"env": "MGMT_STORAGE_ACCOUNT_NAME"
}
},
{
"name": "display_name",
"source": {
"env": "DISPLAY_NAME"
}
},
{
"name": "shared_storage_quota",
"source": {
Expand Down
6 changes: 6 additions & 0 deletions templates/workspaces/base-adf/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ parameters:
- name: arm_use_msi
type: boolean
default: false
- name: display_name
type: string
description: "The display name for base workspace"
- name: shared_storage_quota
type: integer
default: 50
Expand Down Expand Up @@ -164,6 +167,7 @@ install:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down Expand Up @@ -208,6 +212,7 @@ upgrade:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down Expand Up @@ -276,6 +281,7 @@ uninstall:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down
5 changes: 5 additions & 0 deletions templates/workspaces/base-adf/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
],
"authorizedRoles": [],
"properties": {
"display_name": {
"type": "string",
"title": "Display Name",
"description": "Display name for Base Workspace."
},
"shared_storage_quota": {
"type": "integer",
"title": "Shared Storage Quota",
Expand Down
1 change: 1 addition & 0 deletions templates/workspaces/base-adf/terraform/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ locals {
tre_workspace_tags = {
tre_id = var.tre_id
tre_workspace_id = var.tre_resource_id
workspace = var.display_name
}
}
5 changes: 5 additions & 0 deletions templates/workspaces/base-adf/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ variable "tre_resource_id" {
description = "Resource ID"
}

variable "display_name" {
type = string
description = "Display name for Base Workspace."
}

variable "shared_storage_quota" {
type = number
default = 50
Expand Down
6 changes: 6 additions & 0 deletions templates/workspaces/base/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
"env": "MGMT_STORAGE_ACCOUNT_NAME"
}
},
{
"name": "display_name",
"source": {
"env": "DISPLAY_NAME"
}
},
{
"name": "shared_storage_quota",
"source": {
Expand Down
6 changes: 6 additions & 0 deletions templates/workspaces/base/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ parameters:
- name: arm_use_msi
type: boolean
default: false
- name: display_name
type: string
description: "The display name for base workspace"
- name: shared_storage_quota
type: integer
default: 50
Expand Down Expand Up @@ -164,6 +167,7 @@ install:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down Expand Up @@ -204,6 +208,7 @@ upgrade:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down Expand Up @@ -268,6 +273,7 @@ uninstall:
tre_resource_id: ${ bundle.parameters.id }
location: ${ bundle.parameters.azure_location }
address_spaces: ${ bundle.parameters.address_spaces }
display_name: ${ bundle.parameters.display_name }
shared_storage_quota: ${ bundle.parameters.shared_storage_quota }
enable_local_debugging: ${ bundle.parameters.enable_local_debugging }
register_aad_application: ${ bundle.parameters.register_aad_application }
Expand Down
5 changes: 5 additions & 0 deletions templates/workspaces/base/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
],
"authorizedRoles": [],
"properties": {
"display_name": {
"type": "string",
"title": "Display Name",
"description": "Display name for Base Workspace."
},
"shared_storage_quota": {
"type": "integer",
"title": "Shared Storage Quota",
Expand Down
2 changes: 2 additions & 0 deletions templates/workspaces/base/terraform/locals.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
locals {
short_workspace_id = substr(var.tre_resource_id, -4, -1)
tre_id = var.tre_id
workspace_resource_name_suffix = "${var.tre_id}-ws-${local.short_workspace_id}"
storage_name = lower(replace("stg${substr(local.workspace_resource_name_suffix, -8, -1)}", "-", ""))
keyvault_name = lower("kv-${substr(local.workspace_resource_name_suffix, -20, -1)}")
redacted_senstive_value = "REDACTED"
tre_workspace_tags = {
tre_id = var.tre_id
tre_workspace_id = var.tre_resource_id
workspace = var.display_name
}
}
4 changes: 4 additions & 0 deletions templates/workspaces/base/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ variable "tre_resource_id" {
type = string
description = "Resource ID"
}
variable "display_name" {
type = string
description = "Display name for Base Workspace."
}

variable "shared_storage_quota" {
type = number
Expand Down
6 changes: 6 additions & 0 deletions templates/workspaces/unrestricted/parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@
"env": "MGMT_STORAGE_ACCOUNT_NAME"
}
},
{
"name": "display_name",
"source": {
"env": "DISPLAY_NAME"
}
},
{
"name": "shared_storage_quota",
"source": {
Expand Down
Loading
Loading