From 6c48d18541b09ae6d0828413345309983d07a990 Mon Sep 17 00:00:00 2001 From: Muna-alhassan <63193120+Muna-alhassan@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:55:43 +0300 Subject: [PATCH 1/3] Update environment.py Not setting this object (environment._translated_conda_file) causes a mismatch between the registered env and the loaded one which leads to re-register the existing env. This issue only happens with environment that includes conda file. --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index d5d5c4c6a8f0..775807e8c316 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -232,6 +232,7 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersionData) -> "Environm if rest_env_version.conda_file: translated_conda_file = yaml.safe_load(rest_env_version.conda_file) environment.conda_file = translated_conda_file + environment._translated_conda_file=yaml.dump(translated_conda_file) return environment From 6e0a99102e94ab35557c9e35c5663aea68d653bb Mon Sep 17 00:00:00 2001 From: Muna-alhassan <63193120+Muna-alhassan@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:30:50 +0300 Subject: [PATCH 2/3] Update sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py Co-authored-by: Man <43016276+Man-MSFT@users.noreply.github.com> --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py index 775807e8c316..aeff4fb29284 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_assets/environment.py @@ -232,7 +232,7 @@ def _from_rest_object(cls, env_rest_object: EnvironmentVersionData) -> "Environm if rest_env_version.conda_file: translated_conda_file = yaml.safe_load(rest_env_version.conda_file) environment.conda_file = translated_conda_file - environment._translated_conda_file=yaml.dump(translated_conda_file) + environment._translated_conda_file = rest_env_version.conda_file return environment From 5e6fa50036aa8d09f3c1cb64555a5f2d87597d0e Mon Sep 17 00:00:00 2001 From: Muna-alhassan <63193120+Muna-alhassan@users.noreply.github.com> Date: Tue, 25 Oct 2022 13:14:24 +0300 Subject: [PATCH 3/3] Update CHANGELOG.md --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index edd8ea1f8005..074c71ee389d 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -12,6 +12,7 @@ ### Bugs Fixed - MLClient.from_config can now find the default config.json on Compute Instance when running sample notebooks. - Adjust registry experimental tags and imports to avoid warning printouts for unrelated operations. +- Prevent registering an already existing environment that references conda file. ### Other Changes