Switch to using the golden-images.json generated on the golden images repo

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2022-11-26 11:34:38 +00:00 committed by Megan Wilhite
parent 7cc90bafc1
commit f4ef84414f
5 changed files with 172 additions and 78 deletions

View file

@ -205,7 +205,7 @@ jobs:
- get-changed-files
uses: ./.github/workflows/test-action.yml
with:
distro-slug: photon-3
distro-slug: photonos-3
nox-session: ci-test-3
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
@ -215,7 +215,7 @@ jobs:
- get-changed-files
uses: ./.github/workflows/test-action.yml
with:
distro-slug: photon-4
distro-slug: photonos-4
nox-session: ci-test-3
changed-files: ${{ needs.get-changed-files.outputs.changed-files }}

View file

@ -41,7 +41,7 @@ jobs:
uses: actions/cache@v3
with:
path: nox.${{ inputs.distro-slug }}.tar.*
key: testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt') }}
key: testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
# Skip jobs if nox.*.tar.* is already cached
- name: PyPi Proxy
@ -129,7 +129,7 @@ jobs:
uses: actions/cache@v3
with:
path: nox.${{ inputs.distro-slug }}.tar.*
key: testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt') }}
key: testrun-deps|${{ inputs.distro-slug }}|${{ inputs.nox-session }}|${{ hashFiles('requirements/**/*.txt', 'cicd/golden-images.json') }}
- name: PyPi Proxy
run: |

159
cicd/golden-images.json Normal file
View file

@ -0,0 +1,159 @@
{
"almalinux-8": {
"ami": "ami-067a5cdcc1fd2ebcc",
"ssh_username": "ec2-user",
"description": "CI Image of AlmaLinux 8 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"almalinux-9": {
"ami": "ami-09c8a570e4f1052de",
"ssh_username": "ec2-user",
"description": "CI Image of AlmaLinux 9 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"amazonlinux-2": {
"ami": "ami-02ee110baacff4531",
"ssh_username": "ec2-user",
"description": "CI Image of AmazonLinux 2 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"archlinux-lts": {
"ami": "ami-0f28c74e7182b51a1",
"ssh_username": "arch",
"description": "CI Image of ArchLinux lts x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"centos-7": {
"ami": "ami-079bc5af02dd43599",
"ssh_username": "centos",
"description": "CI Image of CentOS 7 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"centosstream-8": {
"ami": "ami-0ae3ccacf38ee6ab5",
"ssh_username": "cloud-user",
"description": "CI Image of CentOSStream 8 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"centosstream-9": {
"ami": "ami-080357bb9adf7d469",
"ssh_username": "ec2-user",
"description": "CI Image of CentOSStream 9 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"debian-10": {
"ami": "ami-08896364e62754785",
"ssh_username": "admin",
"description": "CI Image of Debian 10 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"debian-11-arm64": {
"ami": "ami-06eb7aa7371ed9195",
"ssh_username": "admin",
"description": "CI Image of Debian 11 arm64",
"instance_type": "m6g.large",
"is_windows": "false"
},
"debian-11": {
"ami": "ami-0a663124a1bb84ccf",
"ssh_username": "admin",
"description": "CI Image of Debian 11 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"fedora-36": {
"ami": "ami-089ae8a4426c40fba",
"ssh_username": "fedora",
"description": "CI Image of Fedora 36 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"opensuse-15": {
"ami": "ami-07bbdf04f705a9d02",
"ssh_username": "ec2-user",
"description": "CI Image of Opensuse 15 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"photonos-3": {
"ami": "ami-034745cbe0bb6ecdc",
"ssh_username": "root",
"description": "CI Image of PhotonOS 3 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"photonos-4": {
"ami": "ami-05edadcbb2f548034",
"ssh_username": "root",
"description": "CI Image of PhotonOS 4 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"ubuntu-18.04": {
"ami": "ami-05dd8fbd1956ebb29",
"ssh_username": "ubuntu",
"description": "CI Image of Ubuntu 18.04 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"ubuntu-20.04-arm64": {
"ami": "ami-0476eecde31af50c8",
"ssh_username": "ubuntu",
"description": "CI Image of Ubuntu 20.04 arm64",
"instance_type": "m6g.large",
"is_windows": "false"
},
"ubuntu-20.04": {
"ami": "ami-0f1a51d8243116f07",
"ssh_username": "ubuntu",
"description": "CI Image of Ubuntu 20.04 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"ubuntu-22.04-arm64": {
"ami": "ami-0345ebb9e525d9130",
"ssh_username": "ubuntu",
"description": "CI Image of Ubuntu 22.04 arm64",
"instance_type": "m6g.large",
"is_windows": "false"
},
"ubuntu-22.04": {
"ami": "ami-0e9d74bf85e872a4a",
"ssh_username": "ubuntu",
"description": "CI Image of Ubuntu 22.04 x86_64",
"instance_type": "t3a.large",
"is_windows": "false"
},
"windows-2016": {
"ami": "ami-038b73a0454552d80",
"ssh_username": "Administrator",
"description": "CI Image of Windows 2016 x86_64",
"instance_type": "t3a.xlarge",
"is_windows": "true",
"connect_timeout": 900
},
"windows-2019": {
"ami": "ami-077f0e04bbe8d99c4",
"ssh_username": "Administrator",
"description": "CI Image of Windows 2019 x86_64",
"instance_type": "t3a.xlarge",
"is_windows": "true",
"connect_timeout": 900
},
"windows-2022": {
"ami": "ami-0351d790177ac76b4",
"ssh_username": "Administrator",
"description": "CI Image of Windows 2022 x86_64",
"instance_type": "t3a.xlarge",
"is_windows": "true",
"connect_timeout": 900
}
}

View file

@ -1,69 +0,0 @@
almalinux-8:
ami: ami-0df53d3f4a1ee9420
ssh_username: ec2-user
almalinux-9:
ami: ami-0f6a5ff68c04a2760
ssh_username: ec2-user
amazonlinux-2:
ami: ami-0631509a3d40b425a
ssh_username: ec2-user
archlinux-lts:
ami: ami-05a749ef2a8986f59
ssh_username: arch
centos-7:
ami: ami-0f48ea64299ccf113
ssh_username: centos
centosstream-8:
ami: ami-0bec85c3e44ab9a7a
ssh_username: centos
centosstream-9:
ami: ami-0fc1d9ed17d20db23
ssh_username: ec2-user
debian-10:
ami: ami-092e81e6c422fea70
ssh_username: admin
debian-11:
ami: ami-09e20b4c0ba622471
ssh_username: admin
debian-11-arm64:
ami: ami-0500a39fa2a003447
ssh_username: admin
fedora-36:
ami: ami-0c0a78b5698996cb8
ssh_username: fedora
opensuse-15:
ami: ami-06b599899cc9244da
ssh_username: ec2-user
photon-3:
ami: ami-0b2bb2f8068371689
ssh_username: root
photon-4:
ami: ami-059236bac08127536
ssh_username: root
ubuntu-18.04:
ami: ami-07bff54ae445183ae
ssh_username: ubuntu
ubuntu-20.04:
ami: ami-0f4ff8a2a917a7dd8
ssh_username: ubuntu
ubuntu-20.04-arm64:
ami: ami-0bd193a6641e9bb28
ssh_username: ubuntu
ubuntu-22.04:
ami: ami-0a6d70b2b169165c5
ssh_username: ubuntu
ubuntu-22.04-arm64:
ami: ami-08b0130f1b6636bc3
ssh_username: ubuntu
windows-2016:
ami: ami-02d3362124c581e3e
ssh_username: Administrator
connect_timeout: 600
windows-2019:
ami: ami-0b7b27fa39b7e2863
ssh_username: Administrator
connect_timeout: 600
windows-2022:
ami: ami-06bcb3758f7519a16
ssh_username: Administrator
connect_timeout: 600

View file

@ -18,7 +18,6 @@ import textwrap
import time
from datetime import datetime
from functools import lru_cache
from operator import attrgetter
from typing import TYPE_CHECKING, cast
from ptscripts import Context, command_group
@ -26,7 +25,6 @@ from ptscripts import Context, command_group
try:
import attr
import boto3
import yaml
from botocore.exceptions import ClientError
from rich.progress import (
BarColumn,
@ -53,8 +51,8 @@ log = logging.getLogger(__name__)
REPO_ROOT = pathlib.Path(__file__).parent.parent
STATE_DIR = REPO_ROOT / ".vms-state"
with REPO_ROOT.joinpath("cicd", "images.yml").open() as rfh:
AMIS = yaml.safe_load(rfh)
with REPO_ROOT.joinpath("cicd", "golden-images.json").open() as rfh:
AMIS = json.load(rfh)
REPO_CHECKOUT_ID = hashlib.sha256(
"|".join(list(platform.uname()) + [str(REPO_ROOT)]).encode()
).hexdigest()
@ -380,7 +378,13 @@ class VM:
@config.default
def _config_default(self):
config = AMIConfig(**AMIS[self.name])
config = AMIConfig(
**{
key: value
for (key, value) in AMIS[self.name].items()
if key in AMIConfig.__annotations__
}
)
log.info(f"Loaded VM Configuration:\n{config}")
return config