Repository navigation
Conversation
ce0339c to
6f852bf
Compare
Update UBUNTU_RELEASE_VERSION_MAP and LTS_RELEASES for active releases, add integration tests validating release metadata and daily/released image offerings per cloud, and add a scheduled workflow to run them weekly
blackboxsw
left a comment
There was a problem hiding this comment.
Thank you for this @nryanl. Let's consolidate the LTS_* valiables in pycloudlib/util.py where we can and avoid having two hard-coded lists of distro release names where possible.
| } | ||
|
|
||
| LTS_RELEASES = ["xenial", "bionic", "focal", "jammy", "noble"] | ||
| LTS_RELEASES = ["bionic", "focal", "jammy", "noble", "resolute"] |
There was a problem hiding this comment.
Let's separate ESM_LTS_RELEASES from STANDARD_SUPPORT_LTS_RELEASES in this file instead of dropping "xenial" altogether. This will allow consumers to differentiate Pro-supported (ESM releases) from standard support releases in one place. I don't like that we are adding a separate set of lists to maintain in test_image_offerings as we now have two separate locations to updated release names instead of one. Please move related ACTIVE_RELEASES and STANDARD_LTS_RELEASES out of that unittest. Rename as you see fit.
There was a problem hiding this comment.
You've also made a good point that Xenial is actualy out of ESM now, so dropping it is reasonable. I still think differentiating ESM_LTS_RELEASES from LTS_RELEASES is a reasonable approach to help test lookups for PRO supported images (esm) vs standard support.
There was a problem hiding this comment.
If we are dropping xenial test support from pycloudlib, let's make it official and drop support everywhere (ec2/azure/gce etc) and create a separate commit for it.
| def test_ec2_image_offerings(): | ||
| """Verify EC2 daily_image and released_image resolve for supported image types.""" | ||
| matrix = { | ||
| ImageType.GENERIC: [*STANDARD_LTS_RELEASES, "stonking"], |
There was a problem hiding this comment.
Rather than hard-coding "stonking" should we instead find a way to sort UBUNTU_RELEASE_VERSION_MAP based on XX.YY value and include every interim release name > LTS_RELEASES[-1]?
| ), f"Deprecated Azure URN {urn} ({release}, {image_type.name})" | ||
|
|
||
|
|
||
| @pytest.mark.ci |
There was a problem hiding this comment.
Why do we want this run on every PR? I think we can limit this to running on main_check once a merge happens. I don't want to block on every PR due to image offering changes.
| return active_map, active_lts, all_map | ||
|
|
||
|
|
||
| @pytest.mark.ci |
There was a problem hiding this comment.
Same with this test and others. Let's not block all PRs due to image changes, but rely on main_check runs to alert us side-channel to image/platform inconsistencies.
| _SETUP_ERRORS = ( | ||
| ApiException, | ||
| BotoCoreError, | ||
| ClientAuthenticationError, | ||
| CloudSetupError, | ||
| ConfigFileNotFound, | ||
| FileNotFoundError, | ||
| GoogleAuthError, | ||
| IBMClassicException, | ||
| InvalidConfig, | ||
| KeyError, | ||
| MissingPrerequisiteError, | ||
| ProfileNotFound, | ||
| RuntimeError, | ||
| ValueError, | ||
| ) |
There was a problem hiding this comment.
We are generally skipping on any error whatsoever, which feels a bit like we are likely of overlook true runtime errors, valueerrors and keywerrors that represent mis-configuration. Can we dial this list down a bit to specific failures we are trying to avoid? I think only absence of configuration for the platform in pycloudlib.toml should be a valid condition. The rest of these excceptions feel like they are ignoring mis-configured or partially configured environments.
| @contextmanager | ||
| def _cloud_or_skip(cloud_cls: type[BaseCloud]) -> Iterator[BaseCloud]: | ||
| """Instantiate cloud_cls or skip the test if credentials/prerequisites are absent.""" | ||
| try: |
There was a problem hiding this comment.
It might be worth first checking if the cloud platform type [qemu] [lxd] [ec2] etc is defined in pycloudlib.toml and skip if unconfigured to avoid trying to catch all the other exceptions and instead provide a clear skip messages about missing config.
| fi | ||
| if ! grep -q '^\[lxd\]' ~/.config/pycloudlib.toml 2>/dev/null; then | ||
| echo "[lxd]" >> ~/.config/pycloudlib.toml | ||
| fi |
There was a problem hiding this comment.
Rather than trying to fix an incorrect/empty PYCOUDLIB_TOML. Let's make this PYCOUDLIB_TOML secret required (like we do in cloud-init github workflows). Then we can have a clear error when the repo doesn't contain such a secret.
|
|
||
| jobs: | ||
| validate-images: | ||
| runs-on: ubuntu-24.04 |
There was a problem hiding this comment.
Let's add a conditional that prevents this workflow from running on any forked remotes. Limit it to run on canonical/pycloudlib repo (like we do in cloud-init scheduled workflows)
| run: | | ||
| sudo apt-get update -q | ||
| sudo apt-get install -qy distro-info | ||
| sudo snap install lxd |
There was a problem hiding this comment.
I think setup-lxd action does this.
Description
Additional Context and Relevant Issues
Fixes #541
Test Steps