aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/InternalStepRunner.java30
1 files changed, 10 insertions, 20 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 861c8089ed5..dc7fdeb8a98 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
@@ -115,6 +115,7 @@ public class InternalStepRunner implements StepRunner {
static final NodeResources DEFAULT_TESTER_RESOURCES_AWS =
new NodeResources(2, 8, 50, 0.3, NodeResources.DiskSpeed.any);
+ static final Duration capacityTimeout = Duration.ofMinutes(5);
static final Duration endpointTimeout = Duration.ofMinutes(15);
static final Duration endpointCertificateTimeout = Duration.ofMinutes(15);
static final Duration testerTimeout = Duration.ofMinutes(30);
@@ -173,34 +174,20 @@ public class InternalStepRunner implements StepRunner {
versions.sourcePlatform().orElse(versions.targetPlatform()) +
" and application version " +
versions.sourceApplication().orElse(versions.targetApplication()).id() + " ...");
- return deployReal(id, true, versions, logger);
+ return deployReal(id, true, logger);
}
private Optional<RunStatus> deployReal(RunId id, DualLogger logger) {
Versions versions = controller.jobController().run(id).get().versions();
logger.log("Deploying platform version " + versions.targetPlatform() +
" and application version " + versions.targetApplication().id() + " ...");
- return deployReal(id, false, versions, logger);
+ return deployReal(id, false, logger);
}
- private Optional<RunStatus> deployReal(RunId id, boolean setTheStage, Versions versions, DualLogger logger) {
- Optional<ApplicationPackage> applicationPackage = id.type().environment().isManuallyDeployed()
- ? Optional.of(new ApplicationPackage(controller.applications().applicationStore()
- .getDev(id.application(), id.type().zone(controller.system()))))
- : Optional.empty();
-
- Optional<Version> vespaVersion = id.type().environment().isManuallyDeployed()
- ? Optional.of(versions.targetPlatform()) // TODO jonmv: This makes it impossible to deploy on older majors — fix.
- : Optional.empty();
+ private Optional<RunStatus> deployReal(RunId id, boolean setTheStage, DualLogger logger) {
return deploy(id.application(),
id.type(),
- () -> controller.applications().deploy(id.application(),
- id.type().zone(controller.system()),
- applicationPackage,
- new DeployOptions(false,
- vespaVersion,
- false,
- setTheStage)),
+ () -> controller.applications().deploy2(id.job(), setTheStage),
controller.jobController().run(id).get()
.stepInfo(setTheStage ? deployInitialReal : deployReal).get()
.startTime().get(),
@@ -289,7 +276,9 @@ public class InternalStepRunner implements StepRunner {
return result;
case OUT_OF_CAPACITY:
logger.log(e.getServerMessage());
- return Optional.of(outOfCapacity);
+ return controller.system().isCd() && startTime.plus(capacityTimeout).isAfter(controller.clock().instant())
+ ? Optional.empty()
+ : Optional.of(outOfCapacity);
case INVALID_APPLICATION_PACKAGE:
case BAD_REQUEST:
logger.log(e.getMessage());
@@ -297,7 +286,8 @@ public class InternalStepRunner implements StepRunner {
}
throw e;
- } catch (EndpointCertificateException e) {
+ }
+ catch (EndpointCertificateException e) {
switch (e.type()) {
case CERT_NOT_AVAILABLE:
// Same as CERTIFICATE_NOT_READY above, only from the controller