Skip to content

Commit 931820d

Browse files
upgrade over reinstall (#4667)
* upgrade over reinstall * update * mount /var/mlflow_resources to include mlmonitoring
1 parent bb81cbb commit 931820d

File tree

11 files changed

+20
-23
lines changed

11 files changed

+20
-23
lines changed

assets/training/automl/environments/ai-ml-automl-dnn-forecasting-gpu/context/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-forecasting-
44
# Prepend path to AzureML conda environment
55
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"

assets/training/automl/environments/ai-ml-automl-dnn-gpu/context/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-gpu
66
# Prepend path to AzureML conda environment
77
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
88

9-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
9+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
1010

1111
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1212
# ENV AML_APP_ROOT="/var/mlflow_resources"
@@ -116,7 +116,7 @@ RUN pip install \
116116
# end pypi dependencies
117117

118118
# Fix vulnerabilities
119-
RUN pip install --force-reinstall torchvision==0.23.0 torch==2.8.0 --no-cache-dir
119+
RUN pip install --upgrade torchvision==0.23.0 torch==2.8.0 --no-cache-dir
120120
RUN pip install --upgrade 'requests==2.32.5' 'urllib3==2.5.0' 'pillow==12.0.0'
121121

122122
# If you have other python/pip environments, update them too:
@@ -126,9 +126,7 @@ RUN pip install --upgrade 'requests==2.32.5' 'urllib3==2.5.0' 'pillow==12.0.0' |
126126
# --- End Vulnerability Fixes ---
127127

128128
# --- Pin NumPy <2 everywhere to avoid NumPy 2.x incompatibility ---
129-
RUN conda run -p $AZUREML_CONDA_ENVIRONMENT_PATH pip install 'numpy==1.23.5' --force-reinstall && \
130-
pip install 'numpy==1.23.5' --force-reinstall
131-
RUN pip install --upgrade 'h2>=4.3.0'
129+
RUN pip install --upgrade 'numpy==1.23.5' 'h2>=4.3.0'
132130

133131
RUN /bin/bash -c "source activate $AZUREML_CONDA_ENVIRONMENT_PATH && \
134132
export CUDACXX=/usr/local/cuda/bin/nvcc && \

assets/training/automl/environments/ai-ml-automl-dnn-text-gpu-ptca/context/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,16 @@ RUN pip install \
4848

4949
RUN pip uninstall -y onnxruntime
5050
RUN pip uninstall -y torch torchvision torchaudio
51-
RUN pip install torch==2.8.0 torchaudio==2.8.0 torchvision==0.23.0
52-
# Install/upgrade torch in ptca env if it exists (fixes vulnerability)
53-
RUN /opt/conda/envs/ptca/bin/pip install --force-reinstall torch==2.8.0 torchvision==0.23.0 || true
51+
RUN pip install --upgrade torch==2.8.0 torchaudio==2.8.0 torchvision==0.23.0
5452

5553
# onnx and onnxruntime-training installation
5654
RUN pip install onnx==1.17.0
5755
RUN pip uninstall -y onnxruntime-training
5856
RUN pip install -i https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ onnxruntime-training==1.18.0
5957

6058
# Install numpy
61-
RUN pip install "numpy==1.23.5" --force-reinstall
62-
RUN /opt/conda/bin/pip install "numpy==1.23.5" --force-reinstall || true
59+
RUN pip install --upgrade "numpy==1.23.5"
60+
RUN /opt/conda/bin/pip install --upgrade "numpy==1.23.5" || true
6361

6462
# torch-ort installation
6563
RUN TORCH_CUDA_ARCH_LIST="5.2;6.0;7.0;8.0;8.6;9.0" python -m onnxruntime.training.ortmodule.torch_cpp_extensions.install

assets/training/automl/environments/ai-ml-automl-dnn-text-gpu/context/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-text-gpu
44
# Prepend path to AzureML conda environment
55
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"
@@ -129,7 +129,7 @@ RUN pip list && \
129129
aiohttp==3.12.14
130130

131131
# Upgrade torch and torchvision
132-
RUN pip install torch==2.8.0 torchvision==0.23.0
132+
RUN pip install --upgrade torch==2.8.0 torchvision==0.23.0
133133
RUN /opt/conda/envs/ptca/bin/pip install --upgrade torch==2.8.0 torchvision==0.23.0 || true
134134

135135
# Upgrade starlette and urllib3

assets/training/automl/environments/ai-ml-automl-dnn-vision-gpu/context/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-vision-gpu
44
# Prepend path to AzureML conda environment
55
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"
@@ -130,8 +130,8 @@ RUN /opt/conda/bin/pip install --upgrade 'pillow==12.0.0' 'starlette>=0.49.1' 'u
130130
RUN /opt/conda/envs/ptca/bin/pip install --upgrade 'pillow==12.0.0' 'starlette>=0.49.1' 'urllib3==2.5.0'
131131

132132
# Upgrade torch and torchvision to fix vulnerabilities
133-
RUN /opt/conda/envs/ptca/bin/pip install --force-reinstall --no-cache-dir 'torch==2.8.0' torchvision==0.23.0
134-
RUN pip install --force-reinstall --no-cache-dir 'torch==2.8.0' torchvision==0.23.0
133+
RUN /opt/conda/envs/ptca/bin/pip install --upgrade --no-cache-dir 'torch==2.8.0' torchvision==0.23.0
134+
RUN pip install --upgrade --no-cache-dir 'torch==2.8.0' torchvision==0.23.0
135135
RUN pip install --upgrade 'mlflow-skinny==2.15.1' 'numpy~=1.23.5'
136136

137137
RUN pip install --upgrade 'h2>=4.3.0'

assets/training/automl/environments/ai-ml-automl-dnn/context/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn
44
# Prepend path to AzureML conda environment
55
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"

assets/training/automl/environments/ai-ml-automl-gpu/context/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl-dnn-gpu
66
# Prepend path to AzureML conda environment
77
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
88

9-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
9+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
1010

1111
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1212
# ENV AML_APP_ROOT="/var/mlflow_resources"

assets/training/automl/environments/ai-ml-automl/context/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ FROM mcr.microsoft.com/azureml/openmpi5.0-ubuntu24.04:{{latest-image-tag}}
44
ENV AZUREML_CONDA_ENVIRONMENT_PATH=/azureml-envs/azureml-automl
55
ENV PATH=$AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"

assets/training/forecasting_demand/environments/automl-gpu/context/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH /azureml-envs/automl
44
# Prepend path to AzureML conda environment
55
ENV PATH $AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
66

7-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
7+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
88

99
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1010
# ENV AML_APP_ROOT="/var/mlflow_resources"

assets/training/vision/environments/automl-dnn-vision-gpu/context/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ENV AZUREML_CONDA_ENVIRONMENT_PATH /azureml-envs/azureml-automl-dnn-vision-gpu
55
# Prepend path to AzureML conda environment
66
ENV PATH $AZUREML_CONDA_ENVIRONMENT_PATH/bin:$PATH
77

8-
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/mlflow_score_script.py /var/mlflow_resources/mlflow_score_script.py
8+
COPY --from=mcr.microsoft.com/azureml/mlflow-ubuntu20.04-py38-cpu-inference:20250506.v1 /var/mlflow_resources/ /var/mlflow_resources/
99

1010
ENV MLFLOW_MODEL_FOLDER="mlflow-model"
1111
# ENV AML_APP_ROOT="/var/mlflow_resources"
@@ -78,12 +78,12 @@ RUN conda env create -p $AZUREML_CONDA_ENVIRONMENT_PATH -f conda_dependencies.ya
7878

7979
# vulnearbility fix
8080
RUN pip install pyarrow==14.0.2
81-
RUN pip install torch==2.8.0 torchvision==0.23.0
81+
RUN pip install --upgrade torch==2.8.0 torchvision==0.23.0
8282
RUN pip install --upgrade urllib3==2.5.0
8383

8484
# Update conda base and ptca envs
8585
RUN /opt/conda/bin/pip install --upgrade requests urllib3 || true
86-
RUN /opt/conda/envs/ptca/bin/pip install torch==2.8.0 torchvision==0.23.0 || true
86+
RUN /opt/conda/envs/ptca/bin/pip install --upgrade torch==2.8.0 torchvision==0.23.0 || true
8787
RUN /opt/conda/envs/ptca/bin/pip install --upgrade urllib3==2.5.0 || true
8888

8989
# Patch pillow vulnerability

0 commit comments

Comments
 (0)