Skip to content

Commit

Permalink
Support Gov cloud in CI/CD (#3366)
Browse files Browse the repository at this point in the history
* fix typos

* use az cloud show to get AZ_CLOUD_ENVIRONMENT

* set TRE_URL and AZ_CLOUD_ENVIRONMENT in action.yml

* add AZURE_ENVIRONMENT to ci/cd - it's required for az login

* set cloud for CI in check_dependencies.sh

* remove hardcoded acr name from CI-CD + fix TRE_URL

* fix ACR domain suffix

* fix ACR_DOMAIN_SUFFIX not being evaluated lazily

* change acr_name assignment

* add  AZURE_ENVIRONMENT to the docs

* remove OmsAgentForLinux extension

* pass arm_environment as terraform var

* Add private links

* Support for vm

* Upgrade versions and services

* rename AZ_CLOUD_ENVIRONMENT to AZURE_ENVIRONMENT

* Fix terraform formatting

* Source module from modules repository

* Fix terraform format

* Temorary Disable versioning for module

* Remove arm env

* CR changes

* Fix lint issues

* Install git in devcontainer

* Remove from vm unused var

* Fix lint issues

* Install git in devcontainer

* remove duplicate git installation

* add default value to AZURE_ENVIRONMENT in CI

* update AZURE_ENVIRONMENT in ci/cd docs

* fix azure_env default assignment

* update core version

* fix tf lint errors by removing unused vars

* fix linting error in deploy_tre_reusable

* fix linting errors in deploy_tre_reusable

* fix linting errors in deploy_tre_reusable

---------

Co-authored-by: LizaShak <iliza@outlook.com>
  • Loading branch information
yuvalyaron and LizaShak committed Apr 3, 2023
1 parent e2ce6d8 commit 909721b
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 53 deletions.
35 changes: 33 additions & 2 deletions .github/actions/devcontainer_run_command/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
AZURE_CREDENTIALS:
description: "Credentials to access Azure."
required: true
AZURE_ENVIRONMENT:
description: "Azure Cloud Environment"
default: "AzureCloud"
required: false
API_CLIENT_ID:
description: "The API Client Id."
required: false
Expand Down Expand Up @@ -126,13 +130,37 @@ runs:
if: contains(inputs.COMMAND, 'bootstrap') != true
with:
creds: ${{ inputs.AZURE_CREDENTIALS }}
environment: ${{ (inputs.AZURE_ENVIRONMENT != '' && inputs.AZURE_ENVIRONMENT) || 'AzureCloud' }}

- name: ACR Login
shell: bash
if: contains(inputs.COMMAND, 'bootstrap') != true
run: |
az acr login --name "${{ inputs.CI_CACHE_ACR_NAME }}"
- name: Construct TRE_URL
shell: bash
run: |
declare -A cloudapp_endpoint_suffixes=( ["AzureCloud"]="cloudapp.azure.com" ["AzureUSGovernment"]="cloudapp.usgovcloudapi.net")
azure_env="${{ (inputs.AZURE_ENVIRONMENT != '' && inputs.AZURE_ENVIRONMENT) || 'AzureCloud' }}"
domain=${cloudapp_endpoint_suffixes[${azure_env}]}
tre_id="${{ inputs.TRE_ID }}"
location="${{ inputs.LOCATION }}"
tre_url=${TRE_URL:-https://${tre_id}.${location}.${domain}}
echo "TRE_URL=$tre_url" >> $GITHUB_ENV
- name: Construct ARM_ENVIRONMENT
shell: bash
run: |
declare -A arm_envs=( ["AzureCloud"]="public" ["AzureUSGovernment"]="usgovernment")
azure_env="${{ (inputs.AZURE_ENVIRONMENT != '' && inputs.AZURE_ENVIRONMENT) || 'AzureCloud' }}"
echo "ARM_ENVIRONMENT=${arm_envs[${azure_env}]}" >> $GITHUB_ENV
- name: Construct ACR Domain Suffix
shell: bash
run: |
echo "ACR_DOMAIN_SUFFIX=$(az cloud show --query suffixes.acrLoginServerEndpoint --output tsv)" >> $GITHUB_ENV
- name: Run command in DevContainer
shell: bash
run: |
Expand All @@ -146,6 +174,9 @@ runs:
-e USE_ENV_VARS_NOT_FILES="true" \
-e BUNDLE_TYPE="${{ inputs.BUNDLE_TYPE }}" \
-e WORKSPACE_SERVICE_NAME="${{ inputs.WORKSPACE_SERVICE_NAME }}" \
-e ARM_ENVIRONMENT="${{ env.ARM_ENVIRONMENT }}" \
-e TF_VAR_arm_environment="${{ env.ARM_ENVIRONMENT }}" \
-e AZURE_ENVIRONMENT="${{ (inputs.AZURE_ENVIRONMENT != '' && inputs.AZURE_ENVIRONMENT) || 'AzureCloud' }}" \
-e LOCATION="${{ inputs.LOCATION }}" \
-e TF_VAR_location="${{ inputs.LOCATION }}" \
-e RESOURCE_LOCATION="${{ inputs.LOCATION }}" \
Expand Down Expand Up @@ -175,7 +206,7 @@ runs:
-e AAD_TENANT_ID="${{ inputs.AAD_TENANT_ID }}" \
-e TRE_ID="${{ inputs.TRE_ID }}" \
-e TF_VAR_tre_id="${{ inputs.TRE_ID }}" \
-e TRE_URL="https://${{inputs.TRE_ID}}.${{inputs.LOCATION}}.cloudapp.azure.com" \
-e TRE_URL="${{ env.TRE_URL }}" \
-e TEST_WORKSPACE_APP_ID="${{ inputs.TEST_WORKSPACE_APP_ID }}" \
-e TEST_WORKSPACE_APP_SECRET="${{ inputs.TEST_WORKSPACE_APP_SECRET }}" \
-e TEST_APP_ID="${{ inputs.TEST_APP_ID }}" \
Expand All @@ -194,5 +225,5 @@ runs:
-e TF_VAR_resource_processor_number_processes_per_instance="${{ (inputs.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE != ''
&& inputs.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE) || 5 }}" \
-e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \
'${{ inputs.CI_CACHE_ACR_NAME }}.azurecr.io/tredev:${{ inputs.DEVCONTAINER_TAG }}' \
'${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \
bash -c "${{ inputs.COMMAND }}"
1 change: 1 addition & 0 deletions .github/workflows/clean_validation_envs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ (secrets.AZURE_ENVIRONMENT != '' && secrets.AZURE_ENVIRONMENT) || 'AzureCloud' }}

- name: Run clean
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/cli-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
DEVCONTAINER_TAG: latest
CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}

- name: Create the CLI package
uses: ./.github/actions/devcontainer_run_command
Expand All @@ -46,6 +47,7 @@ jobs:
DEVCONTAINER_TAG: latest
CI_CACHE_ACR_NAME: ${{ secrets.ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}

- name: Upload Wheel as artifact
uses: actions/upload-artifact@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_tre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
ACR_NAME: ${{ secrets.ACR_NAME }}
DEVCONTAINER_TAG: 'latest'
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
API_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }}
APPLICATION_ADMIN_CLIENT_ID: ${{ secrets.APPLICATION_ADMIN_CLIENT_ID }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy_tre_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
ACR_NAME: ${{ format('tre{0}', needs.prepare-not-main.outputs.refid) }}
DEVCONTAINER_TAG: ${{ needs.prepare-not-main.outputs.refid }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
API_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }}
APPLICATION_ADMIN_CLIENT_ID: ${{ secrets.APPLICATION_ADMIN_CLIENT_ID }}
Expand Down
30 changes: 25 additions & 5 deletions .github/workflows/deploy_tre_reusable.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Deploy Azure TRE Resuable
name: Deploy Azure TRE Reusable

on: # yamllint disable-line rule:truthy
workflow_call:
Expand Down Expand Up @@ -107,6 +107,9 @@ on: # yamllint disable-line rule:truthy
AZURE_CREDENTIALS:
description: ""
required: true
AZURE_ENVIRONMENT:
description: ""
required: true
CORE_APP_SERVICE_PLAN_SKU:
description: ""
required: false
Expand Down Expand Up @@ -140,7 +143,7 @@ jobs:
echo "environment : ${{ inputs.environmentName }}"
- name: Check required secrets
# since this is a resuable workflow, required=true secrets will always have a value but it can be empty.
# since this is a reusable workflow, required=true secrets will always have a value but it can be empty.
run: |
if [ "${{ secrets.AAD_TENANT_ID }}" == '' ]; then
echo "Missing secret: AAD_TENANT_ID" && exit 1
Expand Down Expand Up @@ -228,6 +231,7 @@ jobs:
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ (secrets.AZURE_ENVIRONMENT != '' && secrets.AZURE_ENVIRONMENT) || 'AzureCloud' }}

- name: ACR Login
id: ci_cache_cr_login
Expand All @@ -243,7 +247,8 @@ jobs:
USER_UID=$(id -u)
USER_GID=$(id -g)
CI_CACHE_ACR_URI=${{ secrets.CI_CACHE_ACR_NAME }}.azurecr.io
acr_domain_suffix=$(az cloud show --query suffixes.acrLoginServerEndpoint --output tsv)
CI_CACHE_ACR_URI=${{ secrets.CI_CACHE_ACR_NAME }}${acr_domain_suffix}
echo "CI_CACHE_ACR_URI=$CI_CACHE_ACR_URI" >> "$GITHUB_ENV"
docker_cache=()
Expand All @@ -256,8 +261,8 @@ jobs:
-t "tredev:${{ secrets.DEVCONTAINER_TAG }}" -f ".devcontainer/Dockerfile" \
--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg USER_UID="${USER_UID}" --build-arg USER_GID="${USER_GID}"
docker image tag tredev:${{ secrets.DEVCONTAINER_TAG }} \
$CI_CACHE_ACR_URI/tredev:${{ secrets.DEVCONTAINER_TAG }}
docker image tag tredev:"${{ secrets.DEVCONTAINER_TAG }}" \
"$CI_CACHE_ACR_URI/tredev:${{ secrets.DEVCONTAINER_TAG }}"
- name: Deploy management
uses: ./.github/actions/devcontainer_run_command
Expand All @@ -266,6 +271,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
TRE_ID: "${{ secrets.TRE_ID }}"
LOCATION: ${{ secrets.LOCATION }}
ACR_NAME: ${{ secrets.ACR_NAME }}
Expand Down Expand Up @@ -314,6 +320,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
ACR_NAME: ${{ secrets.ACR_NAME }}

start_tre:
Expand All @@ -337,6 +344,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
TRE_ID: "${{ secrets.TRE_ID }}"

deploy_tre:
Expand All @@ -360,6 +368,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
TRE_ID: "${{ secrets.TRE_ID }}"
Expand Down Expand Up @@ -387,6 +396,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
TRE_ID: "${{ secrets.TRE_ID }}"
LOCATION: ${{ secrets.LOCATION }}

Expand Down Expand Up @@ -442,6 +452,7 @@ jobs:
&& ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
ACR_NAME: ${{ secrets.ACR_NAME }}

Expand Down Expand Up @@ -485,6 +496,7 @@ jobs:
&& ec=0 && break || ec=\$? && sleep 30; done; (exit \$ec)
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
ACR_NAME: ${{ secrets.ACR_NAME }}

Expand Down Expand Up @@ -527,6 +539,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
ACR_NAME: ${{ secrets.ACR_NAME }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
Expand Down Expand Up @@ -582,6 +595,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
ACR_NAME: ${{ secrets.ACR_NAME }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
Expand Down Expand Up @@ -630,6 +644,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
ACR_NAME: ${{ secrets.ACR_NAME }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
Expand Down Expand Up @@ -662,6 +677,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
TEST_APP_ID: "${{ secrets.TEST_APP_ID }}"
Expand All @@ -677,6 +693,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
TEST_APP_ID: "${{ secrets.TEST_APP_ID }}"
Expand Down Expand Up @@ -708,6 +725,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
TRE_ID: "${{ secrets.TRE_ID }}"
Expand Down Expand Up @@ -739,6 +757,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
LOCATION: "${{ secrets.LOCATION }}"
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
Expand Down Expand Up @@ -781,6 +800,7 @@ jobs:
DEVCONTAINER_TAG: ${{ secrets.DEVCONTAINER_TAG }}
CI_CACHE_ACR_NAME: ${{ secrets.CI_CACHE_ACR_NAME}}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
LOCATION: "${{ secrets.LOCATION }}"
API_CLIENT_ID: "${{ secrets.API_CLIENT_ID }}"
AAD_TENANT_ID: "${{ secrets.AAD_TENANT_ID }}"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pr_comment_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ (secrets.AZURE_ENVIRONMENT != '' && secrets.AZURE_ENVIRONMENT) || 'AzureCloud' }}

- name: Run deployment cleanup
env:
Expand Down Expand Up @@ -115,6 +116,7 @@ jobs:
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
environment: ${{ (secrets.AZURE_ENVIRONMENT != '' && secrets.AZURE_ENVIRONMENT) || 'AzureCloud' }}

- name: Run deployment cleanup
env:
Expand Down Expand Up @@ -156,6 +158,7 @@ jobs:
ACR_NAME: ${{ format('tre{0}', needs.pr_comment.outputs.prRefId) }}
DEVCONTAINER_TAG: ${{ needs.pr_comment.outputs.prRefId }}
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS}}
AZURE_ENVIRONMENT: ${{ secrets.AZURE_ENVIRONMENT }}
API_CLIENT_ID: ${{ secrets.API_CLIENT_ID }}
API_CLIENT_SECRET: ${{ secrets.API_CLIENT_SECRET }}
APPLICATION_ADMIN_CLIENT_ID: ${{ secrets.APPLICATION_ADMIN_CLIENT_ID }}
Expand Down
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ SHELL:=/bin/bash
MAKEFILE_FULLPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
MAKEFILE_DIR := $(dir $(MAKEFILE_FULLPATH))
IMAGE_NAME_PREFIX?="microsoft/azuretre"
ACR_DOMAIN_SUFFIX := $(shell az cloud show --query suffixes.acrLoginServerEndpoint --output tsv)
ACR_FQDN?="$${ACR_NAME}${ACR_DOMAIN_SUFFIX}"
FULL_IMAGE_NAME_PREFIX:=`echo "${ACR_FQDN}/${IMAGE_NAME_PREFIX}" | tr A-Z a-z`
ACR_DOMAIN_SUFFIX?=`az cloud show --query suffixes.acrLoginServerEndpoint --output tsv`
ACR_NAME?=`echo "$${ACR_NAME}" | tr A-Z a-z`
ACR_FQDN?="${ACR_NAME}${ACR_DOMAIN_SUFFIX}"
FULL_IMAGE_NAME_PREFIX:=${ACR_FQDN}/${IMAGE_NAME_PREFIX}
LINTER_REGEX_INCLUDE?=all # regular expression used to specify which files to include in local linting (defaults to "all")
E2E_TESTS_NUMBER_PROCESSES_DEFAULT=4 # can be overridden in e2e_tests/.env

Expand Down Expand Up @@ -52,7 +53,7 @@ $(call target_title, "Building $(1) Image") \
&& . ${MAKEFILE_DIR}/devops/scripts/check_dependencies.sh env \
&& . ${MAKEFILE_DIR}/devops/scripts/set_docker_sock_permission.sh \
&& source <(grep = $(2) | sed 's/ *= */=/g') \
&& az acr login -n $${ACR_NAME} \
&& az acr login -n ${ACR_NAME} \
&& if [ -n "$${CI_CACHE_ACR_NAME:-}" ]; then \
az acr login -n $${CI_CACHE_ACR_NAME}; \
ci_cache="--cache-from $${CI_CACHE_ACR_NAME}${ACR_DOMAIN_SUFFIX}/${IMAGE_NAME_PREFIX}/$(1):$${__version__}"; fi \
Expand All @@ -78,7 +79,7 @@ $(call target_title, "Pushing $(1) Image") \
&& . ${MAKEFILE_DIR}/devops/scripts/check_dependencies.sh env \
&& . ${MAKEFILE_DIR}/devops/scripts/set_docker_sock_permission.sh \
&& source <(grep = $(2) | sed 's/ *= */=/g') \
&& az acr login -n $${ACR_NAME} \
&& az acr login -n ${ACR_NAME} \
&& docker push "${FULL_IMAGE_NAME_PREFIX}/$(1):$${__version__}"
endef

Expand Down Expand Up @@ -251,7 +252,7 @@ bundle-publish:
$(call target_title, "Publishing ${DIR} bundle with Porter") \
&& . ${MAKEFILE_DIR}/devops/scripts/check_dependencies.sh porter,env \
&& . ${MAKEFILE_DIR}/devops/scripts/set_docker_sock_permission.sh \
&& az acr login --name $${ACR_NAME} \
&& az acr login --name ${ACR_NAME} \
&& cd ${DIR} \
&& FULL_IMAGE_NAME_PREFIX=${FULL_IMAGE_NAME_PREFIX} \
${MAKEFILE_DIR}/devops/scripts/bundle_runtime_image_push.sh \
Expand All @@ -261,10 +262,10 @@ bundle-register:
@# NOTE: ACR_NAME below comes from the env files, so needs the double '$$'. Others are set on command execution and don't
$(call target_title, "Registering ${DIR} bundle") \
&& . ${MAKEFILE_DIR}/devops/scripts/check_dependencies.sh porter,env \
&& az acr login --name $${ACR_NAME} \
&& az acr login --name ${ACR_NAME} \
&& ${MAKEFILE_DIR}/devops/scripts/ensure_cli_signed_in.sh $${TRE_URL} \
&& cd ${DIR} \
&& ${MAKEFILE_DIR}/devops/scripts/register_bundle_with_api.sh --acr-name "$${ACR_NAME}" --bundle-type "$${BUNDLE_TYPE}" \
&& ${MAKEFILE_DIR}/devops/scripts/register_bundle_with_api.sh --acr-name "${ACR_NAME}" --bundle-type "$${BUNDLE_TYPE}" \
--current --verify \
--workspace-service-name "$${WORKSPACE_SERVICE_NAME}"

Expand Down
2 changes: 1 addition & 1 deletion config.sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ tre:
# The TRE Web UI is deployed by default.
# Uncomment the following to disable deployment of the Web UI.
# deploy_ui: false
# If you want to use TRE_URL to point to your local TRE API instance or be configured to another cloud provider???
# 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__

Expand Down
8 changes: 0 additions & 8 deletions core/terraform/azure-monitor/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,3 @@ output "log_analytics_workspace_id" {
output "log_analytics_workspace_name" {
value = azurerm_log_analytics_workspace.core.name
}

output "log_analytics_workspace_primary_key" {
value = azurerm_log_analytics_workspace.core.primary_shared_key
}

output "log_analytics_workspace_workspace_id" {
value = azurerm_log_analytics_workspace.core.workspace_id
}
2 changes: 0 additions & 2 deletions core/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,6 @@ module "resource_processor_vmss_porter" {
resource_processor_number_processes_per_instance = var.resource_processor_number_processes_per_instance
resource_processor_vmss_sku = var.resource_processor_vmss_sku
arm_environment = var.arm_environment
log_analytics_workspace_workspace_id = module.azure_monitor.log_analytics_workspace_workspace_id
log_analytics_workspace_primary_key = module.azure_monitor.log_analytics_workspace_primary_key
rp_bundle_values = var.rp_bundle_values

depends_on = [
Expand Down
Loading

0 comments on commit 909721b

Please sign in to comment.