environments ai ml automl dnn gpu - Azure/azureml-assets GitHub Wiki
An environment used by Azure ML AutoML for training models.
Version: 52
OS : Ubuntu20.04 Training Preview OpenMpi : 4.1.0 Python : 3.9
View in Studio: https://ml.azure.com/registries/azureml/environments/ai-ml-automl-dnn-gpu/version/52
Docker image: mcr.microsoft.com/azureml/curated/ai-ml-automl-dnn-gpu:52
FROM mcr.microsoft.com/azureml/openmpi5.0-cuda12.4-ubuntu22.04:20260810.v1
USER root
ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-gpu
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
ENV ENABLE_METADATA=true
RUN mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
# Upgrade OS packages to pick up current Ubuntu security errata.
# Temporary base-image remediation for PAM/glibc (USN-8601-1 and USN-8611-1).
# Remove the explicit upgrades once the base image includes the patched packages.
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \
apt-get install -y --only-upgrade \
libpam-runtime \
libpam0g \
libpam-modules \
libpam-modules-bin \
libc-bin \
libc-dev-bin \
libc6 \
libc6-dev \
locales && \
apt-get install -y --no-install-recommends \
cmake \
libboost-dev \
libboost-system-dev \
libboost-filesystem-dev && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# msgpack is inherited in the base Miniconda environment; fixes GHSA-6v7p-g79w-8964.
RUN /opt/miniconda/bin/python -m pip install --no-cache-dir --upgrade 'msgpack>=1.2.1' && \
find /opt/miniconda -type d -name 'msgpack-1.1.2.dist-info' -prune -exec rm -rf {} + && \
/opt/miniconda/bin/python -c "import msgpack; assert msgpack.version >= (1, 2, 1), msgpack.version"
# pip remediated to >=26.1 (GHSA-jp4c-xjxw-mgf9 / CVE-2026-6357).
# Why a two-step install instead of a single `conda create ... pip=26.1`:
# The Anaconda defaults channel currently ships only pip 26.0.1; pip 26.1 lives
# on conda-forge (verified via repodata: defaults has [25.1, 25.2, 25.3, 26.0.1],
# conda-forge has 26.1.1). Mixing channels in the conda create solve has caused
# solver instability for this image in the past, so we keep `conda create` on
# defaults and explicitly upgrade pip afterwards. This mirrors the same pattern
# used in assets/training/automl/environments/ai-ml-automl/context/Dockerfile.
# `python -m pip` is the recommended self-upgrade form (avoids running the pip
# script while it is being replaced). Upper bound `<27` guards against an
# unattended jump to a future major release that could break the rest of the
# image. opt/miniconda's pip is already 26.1.1 in the latest parent base image,
# so no secondary upgrade for that prefix is required here.
RUN conda create -p $AZUREML_CONDA_ENVIRONMENT_PATH python=3.10 pip=26.0 -y && \
conda run -p $AZUREML_CONDA_ENVIRONMENT_PATH python -m pip install --no-cache-dir --upgrade 'pip>=26.1,<27' && \
conda clean -a -y
RUN pip install --upgrade lightgbm==4.6.0
RUN pip install --upgrade --force-reinstall xgboost==1.5.2 pandas==1.5.3
# Install ncurses via conda (C library, not available on pip; single-package solve is trivial)
RUN conda install -p $AZUREML_CONDA_ENVIRONMENT_PATH \
ncurses=6.5 \
-c conda-forge -y
# Install packages via pip (avoids conda solver OOM)
RUN pip install --no-cache-dir \
'numpy>=1.23.5,<1.24' \
'scikit-learn==1.5.1' \
'holidays==0.29' \
'setuptools-git' \
'wheel>=0.46.2' \
'scipy==1.10.1' \
'joblib==1.2.0'
# Ensure future conda and pip calls are tied to this conda environment,
# and we don't just get lucky from the implicit PATH ordering.
SHELL ["conda", "run", "-p", "$AZUREML_CONDA_ENVIRONMENT_PATH", "/bin/bash", "-c"]
# Install pip dependencies
RUN pip install \
azureml-core==1.61.0.post4 \
azureml-pipeline-core==1.62.0 \
azureml-telemetry==1.62.0 \
azureml-defaults==1.62.0 \
azureml-interpret==1.62.0 \
azureml-responsibleai==1.62.0 \
azureml-automl-core==1.62.0.post3 \
azureml-automl-runtime==1.62.0.post1 \
azureml-dataset-runtime==1.62.0.post1 \
azureml-mlflow==1.62.0.post5 \
'azureml-model-management-sdk==1.0.1b6.post1' \
'mlflow-skinny==2.15.1' --no-cache-dir
RUN pip install --no-cache-dir \
azureml-train-automl-client==1.62.0 \
azureml-train-automl-runtime==1.62.0
RUN pip install --no-cache-dir --upgrade --no-deps 'azure-identity>=1.25.1'
RUN pip install \
'inference-schema' \
'cmdstanpy==1.0.4' \
'prophet==1.1.4' \
'pytorch-transformers==1.0.0' --no-cache-dir
RUN pip install \
'spacy==3.7.4' \
'https://aka.ms/automl-resources/packages/en_core_web_sm-3.7.1.tar.gz' \
'py-cpuinfo==5.0.0' \
'jinja2>=3.1.6' --no-cache-dir
# Fix vulnerabilities - overrides needed because parent packages cap vulnerable versions
# torchvision==0.23.0, torch==2.8.0: CVE-2025-32434 RCE via torch.load (via pytorch-transformers -> torch, horovod).
# torch is deliberately held at 2.8.0: horovod is built from source below against this
# exact version, so a newer torch breaks the horovod build and the resulting runtime.
# distributed>=2026.1.0: CVE-2026-23528 (via azureml-train-automl-runtime -> dask[complete] -> distributed)
# mlflow-skinny>=2.16.0: security fixes (via azureml-mlflow -> mlflow-skinny, also installed directly)
# protobuf>=5.29.6: CVE-2026-0994 DoS recursion (via mlflow-skinny -> protobuf, azureml-automl-runtime -> onnx/onnxruntime)
# pillow>=12.3.0: image-decoder heap overflow findings (via torchvision -> pillow, prophet -> matplotlib -> pillow)
# bokeh>=3.8.2: GHSA-793v-589g-574v CSWSH (overrides azureml-train-automl-runtime's bokeh<3.0.0 cap)
# onnx>=1.21.0: GHSA-3r9x-f23j-gc73, GHSA-p433-9wv8-28xj, GHSA-q56x-g2fj-4rj6, GHSA-538c-55jv-c5g9,
# GHSA-cmw6-hcpp-c6jp, GHSA-hqmj-h5c6-369m (overrides azureml-automl-runtime's onnx<=1.17.0 cap)
# starlette>=1.0.1: GHSA-86qp-5c8j-p5mr (transitive via fastapi; drop when parent bumps)
# pyarrow>=23.0.1: GHSA-rgxp-2hwp-jwgg / CVE-2026-25087 use-after-free (via azureml-dataset-runtime)
# cryptography>=50.0.0: GHSA-537c-gmf6-5ccf, GHSA-g6cj-pr64-35w5 (via azureml-core -> paramiko/msal)
# GitPython>=3.1.57: mlflow-skinny -> databricks-sdk -> gitpython keeps a loose floor
# pyasn1>=0.6.4: GHSA-hm4w-wwcw-mr6r, GHSA-8ppf-4f7h-5ppj (via google-auth -> pyasn1)
# setuptools>=83.0.0: GHSA-5rjg-fvgr-3xxf, GHSA-h35f-9h28-mq5c
#
# numpy>=1.23.5,<1.24 is NOT a security floor. It repeats the cap applied further up so
# that pip sees it while resolving the floors above: onnx pulls ml_dtypes, which as of
# 0.6.0 requires numpy 2.x. Without the cap in this same resolve, pip silently upgrades
# numpy to 2.2.6, which contradicts azureml-automl-runtime, azureml-training-tabular,
# numba and scipy, and leaves the prebuilt pandas 1.5.3 wheel binary-incompatible
# ("numpy.dtype size changed") so the environment fails on `import pandas` at runtime.
RUN pip install --upgrade torchvision==0.23.0 torch==2.8.0 --no-cache-dir
RUN pip install --upgrade --no-cache-dir \
'numpy>=1.23.5,<1.24' \
'distributed>=2026.1.0' 'mlflow-skinny>=2.16.0' \
'protobuf>=5.29.6' 'pillow>=12.3.0' \
'bokeh>=3.8.2' \
'onnx>=1.21.0' \
'starlette>=1.0.1' \
'pyarrow>=23.0.1' \
'cryptography>=50.0.0' \
'GitPython>=3.1.57' \
'pyasn1>=0.6.4' \
'setuptools>=83.0.0'
# The base Miniconda prefix carries its own copies of these packages, which the
# AzureML conda environment above never touches, so patch them explicitly.
# msgpack is already upgraded in this same prefix earlier in the file.
RUN /opt/miniconda/bin/python -m pip install --no-cache-dir --upgrade \
'cryptography>=50.0.0' \
'pydantic-settings>=2.14.2' \
'setuptools>=83.0.0'
RUN /bin/bash -c "source activate $AZUREML_CONDA_ENVIRONMENT_PATH && \
export CUDACXX=/usr/local/cuda/bin/nvcc && \
export HOROVOD_BUILD_CUDA_CC_LIST='60,61,70,75,80,86,89,90' && \
HOROVOD_WITH_PYTORCH=1 \
HOROVOD_CUDA_HOME=/usr/local/cuda \
CMAKE_LIBRARY_PATH=/usr/local/cuda/targets/x86_64-linux/lib:/usr/local/cuda-12.6/targets/x86_64-linux/lib \
pip install --no-cache-dir --no-build-isolation \
git+https://github.com/horovod/horovod@3a31d933a13c7c885b8a673f4172b17914ad334d"
# pip's vendored manifests inherited from the base image still record
# setuptools==70.3.0 long after setuptools itself has been upgraded, and the
# scanner reports that stale entry as GHSA-5rjg-fvgr-3xxf / CVE-2025-47273 with
# an empty install path. pip vendors no setuptools code, only the name, so the
# entry is inaccurate rather than a real component. Drop just that line from
# vendor.txt so the genuinely vendored packages stay listed, and drop
# bom.cdx.json, which merely duplicates vendor.txt in CycloneDX form.
RUN rm -rf /opt/miniconda/pkgs/ && \
find /opt/miniconda $AZUREML_CONDA_ENVIRONMENT_PATH -path '*/pip/_vendor/vendor.txt' \
-exec sed -i '/^setuptools==/d' {} + && \
find /opt/miniconda $AZUREML_CONDA_ENVIRONMENT_PATH -path '*/pip/_vendor/bom.cdx.json' -delete
ENV LD_LIBRARY_PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/lib:$LD_LIBRARY_PATH