diff options
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted')
3 files changed, 6 insertions, 7 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 1080b379c4d..24e0bea3b44 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 @@ -186,7 +186,7 @@ public class InternalStepRunner implements StepRunner { return deploy(() -> controller.applications().deploy(id.job(), setTheStage, logger::log, - account -> getCloudAccountWithOverrideForStaging(id, account)), + account -> getAndSetCloudAccountWithOverrideForStaging(id, account)), controller.jobController().run(id) .stepInfo(setTheStage ? deployInitialReal : deployReal).get() .startTime().get(), @@ -224,7 +224,7 @@ public class InternalStepRunner implements StepRunner { return account; } - private Optional<CloudAccount> getCloudAccountWithOverrideForStaging(RunId id, Optional<CloudAccount> account) { + private Optional<CloudAccount> getAndSetCloudAccountWithOverrideForStaging(RunId id, Optional<CloudAccount> account) { if (id.type().environment() == Environment.staging) { Instant doom = controller.clock().instant().plusSeconds(60); // Sleeping is bad, but we're already in a sleepy code path: deployment. while (true) { @@ -233,10 +233,6 @@ public class InternalStepRunner implements StepRunner { if (stored.isPresent()) return stored.filter(not(CloudAccount.empty::equals)); - // TODO jonmv: remove with next release - if (run.stepStatus(deployTester).get() != unfinished) - return account; // Use original value for runs which started prior to this code change, and resumed after. Extremely unlikely :> - long millisToDoom = Duration.between(controller.clock().instant(), doom).toMillis(); if (millisToDoom > 0) uncheckInterruptedAndRestoreFlag(() -> Thread.sleep(min(millisToDoom, 5000))); @@ -244,6 +240,7 @@ public class InternalStepRunner implements StepRunner { throw new CloudAccountNotSetException("Cloud account not yet set; must deploy tests first"); } } + account.ifPresent(cloudAccount -> controller.jobController().locked(id, run -> run.with(cloudAccount))); return account; } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java index e92a70c3b4e..2b207e6662b 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/Run.java @@ -276,7 +276,7 @@ public class Run { /** Whether this is a dry run deployment. */ public boolean isDryRun() { return dryRun; } - /** Cloud account override to use for this run, if set. This should only be used by staging tests. */ + /** Cloud account used for deployments in this run. This is set by the first deployment. */ public Optional<CloudAccount> cloudAccount() { return cloudAccount; } /** The specific reason for triggering this run, if any. This should be empty for jobs triggered bvy deployment orchestration. */ diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java index 3e147459dd0..18221d82e44 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/JobControllerApiHandlerHelper.java @@ -519,6 +519,8 @@ class JobControllerApiHandlerHelper { run.end().ifPresent(end -> runObject.setLong("end", end.toEpochMilli())); runObject.setString("status", nameOf(run.status())); toSlime(runObject, run.versions(), run.reason(), application); + run.cloudAccount().filter(account -> ! account.isUnspecified()) + .ifPresent(cloudAccount -> runObject.setObject("enclave").setString("cloudAccount", cloudAccount.value())); Cursor runStepsArray = runObject.setArray("steps"); run.steps().forEach((step, info) -> { Cursor runStepObject = runStepsArray.addObject(); |