Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amah/update e2e sample #1898

Merged
merged 6 commits into from
Nov 21, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 52 additions & 19 deletions tutorials/e2e-ds-experience/e2e-ml-workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@
" tags={\"scikit-learn\": \"0.24.2\"},\n",
" conda_file=os.path.join(dependencies_dir, \"conda.yml\"),\n",
" image=\"mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04:latest\",\n",
" version=\"1.0\",\n",
" version=\"0.1.0\",\n",
")\n",
"pipeline_job_env = ml_client.environments.create_or_update(pipeline_job_env)\n",
"\n",
Expand Down Expand Up @@ -578,7 +578,22 @@
}
},
"source": [
"Optionally, register the component in the workspace for future re-use."
"Optionally, register the component in the workspace for future re-use. **command()** is a component builder, in order to fetch the component itself, we need to call the **.component** property from it."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Now we register the component to the workspace\n",
"data_prep_component = ml_client.create_or_update(data_prep_component.component)\n",
"\n",
"# Create (register) the component in your workspace\n",
"print(\n",
" f\"Component {data_prep_component.name} with Version {data_prep_component.version} is registered\"\n",
")"
]
},
{
Expand All @@ -589,7 +604,7 @@
"\n",
"The second component that you'll create will consume the training and test data, train a tree based model and return the output model. You'll use Azure ML logging capabilities to record and visualize the learning progress.\n",
"\n",
"You used the `command` class to create your first component. This time you'll use the yaml definition to define the second component. Each method has its own advantages. A yaml definition can actually be checked-in along the code, and would provide a readable history tracking. The programmatic method using `command` can be easier with built-in class documentation and code completion.\n",
"You used the `command` class to create your first component. This time you'll use the yaml definition to define the second component. Each method has its own advantages. A yaml definition can actually be checked-in along the code, and would provide a readable history tracking. Also, the same yaml file can be used in the CLI for component deficnition. The programmatic method using `command` can be easier with built-in class documentation and code completion.\n",
"\n",
"\n",
"Create the directory for this component:"
Expand Down Expand Up @@ -954,10 +969,9 @@
"\n",
"# Let's instantiate the pipeline with the parameters of our choice\n",
"pipeline = credit_defaults_pipeline(\n",
" # pipeline_job_data_input=credit_data,\n",
" pipeline_job_data_input=Input(type=\"uri_file\", path=web_path),\n",
" pipeline_job_test_train_ratio=0.2,\n",
" pipeline_job_learning_rate=0.25,\n",
" pipeline_job_data_input=Input(type=\"uri_file\", path=credit_data.path),\n",
" pipeline_job_test_train_ratio=0.25,\n",
" pipeline_job_learning_rate=0.05,\n",
" pipeline_job_registered_model_name=registered_model_name,\n",
")"
]
Expand Down Expand Up @@ -999,7 +1013,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"An output of \"False\" is expected from the above cell. You can track the progress of your pipeline, by using the link generated in the cell above or in this notebook using the following code:\n",
"You can track the progress of your pipeline, by using the link generated in the cell above or in this notebook using the following code:\n",
"```python\n",
" ml_client.jobs.stream(pipeline_job.name)\n",
"```\n",
Expand Down Expand Up @@ -1094,9 +1108,9 @@
" },\n",
")\n",
"\n",
"endpoint = ml_client.begin_create_or_update(endpoint)\n",
"endpoint_result = ml_client.begin_create_or_update(endpoint).result()\n",
"\n",
"print(f\"Endpint {endpoint.name} provisioning state: {endpoint.provisioning_state}\")"
"print(f\"Endpint {endpoint_result.name} provisioning state: {endpoint_result.provisioning_state}\")"
]
},
{
Expand Down Expand Up @@ -1168,6 +1182,21 @@
"> Expect this deployment to take approximately 6 to 8 minutes."
]
},
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cell contains subscription information, should not be published.

Copy link
Contributor Author

@AliMahmoudzadeh AliMahmoudzadeh Nov 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sdgilley, I removed the cell

"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ml_client = MLClient(\n",
" credential=credential,\n",
" subscription_id=\"15ae9cb6-95c1-483d-a0e3-b1a1a3b06324\",\n",
" resource_group_name=\"webxt-bootcamp\",\n",
" workspace_name=\"bootcamp\",\n",
")\n",
"registered_model_name = \"credit_defaults_model\""
]
},
{
"cell_type": "code",
"execution_count": null,
Expand All @@ -1185,11 +1214,13 @@
" name=\"blue\",\n",
" endpoint_name=online_endpoint_name,\n",
" model=model,\n",
" instance_type=\"Standard_DS3_v2\",\n",
" instance_type=\"Standard_F4s_v2\",\n",
" instance_count=1,\n",
")\n",
"\n",
"blue_deployment = ml_client.begin_create_or_update(blue_deployment)"
"blue_deployment_results = ml_client.online_deployments.begin_create_or_update(blue_deployment).result()\n",
"\n",
"print(f\"Deployment {blue_deployment_results.name} provisioning state: {blue_deployment_results.provisioning_state}\")"
]
},
{
Expand Down Expand Up @@ -1300,13 +1331,10 @@
],
"metadata": {
"celltoolbar": "Edit Metadata",
"interpreter": {
"hash": "6d65a8c07f5b6469e0fc613f182488c0dccce05038bbda39e5ac9075c0454d11"
},
"kernelspec": {
"display_name": "Python 3.8 - AzureML",
"display_name": "Python 3.8.13 ('sdkv2')",
"language": "python",
"name": "python38-azureml"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1318,12 +1346,17 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.7"
"version": "3.8.13"
},
"nteract": {
"version": "nteract-front-end@1.0.0"
},
"vscode": {
"interpreter": {
"hash": "78d13900fb236b5ce4c0b952de9b1270f1802c447ee20a989ea10ffd935aa825"
}
}
},
"nbformat": 4,
"nbformat_minor": 1
}
}