Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(images): avoid wrong AMI selected for ubuntu jammy #3747

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

rslotte
Copy link
Contributor

@rslotte rslotte commented Feb 2, 2024

This PR fixes the exact same issue as: #2214

but for ubuntu jammy instead.

Using the aws cli we can see Canonical have published eks images which match the old ami filter:

$ aws ec2 describe-images --owners "099720109477" --filters "Name=name,Values=*/ubuntu-jammy-22.04-amd64-server-*" "Name=root-device-type,Values=ebs" "Name=virtualization-type,Values=hvm" --query 'reverse(sort_by(Images,&CreationDate))[:10].{id:ImageId,date:CreationDate,name:Name}'
[
    {
        "id": "ami-076c5927ad06134ea",
        "date": "2024-02-01T14:32:11.000Z",
        "name": "ubuntu-eks/k8s_1.29/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240201"
    },
    {
        "id": "ami-01daded1d6569f09c",
        "date": "2024-01-31T23:50:34.000Z",
        "name": "ubuntu-eks/k8s_1.29/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240131"
    },
    {
        "id": "ami-0f244b28200b93640",
        "date": "2024-01-26T02:50:50.000Z",
        "name": "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240126"
    },
...

which causes the ami build to flip-flop between the standard Ubuntu server and the EKS optimised one (which is lacking in several tools) causing workflows to fail with unexpected errors.

The updated filter returns only the expected images:

$ aws ec2 describe-images --owners "099720109477" --filters "Name=name,Values=*ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*" "Name=root-device-type,Values=ebs" "Name=virtualization-type,Values=hvm" --query 'reverse(sort_by(Images,&CreationDate))[:10].{id:ImageId,date:CreationDate,name:Name}'
[
    {
        "id": "ami-0f244b28200b93640",
        "date": "2024-01-26T02:50:50.000Z",
        "name": "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240126"
    },
    {
        "id": "ami-03559713c297ec8fb",
        "date": "2024-01-25T02:42:50.000Z",
        "name": "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240125"
    },
    {
        "id": "ami-0aad72a0b9d9baec1",
        "date": "2024-01-24T11:01:15.000Z",
        "name": "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-20240124"
    },
...

Copy link
Member

@npalm npalm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rslotte thx!

@npalm npalm merged commit 595aec9 into philips-labs:main Feb 8, 2024
41 checks passed
npalm pushed a commit that referenced this pull request Feb 12, 2024
🤖 I have created a release *beep* *boop*
---


##
[5.7.0](v5.6.3...v5.7.0)
(2024-02-12)


### Features

* allow setting VPC and subnets per runner
([#3467](#3467))
([1288c81](1288c81))


### Bug Fixes

* Correct typo in README.md
([#3758](#3758))
([7186c1c](7186c1c))
* **images:** avoid wrong AMI selected for ubuntu jammy
([#3747](#3747))
([595aec9](595aec9))
* **lambda:** bump @aws-lambda-powertools/logger from 1.17.0 to 1.18.0
in /lambdas
([#3754](#3754))
([98131ff](98131ff))
* **lambda:** bump axios from 1.6.2 to 1.6.7 in /lambdas
([#3755](#3755))
([80a34bd](80a34bd))
* **lambda:** bump the aws group in /lambdas with 5 updates
([#3730](#3730))
([7854a5f](7854a5f))
* **lambda:** bump the aws group in /lambdas with 5 updates
([#3743](#3743))
([7ca40ef](7ca40ef))
* **lambda:** bump the aws group in /lambdas with 5 updates
([#3753](#3753))
([9f3aa68](9f3aa68))
* windows userdata does not support gzip
([#3759](#3759))
([b74df54](b74df54))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: forest-releaser[bot] <80285352+forest-releaser[bot]@users.noreply.github.com>
@rslotte rslotte deleted the refine_ubuntu_ami_filter branch February 14, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants