Skip to content

Instantly share code, notes, and snippets.

@lindacmsheard
Last active June 9, 2022 22:25
Show Gist options
  • Save lindacmsheard/27516b523ccde85590cbaa4df3ca54a1 to your computer and use it in GitHub Desktop.
Save lindacmsheard/27516b523ccde85590cbaa4df3ca54a1 to your computer and use it in GitHub Desktop.
AML cli v2 environments

Notes on Azure ML environments

(Ref: https://docs.microsoft.com/en-us/azure/machine-learning/reference-yaml-environment#yaml-syntax)

The environment item in an AzureML cli v2 job specification yml file can leverage an AzureML curated environment directly, referenced as follows:

environment: azureml:AzureML-pytorch-1.10-ubuntu18.04-py38-cuda11-gpu@latest

A list of available curated environments can be found here, or from wtihin the environments tab in AzureML Studio.

Alternatively, the environment could also be specified as a combination of a docker image address, and optionally, additional conda dependencies.

⚠️ Be aware of the packages already present in curated environments, and keep the conda specification strictly to few additional dependencies to avoid package conflicts.

environment:
    image: azureml/curated/pytorch-1.10-ubuntu18.04-py38-cuda11-gpu:latest
    conda_file: local/path/to/few-additional-dependencies.yml

The list of docker images available from the microsoft repository is here: mcr.microsoft.com/v2/_catalog

It is also possible to start from an image from public docker repositories. The image should at minimum support python and conda:

environment:
    image: continuumio/miniconda3:latest
    conda_file: local/path/to/custom-conda.yml

Lastly, the environment can be built from a local Dockerfile:

environment:
    build:
        path: ../local/docker-context-dir/
        dockerfile_path: Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment