From ddc6ee8e7fd20dbf1529806340345b4fd8a816a2 Mon Sep 17 00:00:00 2001 From: Valerij Fredriksen Date: Mon, 14 Aug 2023 11:59:22 +0200 Subject: Use x86_64 for tester nodes in enclave --- .../vespa/hosted/controller/application/pkg/TestPackage.java | 11 +++++++---- .../hosted/controller/application/pkg/TestPackageTest.java | 6 +++--- .../src/test/resources/test_runner_services.xml-cd | 2 +- .../resources/test_runner_services_with_legacy_tests.xml-cd | 2 +- 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(), resources.memoryGb(), resources.diskGb(), resources.diskSpeed().name(), resources.storageType().name()); + String resourceString = Text.format("", + 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 { """); - 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 @@ - + 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 @@ - + -- cgit v1.2.3