diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2019-03-12 15:39:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-12 15:39:20 +0100 |
commit | 073c4bef9cbec17a30b41f9010cafd9aca327e1b (patch) | |
tree | 811b612c5c80167cf24094028814d7d0d89087fc /controller-server | |
parent | 61183241ef857806ed781e6495098c3f154844c9 (diff) | |
parent | 6090e861ec2c32012c21fa5d7358c373e6fc7e2a (diff) |
Merge pull request #8757 from vespa-engine/jvenstad/redistribute-memory-to-surefire-in-testers
Allocate 2Gb to tester app, and 75% of the rest to Surefire
Diffstat (limited to 'controller-server')
3 files changed, 10 insertions, 3 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java index 24721cafbe9..c64bc99d0c7 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java @@ -554,6 +554,11 @@ public class InternalStepRunner implements StepRunner { static byte[] servicesXml(SystemName systemName, Optional<String> testerFlavor) { String domain = systemName == SystemName.main ? "vespa.vespa" : "vespa.vespa.cd"; + String flavor = testerFlavor.orElse("d-1-4-50"); + int memoryGb = Integer.parseInt(flavor.split("-")[2]); // Memory available in tester container. + int jdiscMemoryPercentage = (int) Math.ceil(200.0 / memoryGb); // 2Gb memory for tester application (excessive?). + int testMemoryMb = 768 * (memoryGb - 2); // Memory allocated to Surefire running tests. ≥25% left for other stuff. + String servicesXml = "<?xml version='1.0' encoding='UTF-8'?>\n" + "<services xmlns:deploy='vespa' version='1.0'>\n" + @@ -562,6 +567,7 @@ public class InternalStepRunner implements StepRunner { " <component id=\"com.yahoo.vespa.hosted.testrunner.TestRunner\" bundle=\"vespa-testrunner-components\">\n" + " <config name=\"com.yahoo.vespa.hosted.testrunner.test-runner\">\n" + " <artifactsPath>artifacts</artifactsPath>\n" + + " <surefireMemoryMb>" + testMemoryMb + "</surefireMemoryMb>\n" + " </config>\n" + " </component>\n" + "\n" + @@ -594,7 +600,7 @@ public class InternalStepRunner implements StepRunner { " </filtering>\n" + " </http>\n" + "\n" + - " <nodes count=\"1\" flavor=\"" + testerFlavor.orElse("d-1-4-50") + "\" />\n" + + " <nodes count=\"1\" flavor=\"" + flavor + "\" allocated-memory=\"" + jdiscMemoryPercentage + "%\" />\n" + " </container>\n" + "</services>\n"; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java index f941e2ba7ca..a6755a96fdd 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunnerTest.java @@ -292,7 +292,7 @@ public class InternalStepRunnerTest { @Test public void generates_correct_services_xml_test() { - assertFile("test_runner_services.xml-cd", new String(InternalStepRunner.servicesXml(SystemName.cd, Optional.of("flavor")))); + assertFile("test_runner_services.xml-cd", new String(InternalStepRunner.servicesXml(SystemName.cd, Optional.of("d-2-12-75")))); } private void assertFile(String resourceName, String actualContent) { 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 b395d657e3d..15d3c98b995 100644 --- a/controller-server/src/test/resources/test_runner_services.xml-cd +++ b/controller-server/src/test/resources/test_runner_services.xml-cd @@ -5,6 +5,7 @@ <component id="com.yahoo.vespa.hosted.testrunner.TestRunner" bundle="vespa-testrunner-components"> <config name="com.yahoo.vespa.hosted.testrunner.test-runner"> <artifactsPath>artifacts</artifactsPath> + <surefireMemoryMb>7680</surefireMemoryMb> </config> </component> @@ -37,6 +38,6 @@ </filtering> </http> - <nodes count="1" flavor="flavor" /> + <nodes count="1" flavor="d-2-12-75" allocated-memory="17%" /> </container> </services> |