Просмотр исходного кода

Bump the default AWS test image to Ubuntu 24.04

The default was ami-aa2ea6d0 - Canonical's Ubuntu 16.04, built 2017, a
Xen-era HVM image - carried because the comment beside it said moto needed
it to match an entry in tests/fixtures/custom_amis.json. That has not been
true since 3fbcba2 removed MOTO_AMIS_PATH from tox.ini: nothing loads that
fixture, moto does not validate instance-launch AMI ids, and neither the
old id nor the new one appears in moto's own bundled list. The mock
provider is indifferent to this value; the constraint that pinned the
default to a 2017 image had already gone.

Point it at Ubuntu 24.04 LTS instead. This is the fallback for runs
against real EC2 that do not set CB_IMAGE_AWS, and there the image
generation is what the suite's wall time is made of - launching an
instance, snapshotting it into an AMI, launching a second instance from
that AMI, and stop/start cycling are all markedly slower on Xen than on
Nitro.

Record what the value is and what it is tied to, since an AMI id is
per-region and this one is us-east-1, and note that the gain needs a
Nitro instance type via CB_VM_TYPE_AWS to land.
Nuwan Goonasekera 19 часов назад
Родитель
Сommit
05175b5dff
1 измененных файлов с 15 добавлено и 7 удалено
  1. 15 7
      tests/helpers/__init__.py

+ 15 - 7
tests/helpers/__init__.py

@@ -81,13 +81,21 @@ def skipIfPython(op, major, minor):
 
 TEST_DATA_CONFIG = {
     "AWSCloudProvider": {
-        # This default exists for the mock provider only - it matches an entry
-        # in custom_amis.json so moto can resolve it. It is Ubuntu 16.04 built
-        # in 2017, a Xen-era HVM image, and launching, imaging and stop/start
-        # cycling it against real EC2 is markedly slower than a current
-        # Nitro-compatible image. Runs against real AWS should set
-        # CB_IMAGE_AWS, as the other providers' suites set their CB_IMAGE_*.
-        "image": cb_helpers.get_env('CB_IMAGE_AWS', 'ami-aa2ea6d0'),
+        # Ubuntu 24.04 LTS, us-east-1, amd64, gp3 (Canonical, 20260714). AMI
+        # ids are per-region, so a run anywhere but us-east-1 has to set
+        # CB_IMAGE_AWS - as does anyone wanting a different distribution.
+        #
+        # Being Nitro-era matters: the AWS suite's wall time is dominated by
+        # launching an instance, snapshotting it into an AMI, launching a
+        # second instance from that AMI and stop/start cycling, and all of
+        # those are markedly slower on the Xen-era image this replaced
+        # (Ubuntu 16.04, built 2017). Pair it with a Nitro instance type -
+        # t3.micro or larger - via CB_VM_TYPE_AWS; on a t2.* the gain is
+        # mostly lost, and 24.04 is a tight fit in t2.nano's 512 MB.
+        #
+        # moto does not validate instance-launch AMI ids, so the mock
+        # provider is indifferent to this value.
+        "image": cb_helpers.get_env('CB_IMAGE_AWS', 'ami-052355af2a014bd2c'),
         "vm_type": cb_helpers.get_env('CB_VM_TYPE_AWS', 't2.nano'),
         "placement": cb_helpers.get_env('CB_PLACEMENT_AWS', 'us-east-1a'),
         "placement_cfg_key": "aws_zone_name"