aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@users.noreply.github.com>2023-08-14 16:20:24 +0200
committerGitHub <noreply@github.com>2023-08-14 16:20:24 +0200
commit25a4b1fa51e2803dc528d1726ea2eddc04e46eea (patch)
treee5cd691771b5693973d220df4b866397056f8e1e
parente9840e436e7b2d1bfcf173d5ecf58cf030625b62 (diff)
parentddc6ee8e7fd20dbf1529806340345b4fd8a816a2 (diff)
Merge pull request #28038 from vespa-engine/freva/x86_for_tester_enclavev8.211.15
Use x86_64 for tester nodes in enclave
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackage.java11
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackageTest.java6
-rw-r--r--controller-server/src/test/resources/test_runner_services.xml-cd2
-rw-r--r--controller-server/src/test/resources/test_runner_services_with_legacy_tests.xml-cd2
4 files changed, 12 insertions, 9 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackage.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackage.java
index 790121b35dc..120c0a89f45 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackage.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackage.java
@@ -97,6 +97,8 @@ public class TestPackage {
keyPair = null;
this.certificate = null;
}
+ boolean isEnclave = isPublicSystem &&
+ !spec.cloudAccount(cloud, id.application().instance(), id.type().zone()).isUnspecified();
this.applicationPackageStream = new ApplicationPackageStream(inZip, () -> name -> name.endsWith(".xml"), () -> new Replacer() {
// Initially skips all declared entries, ensuring they're generated and appended after all input entries.
@@ -127,7 +129,7 @@ public class TestPackage {
__ -> new ByteArrayInputStream(servicesXml( ! isPublicSystem,
certificateValidFrom != null,
hasLegacyTests,
- testerResourcesFor(id.type().zone(), spec.requireInstance(id.application().instance())),
+ testerResourcesFor(id.type().zone(), spec.requireInstance(id.application().instance()), isEnclave),
testerApp)));
entries.put(deploymentFile,
@@ -225,7 +227,7 @@ public class TestPackage {
return new TestSummary(problems, suites);
}
- static NodeResources testerResourcesFor(ZoneId zone, DeploymentInstanceSpec spec) {
+ static NodeResources testerResourcesFor(ZoneId zone, DeploymentInstanceSpec spec, boolean isEnclave) {
NodeResources nodeResources = spec.steps().stream()
.filter(step -> step.concerns(zone.environment()))
.findFirst()
@@ -233,6 +235,7 @@ public class TestPackage {
.map(NodeResources::fromLegacyName)
.orElse(zone.region().value().matches("^(aws|gcp)-.*") ? DEFAULT_TESTER_RESOURCES_CLOUD
: DEFAULT_TESTER_RESOURCES);
+ if (isEnclave) nodeResources = nodeResources.with(NodeResources.Architecture.x86_64);
return nodeResources.with(NodeResources.DiskSpeed.any);
}
@@ -245,8 +248,8 @@ public class TestPackage {
// Of the remaining memory, split 50/50 between Surefire running the tests and the rest
int testMemoryMb = (int) (1024 * (resources.memoryGb() - jdiscMemoryGb) / 2);
- String resourceString = Text.format("<resources vcpu=\"%.2f\" memory=\"%.2fGb\" disk=\"%.2fGb\" disk-speed=\"%s\" storage-type=\"%s\"/>",
- resources.vcpu(), resources.memoryGb(), resources.diskGb(), resources.diskSpeed().name(), resources.storageType().name());
+ String resourceString = Text.format("<resources vcpu=\"%.2f\" memory=\"%.2fGb\" disk=\"%.2fGb\" disk-speed=\"%s\" storage-type=\"%s\" architecture=\"%s\"/>",
+ resources.vcpu(), resources.memoryGb(), resources.diskGb(), resources.diskSpeed().name(), resources.storageType().name(), resources.architecture().name());
String runtimeProviderClass = config.runtimeProviderClass();
String tenantCdBundle = config.tenantCdBundle();
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackageTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackageTest.java
index c948da6936c..4c61fe7c77d 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackageTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/application/pkg/TestPackageTest.java
@@ -221,10 +221,10 @@ public class TestPackageTest {
</deployment>
""");
- NodeResources firstResources = TestPackage.testerResourcesFor(ZoneId.from("prod", "gcp-us-west-1"), spec.requireInstance("first"));
- assertEquals(TestPackage.DEFAULT_TESTER_RESOURCES_CLOUD, firstResources);
+ NodeResources firstResources = TestPackage.testerResourcesFor(ZoneId.from("prod", "gcp-us-west-1"), spec.requireInstance("first"), true);
+ assertEquals(TestPackage.DEFAULT_TESTER_RESOURCES_CLOUD.with(NodeResources.Architecture.x86_64), firstResources);
- NodeResources secondResources = TestPackage.testerResourcesFor(ZoneId.from("prod", "us-west-1"), spec.requireInstance("second"));
+ NodeResources secondResources = TestPackage.testerResourcesFor(ZoneId.from("prod", "us-west-1"), spec.requireInstance("second"), false);
assertEquals(6, secondResources.vcpu(), 1e-9);
assertEquals(16, secondResources.memoryGb(), 1e-9);
assertEquals(100, secondResources.diskGb(), 1e-9);
diff --git a/controller-server/src/test/resources/test_runner_services.xml-cd b/controller-server/src/test/resources/test_runner_services.xml-cd
index 4bf3a78801d..35ad0d31577 100644
--- a/controller-server/src/test/resources/test_runner_services.xml-cd
+++ b/controller-server/src/test/resources/test_runner_services.xml-cd
@@ -33,7 +33,7 @@
</component>
<nodes count="1">
- <resources vcpu="2.00" memory="12.00Gb" disk="75.00Gb" disk-speed="fast" storage-type="local"/>
+ <resources vcpu="2.00" memory="12.00Gb" disk="75.00Gb" disk-speed="fast" storage-type="local" architecture="any"/>
</nodes>
</container>
</services>
diff --git a/controller-server/src/test/resources/test_runner_services_with_legacy_tests.xml-cd b/controller-server/src/test/resources/test_runner_services_with_legacy_tests.xml-cd
index 526fd12965b..91317f1490c 100644
--- a/controller-server/src/test/resources/test_runner_services_with_legacy_tests.xml-cd
+++ b/controller-server/src/test/resources/test_runner_services_with_legacy_tests.xml-cd
@@ -34,7 +34,7 @@
<nodes count="1">
<jvm allocated-memory="17%"/>
- <resources vcpu="2.00" memory="12.00Gb" disk="75.00Gb" disk-speed="fast" storage-type="local"/>
+ <resources vcpu="2.00" memory="12.00Gb" disk="75.00Gb" disk-speed="fast" storage-type="local" architecture="any"/>
</nodes>
</container>
</services>