diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-11-05 08:59:13 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-11-05 10:26:07 +0100 |
commit | 942801ff2ff7ed9ec5ed50048a82672240c09765 (patch) | |
tree | f8069fd5c86836afbcbc7fb6b531280fda6a4d3d /controller-server | |
parent | e51d00734e119a92bed319a03a66e449062e88d0 (diff) |
Remove component job type
Diffstat (limited to 'controller-server')
7 files changed, 3 insertions, 54 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/DeploymentJobs.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/DeploymentJobs.java index bc2b18005b6..fb238e0a652 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/DeploymentJobs.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/DeploymentJobs.java @@ -105,17 +105,6 @@ public class DeploymentJobs { this.version = version; } - public static JobReport ofComponent(ApplicationId applicationId, long projectId, long buildNumber, - Optional<JobError> jobError, SourceRevision sourceRevision) { - return new JobReport(applicationId, JobType.component, projectId, buildNumber, - jobError, Optional.of(ApplicationVersion.from(sourceRevision, buildNumber))); - } - - public static JobReport ofSubmission(ApplicationId applicationId, long projectId, ApplicationVersion version) { - return new JobReport(applicationId, JobType.component, projectId, version.buildNumber().getAsLong(), - Optional.empty(), Optional.of(version)); - } - public static JobReport ofJob(ApplicationId applicationId, JobType jobType, long buildNumber, Optional<JobError> jobError) { return new JobReport(applicationId, jobType, -1, buildNumber, jobError, Optional.empty()); } diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/JobStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/JobStatus.java index 5306cc4ae2b..cc6b770a809 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/JobStatus.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/application/JobStatus.java @@ -43,7 +43,7 @@ public class JobStatus { this.jobError = requireNonNull(jobError, "jobError cannot be null"); // Never say we triggered component because we don't: - this.lastTriggered = type == JobType.component ? Optional.empty() : requireNonNull(lastTriggered, "lastTriggered cannot be null"); + this.lastTriggered = requireNonNull(lastTriggered, "lastTriggered cannot be null"); this.lastCompleted = requireNonNull(lastCompleted, "lastCompleted cannot be null"); this.firstFailing = requireNonNull(firstFailing, "firstFailing cannot be null"); this.lastSuccess = requireNonNull(lastSuccess, "lastSuccess cannot be null"); diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java index 9c6ebd22c43..f6a4e6cbd08 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java @@ -1,11 +1,9 @@ // Copyright 2017 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.yahoo.config.application.api.DeploymentInstanceSpec; import com.yahoo.config.application.api.DeploymentSpec; import com.yahoo.config.application.api.DeploymentSpec.Step; import com.yahoo.config.provision.ApplicationId; -import com.yahoo.config.provision.InstanceName; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.log.LogLevel; import com.yahoo.vespa.hosted.controller.Application; @@ -48,11 +46,9 @@ import static com.yahoo.vespa.hosted.controller.api.integration.BuildService.Bui import static com.yahoo.vespa.hosted.controller.api.integration.BuildService.JobState.idle; import static com.yahoo.vespa.hosted.controller.api.integration.BuildService.JobState.queued; import static com.yahoo.vespa.hosted.controller.api.integration.BuildService.JobState.running; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.component; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.stagingTest; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.systemTest; import static java.util.Collections.emptyList; -import static java.util.Collections.singletonList; import static java.util.Comparator.comparing; import static java.util.Comparator.naturalOrder; import static java.util.stream.Collectors.groupingBy; @@ -143,12 +139,6 @@ public class DeploymentTrigger { } applications().lockApplicationOrThrow(TenantAndApplicationId.from(report.applicationId()), application -> { - if (report.jobType() == component) { - if (report.success()) - notifyOfSubmission(application.get().id(), report.version().get(), report.projectId()); - - return; - } JobRun triggering; Optional<JobStatus> status = application.get().require(report.applicationId().instance()) .deploymentJobs().statusOf(report.jobType()); @@ -238,13 +228,6 @@ public class DeploymentTrigger { public List<JobType> forceTrigger(ApplicationId applicationId, JobType jobType, String user) { Application application = applications().requireApplication(TenantAndApplicationId.from(applicationId)); Instance instance = application.require(applicationId.instance()); - if (jobType == component) { - if (application.internal()) - throw new IllegalArgumentException(applicationId + " has no component job we can trigger."); - - buildService.trigger(BuildJob.of(applicationId, application.projectId().getAsLong(), jobType.jobName())); - return singletonList(component); - } Versions versions = Versions.from(application.change(), application, deploymentFor(instance, jobType), controller.systemVersion()); String reason = "Job triggered manually by " + user; diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializer.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializer.java index b67feab3f59..08142a9a399 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializer.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/persistence/ApplicationSerializer.java @@ -283,8 +283,7 @@ public class ApplicationSerializer { private void jobStatusToSlime(Collection<JobStatus> jobStatuses, Cursor jobStatusArray) { for (JobStatus jobStatus : jobStatuses) - if (jobStatus.type() != JobType.component) - toSlime(jobStatus, jobStatusArray.addObject()); + toSlime(jobStatus, jobStatusArray.addObject()); } private void toSlime(JobStatus jobStatus, Cursor object) { diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index c7ed77d0c90..836115d900a 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -57,7 +57,6 @@ import com.yahoo.vespa.hosted.controller.api.integration.resource.CostInfo; import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringInfo; import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceAllocation; import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceSnapshot; -import com.yahoo.vespa.hosted.controller.api.integration.routing.RoutingEndpoint; import com.yahoo.vespa.hosted.controller.application.ApplicationPackage; import com.yahoo.vespa.hosted.controller.application.AssignedRotation; import com.yahoo.vespa.hosted.controller.application.Change; @@ -1568,12 +1567,6 @@ public class ApplicationApiHandler extends LoggingRequestHandler { private HttpResponse notifyJobCompletion(String tenant, String application, HttpRequest request) { try { DeploymentJobs.JobReport report = toJobReport(tenant, application, toSlime(request.getData()).get()); - if ( report.jobType() == JobType.component - && controller.applications().requireApplication(TenantAndApplicationId.from(report.applicationId())).internal()) - throw new IllegalArgumentException(report.applicationId() + " is set up to be deployed from internally, and no " + - "longer accepts submissions from Screwdriver v3 jobs. If you need to revert " + - "to the old pipeline, please file a ticket at yo/vespa-support and request this."); - controller.applications().deploymentTrigger().notifyOfCompletion(report); return new MessageResponse("ok"); } catch (IllegalStateException e) { @@ -1612,14 +1605,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler { ApplicationId id = ApplicationId.from(tenantName, applicationName, report.field("instance").asString()); JobType type = JobType.fromJobName(report.field("jobName").asString()); long buildNumber = report.field("buildNumber").asLong(); - if (type == JobType.component) - return DeploymentJobs.JobReport.ofComponent(id, - report.field("projectId").asLong(), - buildNumber, - jobError, - toSourceRevision(report.field("sourceRevision"))); - else - return DeploymentJobs.JobReport.ofJob(id, type, buildNumber, jobError); + return DeploymentJobs.JobReport.ofJob(id, type, buildNumber, jobError); } private static SourceRevision toSourceRevision(Inspector object) { 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 c7dec08d85a..0f1cd9495bf 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 @@ -47,7 +47,6 @@ import java.util.stream.Collectors; import static com.yahoo.config.application.api.DeploymentSpec.UpgradePolicy.conservative; import static com.yahoo.config.application.api.DeploymentSpec.UpgradePolicy.defaultPolicy; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.component; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.stagingTest; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.systemTest; import static com.yahoo.vespa.hosted.controller.deployment.Step.Status.unfinished; diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java index 6fd07708c2d..c96d1648041 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTester.java @@ -150,13 +150,6 @@ public final class ControllerTester { .forEach(configureFunc); } - public static BuildService.BuildJob buildJob(ApplicationId id, JobType jobType) { - if (jobType == JobType.component) - throw new AssertionError("Not supposed to happen"); - - return BuildService.BuildJob.of(id, 0, jobType.jobName()); - } - public Controller controller() { return controller; } public CuratorDb curator() { return curator; } |