mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(ec2): add AMD and Intel instance metadata (#8752)
DescribeInstanceTypes now knows 61 virtual sizes of M7a, M8a, M7i, M8i, C7a and C7i, captured in us-east-1 on 2026-11-17: their vCPUs, memory, x86_64 architecture, AMD or Intel manufacturer and network limits, 24xlarge and 48xlarge included. One integration test checks both the Graviton and the x86 captures through the API, and the catalog inventory takes its expected names from those captures. Closes #8755
This commit is contained in:
1 parent
783bd1a5fe
commit
8349e690ca
6 files changed
+952
-71
No files matched your search
+7
-5
@@ -21,12 +21,13 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
|
||||
@QuarkusTest
|
||||
class Ec2GravitonCatalogIntegrationTest {
|
||||
class Ec2InstanceMetadataIntegrationTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@CsvFileSource(resources = "/ec2/graviton-instance-types.csv", numLinesToSkip = 1)
|
||||
void gravitonMetadataAndOfferingsMatchAwsSnapshot(String name, int vcpus, long memoryMib,
|
||||
int maxInterfaces, int ipv4PerInterface, boolean encryptionInTransit, boolean currentGeneration) {
|
||||
@CsvFileSource(resources = {"/ec2/graviton-instance-types.csv", "/ec2/x86-instance-types.csv"}, numLinesToSkip = 1)
|
||||
void metadataAndOfferingsMatchAwsSnapshot(String name, int vcpus, long memoryMib,
|
||||
int maxInterfaces, int ipv4PerInterface, boolean encryptionInTransit, boolean currentGeneration,
|
||||
String architecture, String manufacturer) {
|
||||
try (Ec2Client ec2 = AwsTestClients.create(Ec2Client.builder(), "test", Region.US_EAST_1)) {
|
||||
List<InstanceTypeInfo> types = ec2.describeInstanceTypes(r -> r.instanceTypesWithStrings(name)).instanceTypes();
|
||||
assertThat(types, hasSize(1));
|
||||
@@ -34,7 +35,8 @@ class Ec2GravitonCatalogIntegrationTest {
|
||||
assertEquals(name, type.instanceTypeAsString());
|
||||
assertEquals(vcpus, type.vCpuInfo().defaultVCpus());
|
||||
assertEquals(memoryMib, type.memoryInfo().sizeInMiB());
|
||||
assertThat(type.processorInfo().supportedArchitecturesAsStrings(), contains("arm64"));
|
||||
assertThat(type.processorInfo().supportedArchitecturesAsStrings(), contains(architecture));
|
||||
assertEquals(manufacturer, type.processorInfo().manufacturer());
|
||||
assertEquals(currentGeneration, type.currentGeneration());
|
||||
assertFalse(type.instanceStorageSupported());
|
||||
assertFalse(type.burstablePerformanceSupported());
|
||||
@@ -4,6 +4,10 @@ import io.quarkus.test.junit.QuarkusTest;
|
||||
import jakarta.inject.Inject;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -23,7 +27,7 @@ class Ec2InstanceTypeCatalogTest {
|
||||
Ec2InstanceTypeCatalog instanceTypeCatalog;
|
||||
|
||||
@Test
|
||||
void catalogContainsCurrentTypesAndLargeGravitonTypes() {
|
||||
void catalogContainsCurrentTypesAndCapturedInstanceTypes() throws IOException {
|
||||
Set<String> instanceTypes = instanceTypeCatalog.instanceTypes().stream()
|
||||
.map(instanceType -> instanceType.instanceType)
|
||||
.collect(Collectors.toSet());
|
||||
@@ -55,12 +59,15 @@ class Ec2InstanceTypeCatalogTest {
|
||||
"m8gd.medium",
|
||||
"m8gd.large",
|
||||
"m8gd.2xlarge"));
|
||||
for (String family : List.of("c6g", "c6gn", "c7g", "c8g", "m6g", "m7g", "m8g")) {
|
||||
for (String size : List.of("medium", "large", "xlarge", "2xlarge", "4xlarge", "8xlarge", "12xlarge", "16xlarge")) {
|
||||
expected.add(family + "." + size);
|
||||
for (String resource : List.of("/ec2/graviton-instance-types.csv", "/ec2/x86-instance-types.csv")) {
|
||||
try (BufferedReader rows = new BufferedReader(new InputStreamReader(
|
||||
getClass().getResourceAsStream(resource), StandardCharsets.UTF_8))) {
|
||||
rows.lines().skip(1)
|
||||
.filter(row -> !row.isBlank() && !row.startsWith("#"))
|
||||
.map(row -> row.substring(0, row.indexOf(',')))
|
||||
.forEach(expected::add);
|
||||
}
|
||||
}
|
||||
expected.addAll(List.of("c8g.24xlarge", "c8g.48xlarge", "m8g.24xlarge", "m8g.48xlarge"));
|
||||
assertEquals(expected, instanceTypes);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user