Skip to content

Commit

Permalink
Block environment/image releases based on Ubuntu 20.04 (#3714)
Browse files Browse the repository at this point in the history
* Block env/image releases based on Ubuntu 20.04

* update pypi version

* update changelog

---------

Co-authored-by: Kelly <[email protected]>
  • Loading branch information
lykelly19 and Kelly authored Jan 2, 2025
1 parent a2fe0ca commit 01c72c0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions scripts/azureml-assets/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion scripts/azureml-assets/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 01c72c0

Please sign in to comment.