From 3bd0d7e20f149d415b06605864bfc4401b27806b Mon Sep 17 00:00:00 2001 From: Hanwen Date: Wed, 18 Dec 2024 07:58:00 -0800 Subject: [PATCH] [Test] Use UpdateOsPackages when building from vanilla RHEL AMIs Signed-off-by: Hanwen --- tests/integration-tests/tests/createami/test_createami.py | 5 +++++ .../test_createami/test_build_image/image.config.yaml | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/integration-tests/tests/createami/test_createami.py b/tests/integration-tests/tests/createami/test_createami.py index 75c465f9ba..4a326423ec 100644 --- a/tests/integration-tests/tests/createami/test_createami.py +++ b/tests/integration-tests/tests/createami/test_createami.py @@ -125,6 +125,7 @@ def test_build_image( _set_s3_bucket_policy(bucket_name, get_arn_partition(region), region) enable_nvidia = True + update_os_packages = False # Get base AMI if os in ["alinux2", "ubuntu2004"]: # Test Deep Learning AMIs @@ -138,15 +139,19 @@ def test_build_image( # Therefore, the test tries to succeed at best effort. logging.info("First stage AMI not available, using official AMI instead.") base_ami = retrieve_latest_ami(region, os, ami_type="official", architecture=architecture) + update_os_packages = True else: # Test vanilla AMIs. base_ami = retrieve_latest_ami(region, os, ami_type="official", architecture=architecture) + if os in ["alinux2", "alinux2023"]: + update_os_packages = True image_config = pcluster_config_reader( config_file="image.config.yaml", parent_image=base_ami, instance_role=instance_role, bucket_name=bucket_name, enable_nvidia=str(enable_nvidia and get_gpu_count(instance) > 0).lower(), + update_os_packages=str(update_os_packages).lower(), ) image = images_factory(image_id, image_config, region) diff --git a/tests/integration-tests/tests/createami/test_createami/test_build_image/image.config.yaml b/tests/integration-tests/tests/createami/test_createami/test_build_image/image.config.yaml index 4a41bc9db2..c5e27ee159 100644 --- a/tests/integration-tests/tests/createami/test_createami/test_build_image/image.config.yaml +++ b/tests/integration-tests/tests/createami/test_createami/test_build_image/image.config.yaml @@ -14,11 +14,8 @@ Build: Tags: - Key: dummyBuildTag Value: dummyBuildTag -{% if os in ["alinux2", "alinux2023"] %} -# Use UpdateOSPackages for alinux is optional. Use UpdateOSPackages on Ubuntu, RHEL/Rocky is not recommended because it intermittently fails because of kernel issues. UpdateOsPackages: - Enabled: true -{% endif %} + Enabled: {{ update_os_packages }} Installation: LustreClient: # Disable Lustre installation because these newer operating systems release new kernels more often. Lustre usually does not support the latest kernels