Skip to content

Commit 921be3d

Browse files
author
Tim Allen
authored
Merge branch 'main' into marrobi/azuread-autogen
2 parents 53ed8af + 9e49ed6 commit 921be3d

File tree

610 files changed

+15174
-8424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

610 files changed

+15174
-8424
lines changed

.devcontainer/Dockerfile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ FROM --platform="${TARGETPLATFORM}" mcr.microsoft.com/vscode/devcontainers/pytho
88
# This will be set to true when running in VSCode
99
ARG INTERACTIVE="false"
1010

11-
ARG USERNAME=vscode
1211
ARG USER_UID=1000
13-
ARG USER_GID=$USER_UID
12+
ARG USERNAME=vscode
1413

15-
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
14+
# make user ID match user ID on host machine
15+
RUN usermod --uid $USER_UID $USERNAME
1616

17-
# Set up non-root user
18-
COPY .devcontainer/scripts/non-root-user.sh /tmp/
19-
RUN bash /tmp/non-root-user.sh "${USERNAME}" "${USER_UID}" "${USER_GID}"
17+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
2018

2119
# Set env for tracking that we're running in a devcontainer
2220
ENV DEVCONTAINER=true
@@ -26,7 +24,7 @@ ARG NODE_VERSION="lts/*"
2624
RUN su $USERNAME -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"
2725

2826
# Install terraform
29-
ARG TERRAFORM_VERSION="1.3.6"
27+
ARG TERRAFORM_VERSION="1.4.5"
3028
COPY .devcontainer/scripts/terraform.sh /tmp/
3129
RUN bash /tmp/terraform.sh "${TERRAFORM_VERSION}" /usr/bin
3230

@@ -39,7 +37,7 @@ RUN apt-get update && apt-get install -y ca-certificates curl gnupg lsb-release
3937
&& curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
4038
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
4139
| tee /etc/apt/sources.list.d/docker.list > /dev/null \
42-
&& apt-get update && apt-get install -y docker-ce="5:20.10.21~3-0~debian-bullseye" docker-ce-cli="5:20.10.21~3-0~debian-bullseye" containerd.io="1.6.12-1" --no-install-recommends \
40+
&& apt-get update && apt-get install -y docker-ce="5:24.0.0-1~debian.11~bullseye" docker-ce-cli="5:24.0.0-1~debian.11~bullseye" docker-compose-plugin="2.21.0-1~debian.11~bullseye" containerd.io="1.6.24-1" docker-buildx-plugin --no-install-recommends \
4341
&& apt-get clean -y && rm -rf /var/lib/apt/lists/*
4442

4543
# Install Certbot
@@ -50,13 +48,11 @@ RUN if [ "${INTERACTIVE}" = "true" ]; then \
5048
&& /opt/certbot/bin/pip install --no-cache-dir certbot \
5149
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* ; fi
5250

53-
# can't be in a non default path
54-
# ARG PORTER_HOME_V1=/home/$USERNAME/.porter-v1/
5551
ARG PORTER_HOME_V1=/home/$USERNAME/.porter/
56-
ARG PORTER_VERSION=v1.0.8
57-
ARG PORTER_TERRAFORM_MIXIN_VERSION=v1.0.1
58-
ARG PORTER_AZ_MIXIN_VERSION=v1.0.0
59-
ARG PORTER_AZURE_PLUGIN_VERSION=v1.1.0
52+
ARG PORTER_VERSION=v1.0.15
53+
ARG PORTER_TERRAFORM_MIXIN_VERSION=v1.0.2
54+
ARG PORTER_AZ_MIXIN_VERSION=v1.0.1
55+
ARG PORTER_AZURE_PLUGIN_VERSION=v1.2.0
6056
COPY .devcontainer/scripts/porter-v1.sh /tmp/
6157
RUN export PORTER_VERSION=${PORTER_VERSION} \
6258
PORTER_TERRAFORM_MIXIN_VERSION=${PORTER_TERRAFORM_MIXIN_VERSION} \
@@ -68,6 +64,8 @@ RUN export PORTER_VERSION=${PORTER_VERSION} \
6864
ENV PATH ${PORTER_HOME_V1}:$PATH
6965

7066
# Install requirements
67+
ARG PIP_VERSION=23.3.1
68+
RUN pip3 --no-cache-dir install pip==${PIP_VERSION} && pip3 config set global.disable-pip-version-check true
7169
COPY ["requirements.txt", "/tmp/pip-tmp/" ]
7270
COPY ["api_app/requirements.txt", "api_app/requirements-dev.txt", "/tmp/pip-tmp/api_app/" ]
7371
COPY ["resource_processor/vmss_porter/requirements.txt", "/tmp/pip-tmp/resource_processor/vmss_porter/" ]
@@ -77,18 +75,23 @@ COPY ["airlock_processor/requirements.txt", "/tmp/pip-tmp/airlock_processor/"]
7775
RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt
7876

7977
# Install azure-cli
80-
ARG AZURE_CLI_VERSION=2.37.0-1~bullseye
78+
ARG AZURE_CLI_VERSION=2.57.0-1~bullseye
8179
COPY .devcontainer/scripts/azure-cli.sh /tmp/
8280
RUN export AZURE_CLI_VERSION=${AZURE_CLI_VERSION} \
8381
&& /tmp/azure-cli.sh
8482

85-
ARG YQ_VERSION="v4.30.6"
83+
ARG YQ_VERSION="v4.33.3"
8684
RUN curl -L --fail -o /usr/local/bin/yq "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" \
8785
&& chmod +x /usr/local/bin/yq
8886

8987
ARG PAJV_VERSION="1.2.0"
9088
RUN npm install -g pajv@${PAJV_VERSION}
9189

90+
# Install git - required for terraform's git modules
91+
RUN if [ "${INTERACTIVE}" = "false" ]; then \
92+
apt-get update && apt-get install --no-install-recommends -y git \
93+
&& apt-get clean -y && rm -rf /var/lib/apt/lists/* ; fi
94+
9295
USER $USERNAME
9396

9497
# Save command line history

.devcontainer/devcontainer.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"name": "AzureTRE",
3+
// Uncomment when debugging using Jetbrains
4+
// "features": {
5+
// "ghcr.io/devcontainers/features/sshd:1": {
6+
// "version": "latest"
7+
// }
8+
// },
39
"build": {
410
"context": "..",
511
"dockerfile": "Dockerfile",
@@ -55,8 +61,10 @@
5561
"python.testing.unittestEnabled": false,
5662
"python.testing.pytestEnabled": true,
5763
"python.testing.pytestArgs": [
58-
"api_app"
64+
"--ignore=e2e_tests",
65+
"-W ignore::DeprecationWarning"
5966
],
67+
"python.testing.cwd": "${workspaceFolder}",
6068
"files.associations": {
6169
"*.terraform": "terraform"
6270
},
@@ -79,7 +87,11 @@
7987
"justMyCode": false,
8088
"console": "integratedTerminal",
8189
"preLaunchTask": "Copy_env_file_for_api_debug",
82-
"cwd": "${workspaceFolder}/api_app"
90+
"cwd": "${workspaceFolder}/api_app",
91+
"envFile": "${workspaceFolder}/api_app/.env",
92+
"env": {
93+
"OTEL_RESOURCE_ATTRIBUTES": "service.name=api,service.instance.id=local_debug,service.version=dev"
94+
}
8395
},
8496
{
8597
"name": "E2E Extended",
@@ -181,8 +193,10 @@
181193
"cwd": "${workspaceFolder}/resource_processor",
182194
"envFile": "${workspaceFolder}/core/private.env",
183195
"env": {
184-
"PYTHONPATH": "."
185-
}
196+
"PYTHONPATH": ".",
197+
"OTEL_RESOURCE_ATTRIBUTES": "service.name=resource_processor,service.instance.id=local_debug,service.version=dev"
198+
},
199+
"justMyCode": false
186200
},
187201
{
188202
"name": "Debug Python file",

.devcontainer/scripts/non-root-user.sh

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ A clear and concise description of what the bug is.
1717
1.
1818
1.
1919
1.
20+
21+
**Azure TRE release version (e.g. v0.14.0 or main):**
22+
23+
**Deployed Azure TRE components - click the (i) in the UI:**

.github/actions/devcontainer_run_command/action.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ inputs:
1111
AZURE_CREDENTIALS:
1212
description: "Credentials to access Azure."
1313
required: true
14+
AZURE_ENVIRONMENT:
15+
description: "Azure Cloud Environment"
16+
default: "AzureCloud"
17+
required: false
1418
API_CLIENT_ID:
1519
description: "The API Client Id."
1620
required: false
@@ -123,22 +127,56 @@ inputs:
123127
description: "JSON string containing key/value pairs to injet into the Resource Processor as ENV vars"
124128
required: false
125129
default: ""
130+
KV_PURGE_PROTECTION_ENABLED:
131+
description: "A boolean indicating if the purge protection will be enabled on the core keyvault."
132+
required: false
133+
default: "true"
134+
FIREWALL_SKU:
135+
description: "Firewall SKU"
136+
required: false
137+
default: ""
126138

127139
runs:
128140
using: composite
129141
steps:
142+
- name: Construct AZURE_ENVIRONMENT
143+
shell: bash
144+
run: |
145+
azure_env="${{ (inputs.AZURE_ENVIRONMENT != '' && inputs.AZURE_ENVIRONMENT) || 'AzureCloud' }}"
146+
echo "AZURE_ENVIRONMENT=$azure_env" >> $GITHUB_ENV
147+
130148
- name: Azure Login
131-
uses: azure/login@v1
149+
uses: azure/login@v2
132150
if: contains(inputs.COMMAND, 'bootstrap') != true
133151
with:
134152
creds: ${{ inputs.AZURE_CREDENTIALS }}
153+
environment: "${{ env.AZURE_ENVIRONMENT }}"
135154

136155
- name: ACR Login
137156
shell: bash
138157
if: contains(inputs.COMMAND, 'bootstrap') != true
139158
run: |
140159
az acr login --name "${{ inputs.CI_CACHE_ACR_NAME }}"
141160
161+
- name: Construct TRE_URL
162+
shell: bash
163+
run: |
164+
source devops/scripts/construct_tre_url.sh
165+
tre_url=$(construct_tre_url "${{ inputs.TRE_ID }}" "${{ inputs.LOCATION }}" "${{ env.AZURE_ENVIRONMENT }}")
166+
echo "TRE_URL=$tre_url" >> $GITHUB_ENV
167+
168+
- name: Construct ARM_ENVIRONMENT
169+
shell: bash
170+
run: |
171+
source devops/scripts/convert_azure_env_to_arm_env.sh
172+
arm_environment=$(convert_azure_env_to_arm_env "${{ env.AZURE_ENVIRONMENT }}")
173+
echo "ARM_ENVIRONMENT=$arm_environment" >> $GITHUB_ENV
174+
175+
- name: Construct ACR Domain Suffix
176+
shell: bash
177+
run: |
178+
echo "ACR_DOMAIN_SUFFIX=$(az cloud show --query suffixes.acrLoginServerEndpoint --output tsv)" >> $GITHUB_ENV
179+
142180
- name: Run command in DevContainer
143181
shell: bash
144182
run: |
@@ -152,6 +190,9 @@ runs:
152190
-e USE_ENV_VARS_NOT_FILES="true" \
153191
-e BUNDLE_TYPE="${{ inputs.BUNDLE_TYPE }}" \
154192
-e WORKSPACE_SERVICE_NAME="${{ inputs.WORKSPACE_SERVICE_NAME }}" \
193+
-e ARM_ENVIRONMENT="${{ env.ARM_ENVIRONMENT }}" \
194+
-e TF_VAR_arm_environment="${{ env.ARM_ENVIRONMENT }}" \
195+
-e AZURE_ENVIRONMENT="${{ env.AZURE_ENVIRONMENT }}" \
155196
-e LOCATION="${{ inputs.LOCATION }}" \
156197
-e TF_VAR_location="${{ inputs.LOCATION }}" \
157198
-e RESOURCE_LOCATION="${{ inputs.LOCATION }}" \
@@ -177,13 +218,15 @@ runs:
177218
&& inputs.ENABLE_SWAGGER) || 'false' }}" \
178219
-e SWAGGER_UI_CLIENT_ID="${{ inputs.SWAGGER_UI_CLIENT_ID }}" \
179220
-e TF_VAR_swagger_ui_client_id="${{ inputs.SWAGGER_UI_CLIENT_ID }}" \
180-
-e TF_VAR_core_address_space="${{ inputs.core_address_space }}" \
181-
-e TF_VAR_tre_address_space="${{ inputs.tre_address_space }}" \
221+
-e TF_VAR_core_address_space="${{ (inputs.CORE_ADDRESS_SPACE != ''
222+
&& inputs.CORE_ADDRESS_SPACE) || '10.0.0.0/22' }}" \
223+
-e TF_VAR_tre_address_space="${{ (inputs.TRE_ADDRESS_SPACE != ''
224+
&& inputs.TRE_ADDRESS_SPACE) || '10.0.0.0/16' }}" \
182225
-e API_CLIENT_ID="${{ inputs.API_CLIENT_ID }}" \
183226
-e AAD_TENANT_ID="${{ inputs.AAD_TENANT_ID }}" \
184227
-e TRE_ID="${{ inputs.TRE_ID }}" \
185228
-e TF_VAR_tre_id="${{ inputs.TRE_ID }}" \
186-
-e TRE_URL="https://${{inputs.TRE_ID}}.${{inputs.LOCATION}}.cloudapp.azure.com" \
229+
-e TRE_URL="${{ env.TRE_URL }}" \
187230
-e TEST_WORKSPACE_APP_ID="${{ inputs.TEST_WORKSPACE_APP_ID }}" \
188231
-e TEST_WORKSPACE_APP_SECRET="${{ inputs.TEST_WORKSPACE_APP_SECRET }}" \
189232
-e TEST_APP_ID="${{ inputs.TEST_APP_ID }}" \
@@ -192,15 +235,18 @@ runs:
192235
-e IS_API_SECURED=${{ inputs.IS_API_SECURED }} \
193236
-e DOCKER_BUILDKIT=1 \
194237
-e TF_VAR_stateful_resources_locked=${{ inputs.STATEFUL_RESOURCES_LOCKED }} \
238+
-e TF_VAR_kv_purge_protection_enabled="${{ inputs.KV_PURGE_PROTECTION_ENABLED }}" \
195239
-e TF_VAR_enable_airlock_malware_scanning=${{ inputs.ENABLE_AIRLOCK_MALWARE_SCANNING }} \
196240
-e CI_CACHE_ACR_NAME="${{ inputs.CI_CACHE_ACR_NAME }}" \
197241
-e TF_VAR_core_app_service_plan_sku="${{ (inputs.CORE_APP_SERVICE_PLAN_SKU != ''
198242
&& inputs.CORE_APP_SERVICE_PLAN_SKU) || 'P1v2' }}" \
199243
-e WORKSPACE_APP_SERVICE_PLAN_SKU="${{ (inputs.WORKSPACE_APP_SERVICE_PLAN_SKU != ''
200244
&& inputs.WORKSPACE_APP_SERVICE_PLAN_SKU) || 'P1v2' }}" \
201-
-e TF_VAR_rp_bundle_values='${{ inputs.RP_BUNDLE_VALUES }}' \
245+
-e TF_VAR_rp_bundle_values='${{ (toJson(inputs.RP_BUNDLE_VALUES) != '""'
246+
&& inputs.RP_BUNDLE_VALUES) || '{}' }}' \
202247
-e TF_VAR_resource_processor_number_processes_per_instance="${{ (inputs.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE != ''
203-
&& inputs.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE) || 5 }}" \
248+
&& inputs.RESOURCE_PROCESSOR_NUMBER_PROCESSES_PER_INSTANCE) || 5 }}" \
249+
-e TF_VAR_firewall_sku=${{ inputs.FIREWALL_SKU }} \
204250
-e E2E_TESTS_NUMBER_PROCESSES="${{ inputs.E2E_TESTS_NUMBER_PROCESSES }}" \
205-
'${{ inputs.CI_CACHE_ACR_NAME }}.azurecr.io/tredev:${{ inputs.DEVCONTAINER_TAG }}' \
251+
'${{ inputs.CI_CACHE_ACR_NAME }}${{ env.ACR_DOMAIN_SUFFIX }}/tredev:${{ inputs.DEVCONTAINER_TAG }}' \
206252
bash -c "${{ inputs.COMMAND }}"

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ updates:
99
ignore:
1010
- dependency-name: "*"
1111
update-types: ["version-update:semver-patch"]
12+
open-pull-requests-limit: 0
1213

1314
- package-ecosystem: "npm"
1415
directory: "/ui/app"
@@ -17,6 +18,7 @@ updates:
1718
ignore:
1819
- dependency-name: "*"
1920
update-types: ["version-update:semver-patch"]
21+
open-pull-requests-limit: 0
2022

2123
- package-ecosystem: "pip"
2224
directory: "/"
@@ -25,6 +27,7 @@ updates:
2527
ignore:
2628
- dependency-name: "*"
2729
update-types: ["version-update:semver-patch"]
30+
open-pull-requests-limit: 0
2831

2932
- package-ecosystem: "maven"
3033
directory: "/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure"
@@ -33,6 +36,7 @@ updates:
3336
ignore:
3437
- dependency-name: "*"
3538
update-types: ["version-update:semver-patch"]
39+
open-pull-requests-limit: 0
3640

3741
- package-ecosystem: "terraform"
3842
directory: "/devops/terraform"
@@ -41,6 +45,7 @@ updates:
4145
ignore:
4246
- dependency-name: "*"
4347
update-types: ["version-update:semver-patch"]
48+
open-pull-requests-limit: 0
4449

4550
- package-ecosystem: "terraform"
4651
directory: "/core/terraform"
@@ -49,3 +54,13 @@ updates:
4954
ignore:
5055
- dependency-name: "*"
5156
update-types: ["version-update:semver-patch"]
57+
open-pull-requests-limit: 0
58+
59+
- package-ecosystem: "docker"
60+
directory: "/"
61+
schedule:
62+
interval: "monthly"
63+
ignore:
64+
- dependency-name: "*"
65+
update-types: ["version-update:semver-patch"]
66+
open-pull-requests-limit: 0

0 commit comments

Comments
 (0)