Skip to content

Commit

Permalink
(CAT-1545) - Add machine type to matrix
Browse files Browse the repository at this point in the history
This commit adds a machine_type field to each object in the matrix
platforms.
This means that for arm-based architectures, we can return the
t2a-standard-2 machine which supports arm.
If not arm based, then resort back to default.
  • Loading branch information
jordanbreen28 committed Nov 9, 2023
1 parent 367db32 commit a112000
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion exe/matrix_from_metadata_v2
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ else
matrix[:platforms] << {
label: image_key,
provider: 'provision_service',
image: IMAGE_TABLE[image_key]
image: IMAGE_TABLE[image_key],
# if the image is to be an ARM based instance, use t2a-standard-2 machine type
machine_type: image_key.include?('arm') ? 't2a-standard-2' : 'n1-standard-2'
}
elsif DOCKER_PLATFORMS.key?(image_key) && !exclude_list.include?(image_key.downcase)
matrix[:platforms] << {
Expand Down
10 changes: 5 additions & 5 deletions spec/exe/matrix_from_metadata_v2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
'matrix={',
'"platforms":[',
'{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"},',
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8","machine_type":"n1-standard-2"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"},',
'{"label":"Ubuntu-18.04","provider":"docker","image":"litmusimage/ubuntu:18.04"}',
'],',
'"collection":[',
Expand Down Expand Up @@ -61,8 +61,8 @@
'matrix={',
'"platforms":[',
'{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}',
'{"label":"RedHat-8","provider":"provision_service","image":"rhel-8","machine_type":"n1-standard-2"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"}',
'],',
'"collection":[',
'"puppet7-nightly","puppet8-nightly"',
Expand Down Expand Up @@ -99,7 +99,7 @@
'matrix={',
'"platforms":[',
'{"label":"CentOS-6","provider":"docker","image":"litmusimage/centos:6"},',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64"}',
'{"label":"RedHat-9-arm","provider":"provision_service","image":"rhel-9-arm64","machine_type":"t2a-standard-2"}',
'],',
'"collection":[',
'"puppet7-nightly","puppet8-nightly"',
Expand Down

0 comments on commit a112000

Please sign in to comment.