fix: new selection process (#74)

Signed-off-by: matttrach <matt.trachier@suse.com>
This commit is contained in:
Matt Trachier 2024-05-28 16:53:38 -05:00 committed by GitHub
parent 7ef6982af7
commit 32d7021d10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 37 additions and 68 deletions

View File

@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1716358718,
"narHash": "sha256-NQbegJb2ZZnAqp2EJhWwTf6DrZXSpA6xZCEq+RGV1r0=",
"lastModified": 1716715802,
"narHash": "sha256-usk0vE7VlxPX8jOavrtpOqphdfqEQpf9lgedlY/r66c=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "3f316d2a50699a78afe5e77ca486ad553169061e",
"rev": "e2dd4e18cc1c7314e24154331bae07df76eb582f",
"type": "github"
},
"original": {

15
modules/image/getImages.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
TYPE="$1"
if [ -z "$TYPE" ]; then echo "Usage: $0 <type>"; exit 1; fi
NAME="$(curl -qs https://susepubliccloudinfo.suse.com/v1/amazon/images | jq '.images[] |
select(.state == "active") |
select(.region | contains("us-")) |
select(.name | contains("sapcal") | not) |
select(.name | contains("hvm-ssd-x86_64")) |
select(.name | contains("'$TYPE'"))' |
jq -s 'unique_by(.name)' |
jq -r '.[].name')"
aws ec2 describe-images --filter="Name=name,Values=$NAME" | jq -r '.Images[0]'

View File

@ -1,73 +1,27 @@
locals {
standard_types = {
# getting names from https://pint.suse.com/?resource=images&state=active&search=suse-sles-15-sp5-v
# suse-sles-15-sp5-v20240430-hvm-ssd-x86_64
sles-15 = {
user = "ec2-user",
group = "wheel",
name = "suse-sles-15-sp5-v*-hvm-ssd-x86_64",
name_regex = "^suse-sles-15-sp5-v[0-9]+-hvm-ssd-x86_64$",
product_code = "",
owners = ["013907871322", "679593333241"]
architecture = "x86_64",
workfolder = "~"
},
# getting names from https://pint.suse.com/?resource=images&search=suse-sles-15-sp5-chost-byos-v&state=active
# using the getImages script in this directory with argument "sles-15-sp5-chost"
# suse-sles-15-sp5-chost-byos-v20240502-hvm-ssd-x86_64
sles-15-byos = { # BYOS = Bring Your Own Subscription, only use this if you have a subscription to SUSE
sles-15 = { # BYOS = Bring Your Own Subscription
user = "ec2-user",
group = "wheel",
name = "suse-sles-15-sp5-chost-byos-v*-hvm-ssd-x86_64", #chost refers to an image that is optimized for running containers
name_regex = "^suse-sles-15-sp5-chost-byos-v[0-9]+-hvm-ssd-x86_64$", # we are specifically trying to avoid the -ecs- images
product_code = "",
owners = ["013907871322", "679593333241"],
owners = ["013907871322"],
architecture = "x86_64",
workfolder = "~"
},
# WARNING! Subscribe to image first: https://aws.amazon.com/marketplace/pp/prodview-g5eyen7n5tizm
sles-15-cis = {
user = "ec2-user",
group = "wheel",
name = "CIS SUSE Linux Enterprise 15*",
name_regex = ".*",
product_code = "eyyau7kd5j7nc7xa9ilf8db3j",
owners = ["679593333241"],
architecture = "x86_64",
workfolder = "~"
},
# getting names from https://pint.suse.com/?resource=images&search=suse-sle-micro-5-5-v&state=active
# suse-sle-micro-5-5-v20240113-hvm-ssd-x86_64-llc
sle-micro-55-llc = { # llc refers to SUSE subsidiary incorporation type, in general the LLC images are used in the US and Asia-Pacific
user = "suse",
group = "wheel",
name = "suse-sle-micro-5-5-v*-hvm-ssd-x86_64-llc*",
name_regex = "^suse-sle-micro-5-5-v[0-9]+-hvm-ssd-x86_64-llc.$",
product_code = "",
owners = ["013907871322", "679593333241"],
architecture = "x86_64",
workfolder = "~"
}
# getting names from https://pint.suse.com/?resource=images&search=suse-sle-micro-5-5-v&state=active
# suse-sle-micro-5-5-v20240113-hvm-ssd-x86_64-ltd
sle-micro-55-ltd = { # ltd refers to SUSE subsidiary incorporation type, in general the LTD images are used in the Europe, the Middle East, and Africa (EMEA)
user = "suse",
group = "wheel",
name = "suse-sle-micro-5-5-v*-hvm-ssd-x86_64-ltd*",
name_regex = "^suse-sle-micro-5-5-v[0-9]+-hvm-ssd-x86_64-ltd.*$",
product_code = "",
owners = ["013907871322", "679593333241"],
architecture = "x86_64",
workfolder = "~"
}
# getting names from https://pint.suse.com/?resource=images&search=suse-sle-micro-5-5-byos-v&state=active
# using the getImages script in this directory with argument "sle-micro-5-5-byos"
# suse-sle-micro-5-5-byos-v20240113-hvm-ssd-x86_64
sle-micro-55-byos = { # BYOS = Bring Your Own Subscription, only use this if you already have a subscription to SUSE
# sle micro is already optimized for containers
sle-micro-55 = { # BYOS = Bring Your Own Subscription
user = "suse",
group = "wheel",
name = "suse-sle-micro-5-5-byos-v*-hvm-ssd-x86_64",
name_regex = "^suse-sle-micro-5-5-byos-v[0-9]+-hvm-ssd-x86_64$",
product_code = "",
owners = ["013907871322", "679593333241"],
owners = ["013907871322"],
architecture = "x86_64",
workfolder = "~"
}
@ -130,6 +84,18 @@ locals {
architecture = "x86_64",
workfolder = "~"
},
# following the same lines as rhel-9 this will be the most recent even minor that has been released
# expect RHEL 8.10 in June 2024
rhel-8 = {
user = "ec2-user",
group = "wheel",
name = "RHEL-8.9*_HVM-2024*-x86_64-*-Hourly2-GP3",
name_regex = "^RHEL-8.9.*_HVM-2024.*-x86_64-.*-Hourly2-GP3$",
product_code = "",
owners = ["309956199498"],
architecture = "x86_64",
workfolder = "~"
},
# the goal for these search strings is to keep them as stable as possible without specifying a version that is EOL
# our users often rely on extended support from RHEL, so we don't consider odd numbered minors which are inelegible for that
# https://access.redhat.com/support/policy/updates/errata
@ -145,17 +111,5 @@ locals {
architecture = "x86_64",
workfolder = "~"
},
# following the same lines as rhel-9 this will be the most recent even minor that has been released
# expect RHEL 8.10 in June 2024
rhel-8 = {
user = "ec2-user",
group = "wheel",
name = "RHEL-8.9*_HVM-2024*-x86_64-*-Hourly2-GP3",
name_regex = "^RHEL-8.9.*_HVM-2024.*-x86_64-.*-Hourly2-GP3$",
product_code = "",
owners = ["309956199498"],
architecture = "x86_64",
workfolder = "~"
},
}
}