Skip to content

Commit

Permalink
Prevent notebook execution failure by avoiding mlclient private field… (
Browse files Browse the repository at this point in the history
#3327)

* Prevent notebook execution failure by avoiding mlclient private field access warning

* Take changes from Kevin's PR for blocking workflows

* update notebooks

* update flakes

* revert failing notebooks

* Revert "revert failing notebooks"

This reverts commit 14f3163.

* restore failing notebook to main commit

* Update
  • Loading branch information
novaturient95 authored Aug 21, 2024
1 parent cb3b034 commit 0e8aaff
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ jobs:
source "${{ github.workspace }}/infra/bootstrapping/init_environment.sh";
bash setup.sh
working-directory: cli
- name: Eagerly cache access tokens for required scopes
run: |
# Workaround for azure-cli's lack of support for ID token refresh
# Taken from: https://github.com/Azure/login/issues/372#issuecomment-2056289617
# Management
az account get-access-token --scope https://management.azure.com/.default --output none
# ML
az account get-access-token --scope https://ml.azure.com/.default --output none
continue-on-error: true
- name: Eagerly cache access tokens for required scopes
run: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"**Requirements** - In order to benefit from this tutorial, you will need:\n",
"- A basic understanding of Machine Learning\n",
"- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F)\n",
"- An Azure ML workspace. [Check this notebook for creating a workspace](../../../resources/workspace/workspace.ipynb) \n",
"- An Azure ML workspace. [Check this notebook for creating a workspace](../../../resources/workspace/workspace.ipynb) \n",
"- A python environment\n",
"- Installed Azure Machine Learning Python SDK v2 - [install instructions](../../../README.md) - check the getting started section\n",
"\n",
Expand Down Expand Up @@ -120,7 +120,7 @@
"source": [
"workspace = ml_client.workspaces.get(name=ml_client.workspace_name)\n",
"\n",
"subscription_id = ml_client.connections._subscription_id\n",
"subscription_id = ml_client.subscription_id\n",
"resource_group = workspace.resource_group\n",
"workspace_name = ml_client.workspace_name\n",
"\n",
Expand Down Expand Up @@ -230,7 +230,7 @@
"# Create the AutoML classification job with the related factory-function.\n",
"from azure.ai.ml.entities import ResourceConfiguration \n",
"\n",
"classification_job = automl.classification(\n",
"classification_job = automl.classification(\n",
" experiment_name=exp_name,\n",
" training_data=my_training_data_input,\n",
" target_column_name=\"y\",\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"source": [
"workspace = ml_client.workspaces.get(name=ml_client.workspace_name)\n",
"\n",
"subscription_id = ml_client.connections._subscription_id\n",
"subscription_id = ml_client.subscription_id\n",
"resource_group = workspace.resource_group\n",
"workspace_name = ml_client.workspace_name\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@
"Make sure you have executed the [configuration](https://github.com/Azure/MachineLearningNotebooks/blob/master/configuration.ipynb) before running this notebook."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"%pip install azure-ai-ml==1.8.0\n",
"%pip install azure-identity==1.13.0"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -162,7 +172,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = ws.resource_group\n",
"output[\"Location\"] = ws.location\n",
"pd.DataFrame(data=output, index=[\"\"]).T"
Expand Down Expand Up @@ -673,7 +683,7 @@
"outputs": [],
"source": [
"inference_component = ml_client_registry.components.get(\n",
" name=\"automl_forecasting_inference\", label=\"latest\"\n",
" name=\"automl_forecasting_inference\"\n",
")\n",
"print(f\"Inference component version: {inference_component.version}\\n---\")"
]
Expand All @@ -684,10 +694,7 @@
"metadata": {},
"outputs": [],
"source": [
"compute_metrics_component = ml_client_registry.components.get(\n",
" name=\"compute_metrics\",\n",
" version=\"0.0.26\", # label=\"latest\"\n",
")\n",
"compute_metrics_component = ml_client_registry.components.get(name=\"compute_metrics\")\n",
"print(f\"Compute metrics component version: {compute_metrics_component.version}\\n---\")"
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"output"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"pd.set_option(\"display.max_colwidth\", None)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"output"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"pd.set_option(\"display.max_colwidth\", None)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"pd.set_option(\"display.max_colwidth\", None)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"output"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"source": [
"workspace = ml_client.workspaces.get(name=ml_client.workspace_name)\n",
"\n",
"subscription_id = ml_client.connections._subscription_id\n",
"subscription_id = ml_client.subscription_id\n",
"resource_group = workspace.resource_group\n",
"workspace_name = ml_client.workspace_name\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = workspace.resource_group\n",
"output[\"Location\"] = workspace.location\n",
"pd.set_option(\"display.max_colwidth\", None)\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = ws.resource_group\n",
"output[\"Location\"] = ws.location\n",
"pd.DataFrame(data=output, index=[\"\"]).T"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"\n",
"output = {}\n",
"output[\"Workspace\"] = ml_client.workspace_name\n",
"output[\"Subscription ID\"] = ml_client.connections._subscription_id\n",
"output[\"Subscription ID\"] = ml_client.subscription_id\n",
"output[\"Resource Group\"] = ws.resource_group\n",
"output[\"Location\"] = ws.location\n",
"pd.DataFrame(data=output, index=[\"\"]).T"
Expand Down

0 comments on commit 0e8aaff

Please sign in to comment.