From 6259d5264fe994dfc1a2689a6d0f32603f11110f Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 12:44:17 -0700 Subject: [PATCH 1/8] Update getting_started.md --- docs/getting_started.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 00ae2e6e..5146217f 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -36,7 +36,7 @@ The variable group should contain the following variables: | AML_COMPUTE_CLUSTER_CPU_SKU | STANDARD_DS2_V2 | | AML_COMPUTE_CLUSTER_NAME | train-cluster | | AML_WORKSPACE_NAME | mlops-AML-WS | -| BASE_NAME | mlops | +| BASE_NAME | mlops[unique part of the name] | | EVALUATE_SCRIPT_PATH | evaluate/evaluate_model.py | | EXPERIMENT_NAME | mlopspython | | LOCATION | centralus | @@ -52,6 +52,8 @@ The variable group should contain the following variables: Mark **SP_APP_SECRET** variable as a secret one. +**Note:** The BASE_NAME parameter is used throughout the solution for naming Azure resources. When the solution is used in a shared subscription, there can be naming collisions with resources that require unique names like azure blob storage and registry DNS naming. Make sure to give a unique value to the BASE_NAME variable (e.g. mlops_My_Project_Name), so that the created resources will have unique names (e.g. mlops_My_Project_Name-AML-RG, mlops_My_Project_Name-AML-WS, etc.). + Make sure to select the **Allow access to all pipelines** checkbox in the variable group configuration. Up until now you should have: From cf252e437ba18086ac61ab0775e244642f1cae5d Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 12:59:48 -0700 Subject: [PATCH 2/8] base name --- environment_setup/arm-templates/cloud-environment.json | 2 +- environment_setup/iac-create-environment.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment_setup/arm-templates/cloud-environment.json b/environment_setup/arm-templates/cloud-environment.json index e01471d7..3574b0a9 100644 --- a/environment_setup/arm-templates/cloud-environment.json +++ b/environment_setup/arm-templates/cloud-environment.json @@ -4,7 +4,7 @@ "parameters": { "baseName": { "type": "string", - "maxLength": 10, + "maxLength": 20, "minLength": 3, "metadata": { "description": "The base name to use as prefix to create all the resources." diff --git a/environment_setup/iac-create-environment.yml b/environment_setup/iac-create-environment.yml index 57e5a106..cd66faa8 100644 --- a/environment_setup/iac-create-environment.yml +++ b/environment_setup/iac-create-environment.yml @@ -18,7 +18,7 @@ steps: inputs: azureSubscription: 'AzureResourceConnection' action: 'Create Or Update Resource Group' - resourceGroupName: '$(RESOURCE_GROUP)' + resourceGroupName: $[concat(parameters('RESOURCE_GROUP'),'-AML-RG')] location: $(LOCATION) templateLocation: 'Linked artifact' csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/cloud-environment.json' From b83c9d17422d3426b07b06c6f5cbe8348eabc37d Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 13:02:44 -0700 Subject: [PATCH 3/8] base name --- environment_setup/iac-create-environment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment_setup/iac-create-environment.yml b/environment_setup/iac-create-environment.yml index cd66faa8..6c2495cb 100644 --- a/environment_setup/iac-create-environment.yml +++ b/environment_setup/iac-create-environment.yml @@ -18,7 +18,7 @@ steps: inputs: azureSubscription: 'AzureResourceConnection' action: 'Create Or Update Resource Group' - resourceGroupName: $[concat(parameters('RESOURCE_GROUP'),'-AML-RG')] + resourceGroupName: '$(BASE_NAME)-AML-RG' location: $(LOCATION) templateLocation: 'Linked artifact' csmFile: '$(Build.SourcesDirectory)/environment_setup/arm-templates/cloud-environment.json' From e199fe60e997dc25128bec03d3c8eedbec6061e8 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 13:55:24 -0700 Subject: [PATCH 4/8] Update getting_started.md --- docs/getting_started.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 5146217f..c0719737 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -35,14 +35,12 @@ The variable group should contain the following variables: | --------------------------- | ---------------------------- | | AML_COMPUTE_CLUSTER_CPU_SKU | STANDARD_DS2_V2 | | AML_COMPUTE_CLUSTER_NAME | train-cluster | -| AML_WORKSPACE_NAME | mlops-AML-WS | -| BASE_NAME | mlops[unique part of the name] | +| BASE_NAME | [unique base name] | | EVALUATE_SCRIPT_PATH | evaluate/evaluate_model.py | | EXPERIMENT_NAME | mlopspython | | LOCATION | centralus | | MODEL_NAME | sklearn_regression_model.pkl | | REGISTER_SCRIPT_PATH | register/register_model.py | -| RESOURCE_GROUP | mlops-AML-RG | | SOURCES_DIR_TRAIN | code | | SP_APP_ID | | | SP_APP_SECRET | | @@ -52,7 +50,7 @@ The variable group should contain the following variables: Mark **SP_APP_SECRET** variable as a secret one. -**Note:** The BASE_NAME parameter is used throughout the solution for naming Azure resources. When the solution is used in a shared subscription, there can be naming collisions with resources that require unique names like azure blob storage and registry DNS naming. Make sure to give a unique value to the BASE_NAME variable (e.g. mlops_My_Project_Name), so that the created resources will have unique names (e.g. mlops_My_Project_Name-AML-RG, mlops_My_Project_Name-AML-WS, etc.). +**Note:** The BASE_NAME parameter is used throughout the solution for naming Azure resources. When the solution is used in a shared subscription, there can be naming collisions with resources that require unique names like azure blob storage and registry DNS naming. Make sure to give a unique value to the BASE_NAME variable (e.g. MyUniqueML), so that the created resources will have unique names (e.g. MyUniqueML-AML-RG, MyUniqueML-AML-WS, etc.). The length of the BASE_NAME value should not exceed 10 charecters. Make sure to select the **Allow access to all pipelines** checkbox in the variable group configuration. From c5519064c31fe9f0be6b69e36281c42b8d620fc5 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 14:08:04 -0700 Subject: [PATCH 5/8] base name --- environment_setup/arm-templates/cloud-environment.json | 2 +- environment_setup/iac-remove-environment.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/environment_setup/arm-templates/cloud-environment.json b/environment_setup/arm-templates/cloud-environment.json index 3574b0a9..e01471d7 100644 --- a/environment_setup/arm-templates/cloud-environment.json +++ b/environment_setup/arm-templates/cloud-environment.json @@ -4,7 +4,7 @@ "parameters": { "baseName": { "type": "string", - "maxLength": 20, + "maxLength": 10, "minLength": 3, "metadata": { "description": "The base name to use as prefix to create all the resources." diff --git a/environment_setup/iac-remove-environment.yml b/environment_setup/iac-remove-environment.yml index 67626223..4ca8b04e 100644 --- a/environment_setup/iac-remove-environment.yml +++ b/environment_setup/iac-remove-environment.yml @@ -18,7 +18,7 @@ steps: inputs: azureSubscription: 'AzureResourceConnection' action: 'DeleteRG' - resourceGroupName: '$(RESOURCE_GROUP)' + resourceGroupName: '$(BASE_NAME)-AML-RG' location: $(LOCATION) displayName: 'Delete resources in Azure' From 44b244a50f98c606450208b5995ebb0fe04fbe78 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 14:10:44 -0700 Subject: [PATCH 6/8] base name --- tests/unit/code_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/code_test.py b/tests/unit/code_test.py index bcdf5e3e..b22b186c 100644 --- a/tests/unit/code_test.py +++ b/tests/unit/code_test.py @@ -7,8 +7,8 @@ # Just an example of a unit test against # a utility function common_scoring.next_saturday def test_get_workspace(): - workspace_name = os.environ.get("AML_WORKSPACE_NAME") - resource_group = os.environ.get("RESOURCE_GROUP") + workspace_name = os.environ.get("BASE_NAME")+"-AML-WS" + resource_group = os.environ.get("BASE_NAME")+"-AML-RG" subscription_id = os.environ.get("SUBSCRIPTION_ID") tenant_id = os.environ.get("TENANT_ID") app_id = os.environ.get("SP_APP_ID") From 16ae01bb55053723d9953da859888f85a240dec8 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 14:22:27 -0700 Subject: [PATCH 7/8] base name --- ml_service/pipelines/build_train_pipeline.py | 4 ++-- ml_service/util/create_scoring_image.py | 8 ++++---- ml_service/util/register_model.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ml_service/pipelines/build_train_pipeline.py b/ml_service/pipelines/build_train_pipeline.py index a294a1c0..df5dcdcc 100644 --- a/ml_service/pipelines/build_train_pipeline.py +++ b/ml_service/pipelines/build_train_pipeline.py @@ -15,8 +15,8 @@ def main(): load_dotenv() - workspace_name = os.environ.get("AML_WORKSPACE_NAME") - resource_group = os.environ.get("RESOURCE_GROUP") + workspace_name = os.environ.get("BASE_NAME")+"-AML-WS" + resource_group = os.environ.get("BASE_NAME")+"-AML-RG" subscription_id = os.environ.get("SUBSCRIPTION_ID") tenant_id = os.environ.get("TENANT_ID") app_id = os.environ.get("SP_APP_ID") diff --git a/ml_service/util/create_scoring_image.py b/ml_service/util/create_scoring_image.py index 8461fb45..08ae49b5 100644 --- a/ml_service/util/create_scoring_image.py +++ b/ml_service/util/create_scoring_image.py @@ -8,11 +8,11 @@ load_dotenv() TENANT_ID = os.environ.get('TENANT_ID') -APP_ID = os.environ.get('APP_ID') -APP_SECRET = os.environ.get('APP_SECRET') -WORKSPACE_NAME = os.environ.get('WORKSPACE_NAME') +APP_ID = os.environ.get('SP_APP_ID') +APP_SECRET = os.environ.get('SP_APP_SECRET') +WORKSPACE_NAME = os.environ.get("BASE_NAME")+"-AML-WS" SUBSCRIPTION_ID = os.environ.get('SUBSCRIPTION_ID') -RESOURCE_GROUP = os.environ.get('RESOURCE_GROUP') +RESOURCE_GROUP = os.environ.get("BASE_NAME")+"-AML-RG" MODEL_NAME = os.environ.get('MODEL_NAME') MODEL_VERSION = os.environ.get('MODEL_VERSION') IMAGE_NAME = os.environ.get('IMAGE_NAME') diff --git a/ml_service/util/register_model.py b/ml_service/util/register_model.py index 6f9634ab..ea26a997 100644 --- a/ml_service/util/register_model.py +++ b/ml_service/util/register_model.py @@ -11,13 +11,13 @@ load_dotenv() TENANT_ID = os.environ.get('TENANT_ID') -APP_ID = os.environ.get('APP_ID') -APP_SECRET = os.environ.get('APP_SECRET') +APP_ID = os.environ.get('SP_APP_ID') +APP_SECRET = os.environ.get('SP_APP_SECRET') MODEL_PATH = os.environ.get('MODEL_PATH') MODEL_NAME = os.environ.get('MODEL_NAME') -WORKSPACE_NAME = os.environ.get('WORKSPACE_NAME') +WORKSPACE_NAME = os.environ.get("BASE_NAME")+"-AML-WS" SUBSCRIPTION_ID = os.environ.get('SUBSCRIPTION_ID') -RESOURCE_GROUP = os.environ.get('RESOURCE_GROUP') +RESOURCE_GROUP = os.environ.get("BASE_NAME")+"-AML-RG" if os.path.isfile(MODEL_PATH) is False: From e1fcb1c45c8794d4185130ee35bd57ddc044cc87 Mon Sep 17 00:00:00 2001 From: Eugene Fedorenko Date: Tue, 3 Sep 2019 15:02:32 -0700 Subject: [PATCH 8/8] Update getting_started.md --- docs/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index c0719737..068ea84f 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -50,7 +50,7 @@ The variable group should contain the following variables: Mark **SP_APP_SECRET** variable as a secret one. -**Note:** The BASE_NAME parameter is used throughout the solution for naming Azure resources. When the solution is used in a shared subscription, there can be naming collisions with resources that require unique names like azure blob storage and registry DNS naming. Make sure to give a unique value to the BASE_NAME variable (e.g. MyUniqueML), so that the created resources will have unique names (e.g. MyUniqueML-AML-RG, MyUniqueML-AML-WS, etc.). The length of the BASE_NAME value should not exceed 10 charecters. +**Note:** The BASE_NAME parameter is used throughout the solution for naming Azure resources. When the solution is used in a shared subscription, there can be naming collisions with resources that require unique names like azure blob storage and registry DNS naming. Make sure to give a unique value to the BASE_NAME variable (e.g. MyUniqueML), so that the created resources will have unique names (e.g. MyUniqueML-AML-RG, MyUniqueML-AML-WS, etc.). The length of the BASE_NAME value should not exceed 10 characters. Make sure to select the **Allow access to all pipelines** checkbox in the variable group configuration.