From 01c72c0e3267e6d18ff2832d5ec22d26d1c2dff2 Mon Sep 17 00:00:00 2001 From: Kelly <40868256+lykelly19@users.noreply.github.com> Date: Thu, 2 Jan 2025 08:06:24 -0800 Subject: [PATCH] Block environment/image releases based on Ubuntu 20.04 (#3714) * Block env/image releases based on Ubuntu 20.04 * update pypi version * update changelog --------- Co-authored-by: Kelly --- scripts/azureml-assets/CHANGELOG.md | 4 ++++ .../assets/environment/validate_build_logs.py | 22 +++++++++++++++++++ scripts/azureml-assets/setup.py | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/scripts/azureml-assets/CHANGELOG.md b/scripts/azureml-assets/CHANGELOG.md index a2531051e3..9cf24525b7 100644 --- a/scripts/azureml-assets/CHANGELOG.md +++ b/scripts/azureml-assets/CHANGELOG.md @@ -2,6 +2,10 @@ ### 🚀 New Features +## 1.16.68 (2024-01-02) +### 🚀 New Features +- [#3714](https://github.com/Azure/azureml-assets/pull/3714) Block environment/image releases based on Ubuntu 20.04 + ## 1.16.67 (2024-11-18) ### 🚀 New Features - [#3605](https://github.com/Azure/azureml-assets/pull/3605) Improve logging for environment release tag already found in copy_assets diff --git a/scripts/azureml-assets/azureml/assets/environment/validate_build_logs.py b/scripts/azureml-assets/azureml/assets/environment/validate_build_logs.py index 37cf8def4c..65ee6adac8 100644 --- a/scripts/azureml-assets/azureml/assets/environment/validate_build_logs.py +++ b/scripts/azureml-assets/azureml/assets/environment/validate_build_logs.py @@ -31,6 +31,27 @@ def validate_py_version(build_log_file_name, build_log_content): return 0 +def validate_ubuntu_version(build_log_file_name, build_log_content): + """Validate Ubuntu version. + + Args: + build_log_file_name (str): Build log file name. + build_log_content (str): Build log content + + Returns: + int: Number of errors. + """ + ubuntu2004_match = re.search(r"FROM\s+(.*20\.04.*|.*2004.*)", build_log_content) + + if ubuntu2004_match: + logger.log_error(f"{build_log_file_name}: Ubuntu 20.04 reference found in build log." + f"Ubuntu 20.04 is nearing or has reached EOL. Please create an environment " + f"based on a newer Ubuntu version.") + return 1 + + return 0 + + def validate_build_logs(build_logs_dir): """Validate environment build logs. @@ -50,6 +71,7 @@ def validate_build_logs(build_logs_dir): with open(build_log_file_path, "r") as f: build_log_content = f.read() error_count += validate_py_version(build_log_file_name, build_log_content) + error_count += validate_ubuntu_version(build_log_file_name, build_log_content) return error_count == 0 diff --git a/scripts/azureml-assets/setup.py b/scripts/azureml-assets/setup.py index 09af8e814a..8e92235660 100644 --- a/scripts/azureml-assets/setup.py +++ b/scripts/azureml-assets/setup.py @@ -7,7 +7,7 @@ setup( name="azureml-assets", - version="1.16.67", + version="1.16.68", description="Utilities for publishing assets to Azure Machine Learning system registries.", author="Microsoft Corp", packages=find_packages(),