aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java3
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java27
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java5
3 files changed, 33 insertions, 2 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
index 5dacaf9b0db..4e71307dc65 100644
--- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
+++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java
@@ -43,6 +43,9 @@ public interface ConfigServer {
Map<?,?> getServiceApiResponse(String tenantName, String applicationName, String instanceName, String environment, String region, String serviceName, String restPath);
Optional<Logs> getLogs(DeploymentId deployment, HashMap<String, String> queryParameters);
+
+ List<String> getStorageClusters(DeploymentId deployment);
+
/**
* Set new status on en endpoint in one zone.
*
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 ab6d3846b41..0fde89849c7 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
@@ -1,6 +1,7 @@
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.hosted.controller.deployment;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.yahoo.component.Version;
@@ -333,12 +334,15 @@ public class InternalStepRunner implements StepRunner {
return Optional.empty();
}
+ Map<ZoneId, List<String>> clusters = listClusters(id.application());
+
Optional<URI> testerEndpoint = controller.jobController().testerEndpoint(id);
if (testerEndpoint.isPresent() && controller.jobController().cloud().ready(testerEndpoint.get())) {
logger.log("Starting tests ...");
controller.jobController().cloud().startTests(testerEndpoint.get(),
TesterCloud.Suite.of(id.type()),
- testConfig(id.application(), id.type().zone(controller.system()), controller.system(), endpoints));
+ testConfig(id.application(), id.type().zone(controller.system()),
+ controller.system(), endpoints, clusters));
return Optional.of(running);
}
@@ -464,6 +468,14 @@ public class InternalStepRunner implements StepRunner {
return deployments.build();
}
+ /** Returns all clusters in all current deployments of the given real application. */
+ private Map<ZoneId, List<String>> listClusters(ApplicationId id) {
+ ImmutableMap.Builder<ZoneId, List<String>> clusters = ImmutableMap.builder();
+ application(id).deployments().keySet()
+ .forEach(zone -> clusters.put(zone, ImmutableList.copyOf(controller.configServer().getStorageClusters(new DeploymentId(id, zone)))));
+ return clusters.build();
+ }
+
/** Returns the generated services.xml content for the tester application. */
static byte[] servicesXml(SystemName systemName) {
String domain = systemName == SystemName.main ? "vespa.vespa" : "vespa.vespa.cd";
@@ -524,18 +536,29 @@ public class InternalStepRunner implements StepRunner {
}
/** Returns the config for the tests to run for the given job. */
- private static byte[] testConfig(ApplicationId id, ZoneId testerZone, SystemName system, Map<ZoneId, List<URI>> deployments) {
+ private static byte[] testConfig(ApplicationId id, ZoneId testerZone, SystemName system,
+ Map<ZoneId, List<URI>> deployments, Map<ZoneId, List<String>> clusters) {
Slime slime = new Slime();
Cursor root = slime.setObject();
+
root.setString("application", id.serializedForm());
root.setString("zone", testerZone.value());
root.setString("system", system.name());
+
Cursor endpointsObject = root.setObject("endpoints");
deployments.forEach((zone, endpoints) -> {
Cursor endpointArray = endpointsObject.setArray(zone.value());
for (URI endpoint : endpoints)
endpointArray.addString(endpoint.toString());
});
+
+ Cursor clustersObject = root.setObject("clusters");
+ clusters.forEach((zone, clusterList) -> {
+ Cursor clusterArray = clustersObject.setArray(zone.value());
+ for (String cluster : clusterList)
+ clusterArray.addString(cluster);
+ });
+
try {
return SlimeUtils.toJsonBytes(slime);
}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
index b0b3b352726..45c4f2854d3 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ConfigServerMock.java
@@ -302,6 +302,11 @@ public class ConfigServerMock extends AbstractComponent implements ConfigServer
return Optional.of(new Logs(logs));
}
+ @Override
+ public List<String> getStorageClusters(DeploymentId deployment) {
+ return Collections.singletonList("music");
+ }
+
public static class Application {
private final ApplicationId id;