You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/data-science-virtual-machine/dsvm-common-identity.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ ms.date: 04/10/2024
14
14
15
15
# Set up a common identity on a Data Science Virtual Machine
16
16
17
-
On a Microsoft Azure Virtual Machine (VM), or a Data Science Virtual Machine (DSVM), you create local user accounts while provisioning the VM. Users then authenticate to the VM with credentials for those user accounts. If you have multiple VMs that your users need to access, credential management can become difficult. To solve the problem, you can deploy common user accounts, and manage those accounts, through a standards-based identity provider. You can then use a single set of credentials to access multiple resources on Azure, including multiple DSVMs.
17
+
On a Microsoft Azure Virtual Machine (VM), or a Data Science Virtual Machine (DSVM), you create local user accounts while provisioning the VM. Users then authenticate to the VM with credentials for those user accounts. If you have multiple VMs, and your users need to access them, credential management can become difficult. To solve the problem, you can deploy common user accounts, and manage those accounts, through a standards-based identity provider. You can then use a single set of credentials to access multiple resources on Azure, including multiple DSVMs.
18
18
19
19
Active Directory is a popular identity provider. Azure supports it both as a cloud service and as an on-premises directory. You can use Microsoft Entra ID or on-premises Active Directory to authenticate users on a standalone DSVM, or a cluster of DSVMs, in an Azure virtual machine scale set. To do this, you join the DSVM instances to an Active Directory domain.
20
20
@@ -38,7 +38,7 @@ Microsoft Entra Domain Services makes it simple to manage your identities. It pr
38
38
39
39
The **User** pane opens, as shown in this screenshot:
40
40
41
-
:::image type="content" source="./media/add-user.png" alt-text="Screenshot showing the add user pane." lightbox="./media/add-user.png":::
41
+
:::image type="content" source="./media/dsvm-common-identity/add-user.png" alt-text="Screenshot showing the add user pane." lightbox="./media/dsvm-common-identity/add-user.png":::
42
42
43
43
1. Enter information about the user, such as **Name** and **User name**. The domain name portion of the user name must be either the initial default domain name "[domain name].onmicrosoft.com" or a verified, non-federated [custom domain name](/azure/active-directory/fundamentals/add-custom-domain) such as "contoso.com."
In this article, learn how to use a custom Docker image when you're training models with Azure Machine Learning. You'll use the example scripts in this article to classify pet images by creating a convolutional neural network.
22
+
This article describes how to use a custom Docker image to train models with Azure Machine Learning. Example scripts show how to classify images by creating a convolutional neural network.
21
23
22
-
Azure Machine Learning provides a default Docker base image. You can also use Azure Machine Learning environments to specify a different base image, such as one of the maintained [Azure Machine Learning base images](https://github.com/Azure/AzureML-Containers) or your own [custom image](../how-to-deploy-custom-container.md). Custom base images allow you to closely manage your dependencies and maintain tighter control over component versions when running training jobs.
24
+
Azure Machine Learning provides a default Docker base image. You can also use Azure Machine Learning environments to specify a different base image, such as a maintained [Azure Machine Learning base image](https://github.com/Azure/AzureML-Containers) or your own [custom image](../how-to-deploy-custom-container.md). Custom base images allow you to closely manage your dependencies and maintain tighter control over component versions when you run training jobs.
23
25
24
26
## Prerequisites
25
27
26
-
Run the code on either of these environments:
28
+
To run the example code, your configuration must include one of the following environments:
29
+
30
+
- Azure Machine Learning compute instance with a dedicated notebook server preloaded with the Machine Learning SDK and Samples repository.
31
+
32
+
This configuration requires no downloads or other installation. To prepare this environment, see [Create resources to get started](../quickstart-create-resources.md).
33
+
34
+
- Jupyter Notebook server. The following resources provide instructions to help you prepare this environment:
27
35
28
-
* Azure Machine Learning compute instance (no downloads or installation necessary):
29
-
* Complete the [Create resources to get started](../quickstart-create-resources.md) tutorial to create a dedicated notebook server preloaded with the SDK and the sample repository.
30
-
* Your own Jupyter Notebook server:
31
-
* Create a [workspace configuration file](../how-to-configure-environment.md#local-and-dsvm-only-create-a-workspace-configuration-file).
32
-
* Install the [Azure Machine Learning SDK](/python/api/overview/azure/ml/install).
33
-
* Create an [Azure container registry](/azure/container-registry/) or other Docker registry that's available on the internet.
36
+
- Create a [workspace configuration file](../how-to-configure-environment.md#local-and-dsvm-only-create-a-workspace-configuration-file).
37
+
- Install the [Azure Machine Learning SDK](/python/api/overview/azure/ml/install).
38
+
- Create an [Azure container registry](/azure/container-registry/) or other Docker registry available on the internet.
34
39
35
40
## Set up a training experiment
36
41
37
-
In this section, you set up your training experiment by initializing a workspace, defining your environment, and configuring a compute target.
42
+
The first task is to set up your training experiment by initializing a Machine Learning workspace, defining your environment, and configuring a compute target.
38
43
39
44
### Initialize a workspace
40
45
41
-
The [Azure Machine Learning workspace](../concept-workspace.md) is the top-level resource for the service. It gives you a centralized place to work with all the artifacts that you create. In the Python SDK, you can access the workspace artifacts by creating a [`Workspace`](/python/api/azureml-core/azureml.core.workspace.workspace) object.
46
+
The [Azure Machine Learning workspace](../concept-workspace.md) is the top-level resource for the service. It gives you a centralized place to work with all the artifacts you create. In the Python SDK, you can access the workspace artifacts by creating a [`Workspace`](/python/api/azureml-core/azureml.core.workspace.workspace) object.
42
47
43
-
Create a `Workspace` object from the config.json file that you created as a [prerequisite](#prerequisites).
48
+
As needed, create a `Workspace` object from the config.json file that you created as a [prerequisite](#prerequisites).
The specified base image in the following code supports the fast.ai library, which allows for distributed deep-learning capabilities. For more information, see the [fast.ai Docker Hub repository](https://hub.docker.com/u/fastdotai).
62
67
63
-
When you're using your custom Docker image, you might already have your Python environment properly set up. In that case, set the `user_managed_dependencies` flag to `True` to use your custom image's built-in Python environment. By default, Azure Machine Learning builds a Conda environment with dependencies that you specified. The service runs the script in that environment instead of using any Python libraries that you installed on the base image.
68
+
When you use your custom Docker image, you might already have your Python environment properly set up. In that case, set the `user_managed_dependencies` flag to `True` to use your custom image's built-in Python environment. By default, Azure Machine Learning builds a Conda environment with dependencies that you specified. The service runs the script in that environment instead of using any Python libraries that you installed on the base image.
To use an image from a private container registry that isn't in your workspace, use `docker.base_image_registry` to specify the address of the repository and a username and password:
It's also possible to use a custom Dockerfile. Use this approach if you need to install non-Python packages as dependencies. Remember to set the base image to `None`.
84
89
85
90
```python
86
-
# Specify Docker steps as a string.
91
+
# Specify Docker steps as a string
87
92
dockerfile =r"""
88
93
FROM mcr.microsoft.com/azureml/openmpi3.1.2-ubuntu18.04:20210615.v1
89
94
RUN echo "Hello from custom container!"
90
95
"""
91
96
92
-
# Set the base image to None, because the image is defined by Dockerfile.
97
+
# Set the base image to None, because the image is defined by Dockerfile
93
98
fastai_env.docker.base_image =None
94
99
fastai_env.docker.base_dockerfile = dockerfile
95
100
96
-
# Alternatively, load the string from a file.
101
+
# Alternatively, load the string from a file
97
102
fastai_env.docker.base_image =None
98
103
fastai_env.docker.base_dockerfile ="./Dockerfile"
99
104
```
100
105
101
-
>[!IMPORTANT]
106
+
>[!IMPORTANT]
102
107
> Azure Machine Learning only supports Docker images that provide the following software:
103
-
> * Ubuntu 18.04 or greater.
104
-
> * Conda 4.7.# or greater.
105
-
> * Python 3.7+.
106
-
> * A POSIX compliant shell available at /bin/sh is required in any container image used for training.
108
+
> * Ubuntu 18.04 or greater
109
+
> * Conda 4.7.# or greater
110
+
> * Python 3.7+
111
+
> * A POSIX compliant shell available at /bin/sh is required in any container image used for training
107
112
108
113
For more information about creating and managing Azure Machine Learning environments, see [Create and use software environments](../how-to-use-environments.md).
109
114
@@ -119,7 +124,7 @@ As with other Azure services, there are limits on certain resources (for example
119
124
from azureml.core.compute import ComputeTarget, AmlCompute
120
125
from azureml.core.compute_target import ComputeTargetException
> Azure Machine Learning runs training scripts by copying the entire source directory. If you have sensitive data that you don't want to upload, use an [.ignore file](../concept-train-machine-learning-model.md#understand-what-happens-when-you-submit-a-training-job) or don't include it in the source directory. Instead, access your data by using a [datastore](/python/api/azureml-core/azureml.data).
175
178
176
-
## Next steps
177
-
In this article, you trained a model by using a custom Docker image. See these other articles to learn more about Azure Machine Learning:
178
-
*[Track run metrics](../how-to-log-view-metrics.md) during training.
179
-
*[Deploy a model](../how-to-deploy-custom-container.md) by using a custom Docker image.
179
+
## Related content
180
+
181
+
*[Track run metrics](../how-to-log-view-metrics.md)
182
+
*[Deploy a model by using a custom Docker image](../how-to-deploy-custom-container.md)
0 commit comments