aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2023-01-02 13:44:33 +0100
committerGitHub <noreply@github.com>2023-01-02 13:44:33 +0100
commitbc94090458e663115b41459d917c160032709d39 (patch)
treefe703e334855ab7acac2fc9217aba86b6d2b9748
parent0606d3e28d68502e10e079ef9a90f5a5cd857d5a (diff)
parentff96cefe5a0cc8f940b235e4e90e899207919479 (diff)
Merge pull request #25349 from vespa-engine/jonmv/test-jobs-should-not-influence-compile-version
Test jobs have no permanent runtime versions
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java7
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java2
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java5
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java2
4 files changed, 10 insertions, 6 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
index 1bcef125e8c..28673cdc1d2 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java
@@ -324,15 +324,16 @@ public class ApplicationController {
/** Returns the oldest Vespa version installed on any active or reserved production node for the given application. */
public Optional<Version> oldestInstalledPlatform(Application application) {
return controller.jobController().deploymentStatus(application).jobs()
- .production().asList()
- .stream()
+ .production()
+ .not().test()
+ .asList().stream()
.map(this::oldestInstalledPlatform)
.flatMap(Optional::stream)
.min(naturalOrder());
}
/**
- * Returns the preferred Vespa version to compile against, for the given application, optionally restricted to a major.
+ * Returns the preferred Vespa version to compile against, for
* <p>
* The returned version is not newer than the oldest deployed platform for the application, unless
* the target major differs from the oldest deployed platform, in which case it is not newer than
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
index 71e781ed5ed..ef4ee16217e 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentStatus.java
@@ -181,7 +181,7 @@ public class DeploymentStatus {
// If compatibility platform is present, require that jobs have previously been run on that platform's major.
// If platform is not present, app is already on the (old) platform iff. it has production deployments.
- boolean alreadyDeployedOnPlatform = augmented.platform().map(platform -> allJobs.production().asList().stream()
+ boolean alreadyDeployedOnPlatform = augmented.platform().map(platform -> allJobs.production().not().test().asList().stream()
.anyMatch(job -> job.runs().values().stream()
.anyMatch(run -> run.versions().targetPlatform().getMajor() == platform.getMajor())))
.orElse( ! application.productionDeployments().values().stream().allMatch(List::isEmpty));
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
index 3074c9ac3ba..f3019631ee7 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobList.java
@@ -111,6 +111,11 @@ public class JobList extends AbstractFilteringList<JobStatus, JobList> {
return matching(job -> job.id().type().isProduction());
}
+ /** Returns the subset of jobs which are test jobs. */
+ public JobList test() {
+ return matching(job -> job.id().type().isTest());
+ }
+
/** Returns the jobs with any runs failing with non-out-of-test-capacity on the given versions — targets only for system test, everything present otherwise. */
public JobList failingHardOn(Versions versions) {
return matching(job -> ! RunList.from(job)
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
index d1fa00d1c41..96187429afa 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/JobMetrics.java
@@ -1,12 +1,10 @@
// Copyright Yahoo. 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.yahoo.config.provision.SystemName;
import com.yahoo.jdisc.Metric;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobId;
import java.util.Map;
-import java.util.function.Supplier;
/**
* Records metrics related to deployment jobs.