2021-05-07 15:27:08 +03:00
|
|
|
{
|
2022-02-18 16:38:34 +03:00
|
|
|
"name": "AzureTRE",
|
2023-07-10 16:35:03 +03:00
|
|
|
// Uncomment when debugging using Jetbrains
|
|
|
|
// "features": {
|
|
|
|
// "ghcr.io/devcontainers/features/sshd:1": {
|
|
|
|
// "version": "latest"
|
|
|
|
// }
|
|
|
|
// },
|
2022-02-18 16:38:34 +03:00
|
|
|
"build": {
|
|
|
|
"context": "..",
|
|
|
|
"dockerfile": "Dockerfile",
|
|
|
|
"args": {
|
|
|
|
// To ensure that the group ID for the docker group in the container
|
|
|
|
// matches the group ID on the host, add this to your .bash_profile on the host
|
|
|
|
// export DOCKER_GROUP_ID=$(getent group docker | awk -F ":" '{ print $3 }')
|
2022-04-11 23:31:06 +03:00
|
|
|
"DOCKER_GROUP_ID": "${localEnv:DOCKER_GROUP_ID}",
|
|
|
|
"INTERACTIVE": "true"
|
2022-02-18 16:38:34 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"runArgs": [
|
|
|
|
"--network",
|
|
|
|
"host"
|
|
|
|
],
|
|
|
|
"mounts": [
|
|
|
|
// Keep command history
|
|
|
|
"type=volume,source=tre-bashhistory,target=/home/vscode/commandhistory",
|
|
|
|
// Mounts the login details from the host machine to azcli works in the container
|
|
|
|
"type=bind,source=${env:HOME}${env:USERPROFILE}/.azure,target=/home/vscode/.azure",
|
|
|
|
// Mount docker socket for docker builds
|
2022-12-26 16:14:53 +03:00
|
|
|
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock",
|
|
|
|
// Mounts the github cli login details from the host machine to the container (~/.config/gh/hosts.yml)
|
|
|
|
"type=bind,source=${env:HOME}${env:USERPROFILE}/.config,target=/home/vscode/.config",
|
2022-02-18 16:38:34 +03:00
|
|
|
],
|
|
|
|
"remoteUser": "vscode",
|
2022-03-31 12:38:17 +03:00
|
|
|
"containerEnv": {
|
2022-05-24 02:15:13 +03:00
|
|
|
"DOCKER_BUILDKIT": "1"
|
2022-03-31 12:38:17 +03:00
|
|
|
},
|
2022-03-30 14:53:17 +03:00
|
|
|
"remoteEnv": {
|
|
|
|
// this is used for SuperLinter
|
2022-05-24 02:15:13 +03:00
|
|
|
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
|
2022-03-30 14:53:17 +03:00
|
|
|
},
|
2023-02-27 19:56:52 +03:00
|
|
|
"customizations": {
|
|
|
|
"vscode": {
|
|
|
|
// Set *default* container specific settings.json values on container create.
|
|
|
|
"settings": {
|
|
|
|
"terminal.integrated.defaultProfile.linux": "bash",
|
|
|
|
"python.pythonPath": "/usr/local/bin/python",
|
|
|
|
"python.linting.enabled": true,
|
|
|
|
"python.linting.pylintEnabled": false,
|
|
|
|
"python.linting.flake8Enabled": true,
|
|
|
|
"python.formatting.provider": "black",
|
|
|
|
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
|
|
|
|
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
|
|
|
|
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
|
|
|
|
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
|
|
|
|
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
|
|
|
|
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
|
|
|
|
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
|
|
|
|
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
|
|
|
|
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint",
|
|
|
|
"python.testing.unittestEnabled": false,
|
|
|
|
"python.testing.pytestEnabled": true,
|
|
|
|
"python.testing.pytestArgs": [
|
2023-08-03 17:44:38 +03:00
|
|
|
"--ignore=e2e_tests",
|
|
|
|
"-W ignore::DeprecationWarning"
|
2023-02-27 19:56:52 +03:00
|
|
|
],
|
2023-08-03 17:44:38 +03:00
|
|
|
"python.testing.cwd": "${workspaceFolder}",
|
2023-02-27 19:56:52 +03:00
|
|
|
"files.associations": {
|
|
|
|
"*.terraform": "terraform"
|
2022-02-18 16:38:34 +03:00
|
|
|
},
|
2023-02-27 19:56:52 +03:00
|
|
|
"launch": {
|
|
|
|
"configurations": [
|
|
|
|
{
|
|
|
|
"name": "TRE API",
|
|
|
|
"type": "python",
|
|
|
|
"module": "uvicorn",
|
|
|
|
"request": "launch",
|
|
|
|
"args": [
|
|
|
|
"main:app",
|
|
|
|
"--reload",
|
|
|
|
"--host",
|
|
|
|
"::",
|
|
|
|
"--port",
|
|
|
|
"8000"
|
|
|
|
],
|
|
|
|
"jinja": true,
|
|
|
|
"justMyCode": false,
|
|
|
|
"console": "integratedTerminal",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_api_debug",
|
2023-09-04 12:30:43 +03:00
|
|
|
"cwd": "${workspaceFolder}/api_app",
|
2023-12-07 19:12:25 +03:00
|
|
|
"envFile": "${workspaceFolder}/api_app/.env",
|
|
|
|
"env": {
|
|
|
|
"OTEL_RESOURCE_ATTRIBUTES": "service.name=api,service.instance.id=local_debug,service.version=dev"
|
|
|
|
}
|
2023-02-27 19:56:52 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Extended",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"extended",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Extended AAD",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"extended_aad",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Shared Services",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"shared_services",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Performance",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"performance",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Smoke",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"smoke",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "E2E Airlock",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"module": "pytest",
|
|
|
|
"justMyCode": true,
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/",
|
|
|
|
"preLaunchTask": "Copy_env_file_for_e2e_debug",
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"airlock",
|
|
|
|
"--verify",
|
|
|
|
"false"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Resource Processor",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"program": "vmss_porter/runner.py",
|
|
|
|
"console": "integratedTerminal",
|
|
|
|
"preLaunchTask": "Install_resource_processor_dependencies",
|
|
|
|
"cwd": "${workspaceFolder}/resource_processor",
|
|
|
|
"envFile": "${workspaceFolder}/core/private.env",
|
|
|
|
"env": {
|
2023-12-07 19:12:25 +03:00
|
|
|
"PYTHONPATH": ".",
|
|
|
|
"OTEL_RESOURCE_ATTRIBUTES": "service.name=resource_processor,service.instance.id=local_debug,service.version=dev"
|
|
|
|
},
|
|
|
|
"justMyCode": false
|
2023-02-27 19:56:52 +03:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Debug Python file",
|
|
|
|
"type": "python",
|
|
|
|
"request": "launch",
|
|
|
|
"program": "${file}",
|
|
|
|
"console": "integratedTerminal",
|
|
|
|
"purpose": [
|
|
|
|
"debug-test"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Launch Edge (localhost)",
|
|
|
|
"type": "pwa-msedge",
|
|
|
|
"request": "launch",
|
|
|
|
"url": "http://localhost:3000",
|
|
|
|
"webRoot": "${workspaceFolder}/ui/app"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "Launch Chrome (localhost)",
|
|
|
|
"type": "pwa-chrome",
|
|
|
|
"request": "launch",
|
|
|
|
"url": "http://localhost:3000",
|
|
|
|
"webRoot": "${workspaceFolder}/ui/app"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"compounds": []
|
2022-02-18 16:38:34 +03:00
|
|
|
},
|
2023-02-27 19:56:52 +03:00
|
|
|
"tasks": {
|
|
|
|
"version": "2.0.0",
|
|
|
|
"tasks": [
|
|
|
|
{
|
|
|
|
"label": "Copy_env_file_for_api_debug",
|
|
|
|
"command": "./.devcontainer/scripts/consolidate_env.sh ${workspaceFolder} ${workspaceFolder}/api_app/.env",
|
|
|
|
"type": "shell"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Copy_env_file_for_e2e_debug",
|
|
|
|
"command": "./.devcontainer/scripts/consolidate_env.sh ${workspaceFolder} ${workspaceFolder}/e2e_tests/.env",
|
|
|
|
"type": "shell"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Install_resource_processor_dependencies",
|
|
|
|
"command": "pip install -r ./resource_processor/vmss_porter/requirements.txt",
|
|
|
|
"type": "shell"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Unit_tests",
|
|
|
|
"group": {
|
|
|
|
"kind": "test",
|
|
|
|
"isDefault": true
|
|
|
|
},
|
|
|
|
"command": "pytest",
|
|
|
|
"args": [
|
|
|
|
"--ignore=e2e_tests"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"label": "Smoke_tests",
|
|
|
|
"group": "test",
|
|
|
|
"command": "python",
|
|
|
|
"options": {
|
|
|
|
"cwd": "${workspaceFolder}/e2e_tests/"
|
|
|
|
},
|
|
|
|
"args": [
|
|
|
|
"-m",
|
|
|
|
"pytest",
|
|
|
|
"-m",
|
|
|
|
"smoke"
|
|
|
|
]
|
|
|
|
}
|
2022-02-18 16:38:34 +03:00
|
|
|
]
|
|
|
|
}
|
2023-02-27 19:56:52 +03:00
|
|
|
},
|
|
|
|
// Add the IDs of extensions you want installed when the container is created.
|
|
|
|
"extensions": [
|
|
|
|
"ms-python.python",
|
|
|
|
"ms-python.pylance",
|
|
|
|
"hashicorp.terraform",
|
|
|
|
"github.vscode-pull-request-github",
|
|
|
|
"getporter.porter-vscode",
|
|
|
|
"davidanson.vscode-markdownlint",
|
|
|
|
"editorconfig.editorconfig",
|
|
|
|
"mikestead.dotenv",
|
|
|
|
"humao.rest-client",
|
|
|
|
"timonwong.shellcheck",
|
|
|
|
"ms-azuretools.vscode-azurefunctions"
|
2022-02-18 16:38:34 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"forwardPorts": [
|
|
|
|
8000
|
2022-03-08 03:54:16 +03:00
|
|
|
],
|
2022-11-17 17:57:46 +03:00
|
|
|
// Run commands after the container is created.
|
2022-10-07 11:35:19 +03:00
|
|
|
"postCreateCommand": "./.devcontainer/scripts/post-create.sh"
|
2021-09-05 12:14:56 +03:00
|
|
|
}
|