Skip to content

Commit

Permalink
[Test] Use UpdateOsPackages when building from vanilla RHEL AMIs
Browse files Browse the repository at this point in the history
Signed-off-by: Hanwen <[email protected]>
  • Loading branch information
hanwen-cluster committed Dec 19, 2024
1 parent 5879b61 commit 3bd0d7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions tests/integration-tests/tests/createami/test_createami.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3bd0d7e

Please sign in to comment.