diff options
author | Martin Polden <mpolden@mpolden.no> | 2018-12-06 13:48:55 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2018-12-06 13:50:23 +0100 |
commit | 46324477ebd60fb4551a7a8241ac86613453ae2a (patch) | |
tree | fda938d39194d1bc4c13eeeee92e883f8db41aa7 | |
parent | b34c9cf316c1ef8a632f37286bef7482aaa1c52e (diff) |
Remove corp zone from tests
14 files changed, 98 insertions, 94 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java index 44a3cb1cfc9..e5f34f3721a 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java @@ -16,6 +16,7 @@ public enum JobType { component ("component" , null , null ), systemTest ("system-test" , ZoneId.from("test" , "us-east-1") , ZoneId.from("test" , "cd-us-central-1") ), stagingTest ("staging-test" , ZoneId.from("staging", "us-east-3") , ZoneId.from("staging", "cd-us-central-1") ), + // TODO: Remove after corp zone disappears productionCorpUsEast1 ("production-corp-us-east-1" , ZoneId.from("prod" , "corp-us-east-1") , null ), productionUsEast3 ("production-us-east-3" , ZoneId.from("prod" , "us-east-3") , null ), productionUsWest1 ("production-us-west-1" , ZoneId.from("prod" , "us-west-1") , null ), diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java index 6daf86c78a2..6820c4ba6b6 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/rotation/RotationRepository.java @@ -104,6 +104,7 @@ public class RotationRepository { return allRotations.get(rotation); } + // TODO: Remove after corp zones disappear private static boolean isCorp(DeploymentSpec.DeclaredZone zone) { return zone.region().isPresent() && zone.region().get().value().contains("corp"); } diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java index 7a5c6ae1170..c7285bceca9 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/ControllerTest.java @@ -39,7 +39,7 @@ import java.util.Optional; import static com.yahoo.config.provision.SystemName.main; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.component; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionCorpUsEast1; +import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionUsWest1; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionUsEast3; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.stagingTest; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.systemTest; @@ -64,7 +64,7 @@ public class ControllerTest { ApplicationController applications = tester.controller().applications(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .region("us-east-3") .build(); @@ -86,21 +86,21 @@ public class ControllerTest { .withCompletion(42, Optional.empty(), tester.clock().instant().truncatedTo(MILLIS)), app1.id(), tester.controller()); // Causes first deployment job to be triggered - assertStatus(JobStatus.initial(productionCorpUsEast1) + assertStatus(JobStatus.initial(productionUsWest1) .withTriggering(version1, applicationVersion, Optional.empty(), "", tester.clock().instant().truncatedTo(MILLIS)), app1.id(), tester.controller()); tester.clock().advance(Duration.ofSeconds(1)); // production job (failing) after deployment - tester.deploy(productionCorpUsEast1, app1, applicationPackage); - tester.deployAndNotify(app1, applicationPackage, false, productionCorpUsEast1); + tester.deploy(productionUsWest1, app1, applicationPackage); + tester.deployAndNotify(app1, applicationPackage, false, productionUsWest1); assertEquals(4, applications.require(app1.id()).deploymentJobs().jobStatus().size()); - JobStatus expectedJobStatus = JobStatus.initial(productionCorpUsEast1) + JobStatus expectedJobStatus = JobStatus.initial(productionUsWest1) .withTriggering(version1, applicationVersion, Optional.empty(), "", tester.clock().instant().truncatedTo(MILLIS)) // Triggered first without application version info .withCompletion(42, Optional.of(JobError.unknown), tester.clock().instant().truncatedTo(MILLIS)) .withTriggering(version1, applicationVersion, - Optional.of(tester.application(app1.id()).deployments().get(productionCorpUsEast1.zone(main))), + Optional.of(tester.application(app1.id()).deployments().get(productionUsWest1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)); // Re-triggering (due to failure) has application version info @@ -125,18 +125,18 @@ public class ControllerTest { applicationVersion = tester.application("app1").change().application().get(); tester.deployAndNotify(app1, applicationPackage, true, systemTest); assertStatus(JobStatus.initial(systemTest) - .withTriggering(version1, applicationVersion, Optional.of(tester.application(app1.id()).deployments().get(productionCorpUsEast1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) + .withTriggering(version1, applicationVersion, Optional.of(tester.application(app1.id()).deployments().get(productionUsWest1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) .withCompletion(42, Optional.empty(), tester.clock().instant().truncatedTo(MILLIS)), app1.id(), tester.controller()); tester.clock().advance(Duration.ofHours(1)); // Stop retrying - tester.jobCompletion(productionCorpUsEast1).application(app1).unsuccessful().submit(); + tester.jobCompletion(productionUsWest1).application(app1).unsuccessful().submit(); tester.deployAndNotify(app1, applicationPackage, true, stagingTest); // production job succeeding now expectedJobStatus = expectedJobStatus - .withTriggering(version1, applicationVersion, Optional.of(tester.application(app1.id()).deployments().get(productionCorpUsEast1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) + .withTriggering(version1, applicationVersion, Optional.of(tester.application(app1.id()).deployments().get(productionUsWest1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) .withCompletion(42, Optional.empty(), tester.clock().instant().truncatedTo(MILLIS)); - tester.deployAndNotify(app1, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app1, applicationPackage, true, productionUsWest1); assertStatus(expectedJobStatus, app1.id(), tester.controller()); // causes triggering of next production job @@ -171,13 +171,13 @@ public class ControllerTest { fail("Expected exception due to illegal production deployment removal"); } catch (IllegalArgumentException e) { - assertEquals("deployment-removal: application 'tenant1.app1' is deployed in corp-us-east-1, but does not include this zone in deployment.xml. " + + assertEquals("deployment-removal: application 'tenant1.app1' is deployed in us-west-1, but does not include this zone in deployment.xml. " + ValidationOverrides.toAllowMessage(ValidationId.deploymentRemoval), e.getMessage()); } assertNotNull("Zone was not removed", - applications.require(app1.id()).deployments().get(productionCorpUsEast1.zone(main))); - JobStatus jobStatus = applications.require(app1.id()).deploymentJobs().jobStatus().get(productionCorpUsEast1); + applications.require(app1.id()).deployments().get(productionUsWest1.zone(main))); + JobStatus jobStatus = applications.require(app1.id()).deploymentJobs().jobStatus().get(productionUsWest1); assertNotNull("Deployment job was not removed", jobStatus); assertEquals(42, jobStatus.lastCompleted().get().id()); assertEquals("New change available", jobStatus.lastCompleted().get().reason()); @@ -192,8 +192,8 @@ public class ControllerTest { tester.jobCompletion(component).application(app1).nextBuildNumber(2).uploadArtifact(applicationPackage).submit(); tester.deployAndNotify(app1, applicationPackage, true, systemTest); assertNull("Zone was removed", - applications.require(app1.id()).deployments().get(productionCorpUsEast1.zone(main))); - assertNull("Deployment job was removed", applications.require(app1.id()).deploymentJobs().jobStatus().get(productionCorpUsEast1)); + applications.require(app1.id()).deployments().get(productionUsWest1.zone(main))); + assertNull("Deployment job was removed", applications.require(app1.id()).deploymentJobs().jobStatus().get(productionUsWest1)); } @Test @@ -202,7 +202,7 @@ public class ControllerTest { Application app = tester.createApplication("app1", "tenant1", 1, 11L); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .region("us-east-3") .build(); SourceRevision source = new SourceRevision("repo", "master", "commit1"); @@ -451,7 +451,7 @@ public class ControllerTest { Application app = tester.createApplication("app1", "tenant1", 1, 11L); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .region("us-east-3") .build(); SourceRevision source = new SourceRevision("repo", "master", "commit1"); @@ -459,7 +459,7 @@ public class ControllerTest { ApplicationVersion applicationVersion = ApplicationVersion.from(source, 101); runDeployment(tester, app.id(), applicationVersion, applicationPackage, source,101); - DeploymentId deployment1 = new DeploymentId(app.id(), ZoneId.from(Environment.prod, RegionName.from("corp-us-east-1"))); + DeploymentId deployment1 = new DeploymentId(app.id(), ZoneId.from(Environment.prod, RegionName.from("us-west-1"))); DeploymentId deployment2 = new DeploymentId(app.id(), ZoneId.from(Environment.prod, RegionName.from("us-east-3"))); assertFalse(tester.configServer().isSuspended(deployment1)); assertFalse(tester.configServer().isSuspended(deployment2)); @@ -506,17 +506,17 @@ public class ControllerTest { tester.deployAndNotify(app, applicationPackage, true, systemTest); tester.deployAndNotify(app, applicationPackage, true, stagingTest); JobStatus expected = JobStatus.initial(stagingTest) - .withTriggering(vespaVersion, version, Optional.ofNullable(tester.application(app.id()).deployments().get(productionCorpUsEast1.zone(main))), "", + .withTriggering(vespaVersion, version, Optional.ofNullable(tester.application(app.id()).deployments().get(productionUsWest1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) .withCompletion(42, Optional.empty(), tester.clock().instant().truncatedTo(MILLIS)); assertStatus(expected, app.id(), tester.controller()); // Deploy in production - expected = JobStatus.initial(productionCorpUsEast1) - .withTriggering(vespaVersion, version, Optional.ofNullable(tester.application(app.id()).deployments().get(productionCorpUsEast1.zone(main))), "", + expected = JobStatus.initial(productionUsWest1) + .withTriggering(vespaVersion, version, Optional.ofNullable(tester.application(app.id()).deployments().get(productionUsWest1.zone(main))), "", tester.clock().instant().truncatedTo(MILLIS)) .withCompletion(42, Optional.empty(), tester.clock().instant().truncatedTo(MILLIS)); - tester.deployAndNotify(app, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app, applicationPackage, true, productionUsWest1); assertStatus(expected, app.id(), tester.controller()); expected = JobStatus.initial(productionUsEast3) diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java index c75e5137bb9..68a36874dc7 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTriggerTest.java @@ -11,15 +11,15 @@ import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.ControllerTester; import com.yahoo.vespa.hosted.controller.api.identifiers.DeploymentId; import com.yahoo.vespa.hosted.controller.api.integration.BuildService; +import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion; import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType; import com.yahoo.vespa.hosted.controller.api.integration.deployment.RunId; +import com.yahoo.vespa.hosted.controller.api.integration.deployment.SourceRevision; import com.yahoo.vespa.hosted.controller.api.integration.stubs.MockBuildService; import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; import com.yahoo.vespa.hosted.controller.application.ApplicationPackage; -import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion; import com.yahoo.vespa.hosted.controller.application.Change; import com.yahoo.vespa.hosted.controller.application.DeploymentJobs; -import com.yahoo.vespa.hosted.controller.api.integration.deployment.SourceRevision; import com.yahoo.vespa.hosted.controller.maintenance.JobControl; import com.yahoo.vespa.hosted.controller.maintenance.ReadyJobsTrigger; import com.yahoo.vespa.hosted.controller.versions.VespaVersion; @@ -41,7 +41,6 @@ import java.util.stream.Collectors; import static com.yahoo.config.provision.SystemName.main; import static com.yahoo.vespa.hosted.controller.ControllerTester.buildJob; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.component; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionCorpUsEast1; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionEuWest1; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionUsCentral1; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionUsEast3; @@ -184,7 +183,7 @@ public class DeploymentTriggerTest { Application application = tester.controllerTester().createApplication(tenant, "app1", "default", 1L); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-east-3") .region("us-central-1") .region("us-west-1") .build(); @@ -195,7 +194,7 @@ public class DeploymentTriggerTest { // Application is deployed to all test environments and declared zones tester.deployAndNotify(application, applicationPackage, true, JobType.systemTest); tester.deployAndNotify(application, applicationPackage, true, JobType.stagingTest); - tester.deployAndNotify(application, applicationPackage, true, JobType.productionCorpUsEast1); + tester.deployAndNotify(application, applicationPackage, true, JobType.productionUsEast3); tester.deployAndNotify(application, applicationPackage, true, JobType.productionUsCentral1); tester.deployAndNotify(application, applicationPackage, true, JobType.productionUsWest1); assertTrue("All jobs consumed", mockBuildService.jobs().isEmpty()); @@ -380,13 +379,13 @@ public class DeploymentTriggerTest { Application application = tester.controllerTester().createApplication(tenant, "app1", "default", 1L); ApplicationPackage previousApplicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-east-3") .region("us-central-1") .region("us-west-1") .build(); ApplicationPackage newApplicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-east-3") .region("us-central-1") .region("us-west-1") .region("eu-west-1") @@ -399,7 +398,7 @@ public class DeploymentTriggerTest { tester.deployAndNotify(application, newApplicationPackage, true, JobType.systemTest); tester.deploy(JobType.stagingTest, application, previousApplicationPackage, true); tester.deployAndNotify(application, newApplicationPackage, true, JobType.stagingTest); - tester.deployAndNotify(application, newApplicationPackage, true, JobType.productionCorpUsEast1); + tester.deployAndNotify(application, newApplicationPackage, true, JobType.productionUsEast3); tester.deployAndNotify(application, newApplicationPackage, true, JobType.productionUsCentral1); tester.deployAndNotify(application, newApplicationPackage, true, JobType.productionUsWest1); tester.deployAndNotify(application, newApplicationPackage, true, JobType.productionEuWest1); @@ -959,7 +958,7 @@ public class DeploymentTriggerTest { Application app = tester.createApplication("app1", "foo", 1, 1L); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .build(); // Initial failure @@ -982,7 +981,7 @@ public class DeploymentTriggerTest { // Complete deployment tester.deployAndNotify(app, applicationPackage, true, stagingTest); - tester.deployAndNotify(app, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app, applicationPackage, true, productionUsWest1); // Two repeated failures again. // Initial failure @@ -1086,7 +1085,7 @@ public class DeploymentTriggerTest { public void requeueOutOfCapacityStagingJob() { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-east-3") .build(); long project1 = 1; @@ -1140,9 +1139,9 @@ public class DeploymentTriggerTest { // Finish deployment for apps 2 and 3, then release a new version, leaving only app1 with an application upgrade. tester.deployAndNotify(app2, applicationPackage, true, stagingTest); - tester.deployAndNotify(app2, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app2, applicationPackage, true, productionUsEast3); tester.deployAndNotify(app3, applicationPackage, true, stagingTest); - tester.deployAndNotify(app3, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app3, applicationPackage, true, productionUsEast3); tester.upgradeSystem(new Version("6.2")); // app1 also gets a new application change, so its time of availability is after the version upgrade. diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java index ad6c26322da..4186f79a34d 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/integration/ZoneRegistryMock.java @@ -40,7 +40,6 @@ public class ZoneRegistryMock extends AbstractComponent implements ZoneRegistry @Inject public ZoneRegistryMock() { - zones.add(ZoneId.from("prod", "corp-us-east-1")); zones.add(ZoneId.from("prod", "us-east-3")); zones.add(ZoneId.from("prod", "us-west-1")); zones.add(ZoneId.from("prod", "us-central-1")); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporterTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporterTest.java index e97376d1f66..264d28fa056 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporterTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/maintenance/DeploymentIssueReporterTest.java @@ -22,7 +22,7 @@ import java.util.Map; import java.util.Optional; import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.component; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionCorpUsEast1; +import static com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType.productionUsWest1; 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.maintenance.DeploymentIssueReporter.maxFailureAge; @@ -39,11 +39,11 @@ public class DeploymentIssueReporterTest { private final static ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .build(); private final static ApplicationPackage canaryPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .upgradePolicy("canary") .build(); @@ -95,7 +95,7 @@ public class DeploymentIssueReporterTest { tester.jobCompletion(component).application(app3).uploadArtifact(applicationPackage).submit(); tester.deployAndNotify(app3, applicationPackage, true, systemTest); tester.deployAndNotify(app3, applicationPackage, true, stagingTest); - tester.deployAndNotify(app3, applicationPackage, false, productionCorpUsEast1); + tester.deployAndNotify(app3, applicationPackage, false, productionUsWest1); reporter.maintain(); reporter.maintain(); @@ -130,7 +130,7 @@ public class DeploymentIssueReporterTest { // app3 fixes their problems, but the ticket for app3 is left open; see the resolved ticket is not escalated when another escalation period has passed. - tester.deployAndNotify(app3, applicationPackage, true, productionCorpUsEast1); + tester.deployAndNotify(app3, applicationPackage, true, productionUsWest1); tester.clock().advance(maxInactivity.plus(Duration.ofDays(1))); reporter.maintain(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java index 8ff5d9c9963..b6cf05d6990 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java @@ -102,7 +102,7 @@ public class ApplicationApiTest extends ControllerContainerTest { private static final ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) .globalServiceId("foo") - .region("corp-us-east-1") + .region("us-central-1") .region("us-east-3") .region("us-west-1") .blockChange(false, true, "mon-fri", "0-8", "UTC") @@ -249,11 +249,11 @@ public class ApplicationApiTest extends ControllerContainerTest { .submit(); // ... prod zone - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/", POST) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/", POST) .data(createApplicationDeployData(Optional.empty(), false)) .screwdriverIdentity(SCREWDRIVER_ID), new File("deploy-result.json")); - controllerTester.jobCompletion(JobType.productionCorpUsEast1) + controllerTester.jobCompletion(JobType.productionUsCentral1) .application(id) .projectId(screwdriverProjectId) .unsuccessful() @@ -306,7 +306,7 @@ public class ApplicationApiTest extends ControllerContainerTest { .userIdentity(USER_ID), new File("application.json")); // GET an application deployment - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default", GET) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default", GET) .userIdentity(USER_ID), new File("deployment.json")); @@ -333,7 +333,7 @@ public class ApplicationApiTest extends ControllerContainerTest { new File("application1-recursive.json")); // GET logs - tester.assertResponse(request("/application/v4/tenant/tenant2/application//application1/environment/prod/region/corp-us-east-1/instance/default/logs?from=1233&to=3214", GET).userIdentity(USER_ID), new File("logs.json")); + tester.assertResponse(request("/application/v4/tenant/tenant2/application//application1/environment/prod/region/us-central-1/instance/default/logs?from=1233&to=3214", GET).userIdentity(USER_ID), new File("logs.json")); // DELETE (cancel) ongoing change tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/deploying", DELETE) @@ -362,26 +362,26 @@ public class ApplicationApiTest extends ControllerContainerTest { "{\"message\":\"Triggered production-us-west-1 for tenant1.application1\"}"); // POST a 'restart application' command - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/restart", POST) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/restart", POST) .screwdriverIdentity(SCREWDRIVER_ID), - "Requested restart of tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default"); + "Requested restart of tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default"); // POST a 'restart application' command with a host filter (other filters not supported yet) - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/restart?hostname=host1", POST) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/restart?hostname=host1", POST) .screwdriverIdentity(SCREWDRIVER_ID), "{\"error-code\":\"INTERNAL_SERVER_ERROR\",\"message\":\"No node with the hostname host1 is known.\"}", 500); // GET suspended - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/suspended", GET) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/suspended", GET) .userIdentity(USER_ID), new File("suspended.json")); // GET services - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/service", GET) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/service", GET) .userIdentity(USER_ID), new File("services.json")); // GET service - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/service/storagenode-awe3slno6mmq2fye191y324jl/state/v1/", GET) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/service/storagenode-awe3slno6mmq2fye191y324jl/state/v1/", GET) .userIdentity(USER_ID), new File("service.json")); @@ -395,15 +395,15 @@ public class ApplicationApiTest extends ControllerContainerTest { "Deactivated tenant/tenant1/application/application1/environment/dev/region/us-west-1/instance/default"); // DELETE (deactivate) a deployment - prod - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default", DELETE) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default", DELETE) .screwdriverIdentity(SCREWDRIVER_ID), - "Deactivated tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default"); + "Deactivated tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default"); // DELETE (deactivate) a deployment is idempotent - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default", DELETE) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default", DELETE) .screwdriverIdentity(SCREWDRIVER_ID), - "Deactivated tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default"); + "Deactivated tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default"); // POST an application package and a test jar, submitting a new application for internal pipeline deployment. // First attempt does not have an Athenz service definition in deployment spec, and fails. @@ -584,7 +584,7 @@ public class ApplicationApiTest extends ControllerContainerTest { // POST (deploy) an application to a prod zone - allowed when project ID is not specified HttpEntity entity = createApplicationDeployData(applicationPackage, true); - tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/deploy", POST) + tester.assertResponse(request("/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/deploy", POST) .data(entity) .screwdriverIdentity(SCREWDRIVER_ID), new File("deploy-result.json")); @@ -1026,7 +1026,7 @@ public class ApplicationApiTest extends ControllerContainerTest { Application app = controllerTester.createApplication(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-central-1") .build(); Version vespaVersion = new Version("6.1"); // system version from mock config server client @@ -1080,7 +1080,7 @@ public class ApplicationApiTest extends ControllerContainerTest { Application app = controllerTester.createApplication(); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-central-1") .build(); // Report job failing with out of capacity diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json index 1fc61d92f40..b0a6c6c4794 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application.json @@ -66,7 +66,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastCompleted": { @@ -80,7 +80,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastSuccess": { @@ -94,7 +94,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" } }, @@ -112,7 +112,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastCompleted": { @@ -126,7 +126,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastSuccess": { @@ -140,12 +140,12 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" } }, { - "type": "production-corp-us-east-1", + "type": "production-us-central-1", "success": false, "lastTriggered": { "id": -1, @@ -231,12 +231,12 @@ }, { "environment": "prod", - "region": "corp-us-east-1", + "region": "us-central-1", "instance": "default", "bcpStatus": { "rotationStatus": "UNKNOWN" }, - "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default" + "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default" } ], "metrics": { diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json index 75dd484866f..6200bd7cffa 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/application1-recursive.json @@ -66,7 +66,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastCompleted": { @@ -80,7 +80,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastSuccess": { @@ -94,7 +94,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" } }, @@ -112,7 +112,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastCompleted": { @@ -126,7 +126,7 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" }, "lastSuccess": { @@ -140,12 +140,12 @@ "gitCommit": "commit1" } }, - "reason": "Testing deployment for production-corp-us-east-1 (platform 6.1, application 1.0.42-commit1)", + "reason": "Testing deployment for production-us-central-1 (platform 6.1, application 1.0.42-commit1)", "at": "(ignore)" } }, { - "type": "production-corp-us-east-1", + "type": "production-us-central-1", "success": false, "lastTriggered": { "id": -1, @@ -224,7 +224,7 @@ "rotationId": "rotation-id-1", "instances": [ @include(dev-us-west-1.json), - @include(prod-corp-us-east-1.json) + @include(prod-us-central-1.json) ], "metrics": { "queryServiceQuality": 0.5, diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json index 203b67dce1a..00177bf1afc 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/deployment.json @@ -6,9 +6,9 @@ "http://global-endpoint.vespa.yahooapis.com:4080", "http://alias-endpoint.vespa.yahooapis.com:4080" ], - "nodes": "http://localhost:8080/zone/v2/prod/corp-us-east-1/nodes/v2/node/%3F&recursive=true&application=tenant1.application1.default", - "elkUrl": "http://log.prod.corp-us-east-1.test/#/discover?_g=()&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'HV-tenant:%22tenant1%22%20AND%20HV-application:%22application1%22%20AND%20HV-region:%22corp-us-east-1%22%20AND%20HV-instance:%22default%22%20AND%20HV-environment:%22prod%22')),sort:!('@timestamp',desc))", - "yamasUrl": "http://monitoring-system.test/?environment=prod®ion=corp-us-east-1&application=tenant1.application1", + "nodes": "http://localhost:8080/zone/v2/prod/us-central-1/nodes/v2/node/%3F&recursive=true&application=tenant1.application1.default", + "elkUrl": "http://log.prod.us-central-1.test/#/discover?_g=()&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'HV-tenant:%22tenant1%22%20AND%20HV-application:%22application1%22%20AND%20HV-region:%22us-central-1%22%20AND%20HV-instance:%22default%22%20AND%20HV-environment:%22prod%22')),sort:!('@timestamp',desc))", + "yamasUrl": "http://monitoring-system.test/?environment=prod®ion=us-central-1&application=tenant1.application1", "version": "(ignore)", "revision": "(ignore)", "deployTimeEpochMs": "(ignore)", diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-corp-us-east-1.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json index c495308aba1..c7693c3d0d4 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-corp-us-east-1.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json @@ -1,6 +1,6 @@ { "environment": "prod", - "region": "corp-us-east-1", + "region": "us-central-1", "instance": "default", "bcpStatus": { "rotationStatus": "UNKNOWN" @@ -12,9 +12,9 @@ "http://global-endpoint.vespa.yahooapis.com:4080", "http://alias-endpoint.vespa.yahooapis.com:4080" ], - "nodes": "http://localhost:8080/zone/v2/prod/corp-us-east-1/nodes/v2/node/%3F&recursive=true&application=tenant1.application1.default", - "elkUrl": "http://log.prod.corp-us-east-1.test/#/discover?_g=()&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'HV-tenant:%22tenant1%22%20AND%20HV-application:%22application1%22%20AND%20HV-region:%22corp-us-east-1%22%20AND%20HV-instance:%22default%22%20AND%20HV-environment:%22prod%22')),sort:!('@timestamp',desc))", - "yamasUrl": "http://monitoring-system.test/?environment=prod®ion=corp-us-east-1&application=tenant1.application1", + "nodes": "http://localhost:8080/zone/v2/prod/us-central-1/nodes/v2/node/%3F&recursive=true&application=tenant1.application1.default", + "elkUrl": "http://log.prod.us-central-1.test/#/discover?_g=()&_a=(columns:!(_source),index:'logstash-*',interval:auto,query:(query_string:(analyze_wildcard:!t,query:'HV-tenant:%22tenant1%22%20AND%20HV-application:%22application1%22%20AND%20HV-region:%22us-central-1%22%20AND%20HV-instance:%22default%22%20AND%20HV-environment:%22prod%22')),sort:!('@timestamp',desc))", + "yamasUrl": "http://monitoring-system.test/?environment=prod®ion=us-central-1&application=tenant1.application1", "version": "(ignore)", "revision": "(ignore)", "deployTimeEpochMs": "(ignore)", diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/services.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/services.json index c68b7dc9e87..782d8e42aa3 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/services.json +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/services.json @@ -3,10 +3,10 @@ { "name": "cluster1", "type": "content", - "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/service/container-clustercontroller-6s8slgtps7ry8uh6lx21ejjiv/cluster/v2/cluster1", + "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/service/container-clustercontroller-6s8slgtps7ry8uh6lx21ejjiv/cluster/v2/cluster1", "services": [ { - "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/corp-us-east-1/instance/default/service/storagenode-awe3slno6mmq2fye191y324jl/state/v1/", + "url": "http://localhost:8080/application/v4/tenant/tenant1/application/application1/environment/prod/region/us-central-1/instance/default/service/storagenode-awe3slno6mmq2fye191y324jl/state/v1/", "serviceType": "storagenode", "serviceName": "storagenode", "configId": "cluster1/storage/0", @@ -15,4 +15,4 @@ ] } ] -}
\ No newline at end of file +} diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java index c284b120e33..ddd8977c5bf 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java @@ -20,7 +20,6 @@ import org.junit.Before; import org.junit.Test; import java.io.File; -import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -40,13 +39,13 @@ public class DeploymentApiTest extends ControllerContainerTest { } @Test - public void testDeploymentApi() throws IOException { + public void testDeploymentApi() { ContainerControllerTester tester = new ContainerControllerTester(container, responseFiles); Version version = Version.fromString("5.0"); tester.containerTester().upgradeSystem(version); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .environment(Environment.prod) - .region("corp-us-east-1") + .region("us-west-1") .build(); // 3 applications deploy on current system version @@ -61,7 +60,7 @@ public class DeploymentApiTest extends ControllerContainerTest { // Deploy once so that job information is stored, then remove the deployment deployCompletely(applicationWithoutDeployment, applicationPackage, 3L, true); - tester.controller().applications().deactivate(applicationWithoutDeployment.id(), ZoneId.from("prod", "corp-us-east-1")); + tester.controller().applications().deactivate(applicationWithoutDeployment.id(), ZoneId.from("prod", "us-west-1")); // New version released version = Version.fromString("5.1"); @@ -121,8 +120,8 @@ public class DeploymentApiTest extends ControllerContainerTest { .submit(); if (success) { tester.deploy(application, applicationPackage, ZoneId.from(Environment.prod, - RegionName.from("corp-us-east-1"))); - tester.jobCompletion(JobType.productionCorpUsEast1) + RegionName.from("us-west-1"))); + tester.jobCompletion(JobType.productionUsWest1) .application(application) .projectId(projectId) .submit(); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java index e6c4f0d8e86..1d5ddaa1ec0 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/rotation/RotationTest.java @@ -4,6 +4,7 @@ package com.yahoo.vespa.hosted.controller.rotation; import com.yahoo.config.provision.SystemName; import com.yahoo.vespa.hosted.controller.Application; import com.yahoo.vespa.hosted.controller.ControllerTester; +import com.yahoo.vespa.hosted.controller.api.integration.zone.ZoneId; import com.yahoo.vespa.hosted.controller.application.ApplicationPackage; import com.yahoo.vespa.hosted.controller.deployment.ApplicationPackageBuilder; import com.yahoo.vespa.hosted.controller.deployment.DeploymentTester; @@ -145,6 +146,8 @@ public class RotationTest { @Test public void application_with_only_one_non_corp_region() { + tester.controllerTester().zoneRegistry().setZones(ZoneId.from("prod", "corp-us-east-1"), + ZoneId.from("prod", "us-east-3")); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .globalServiceId("foo") .region("us-east-3") @@ -159,6 +162,9 @@ public class RotationTest { @Test public void application_with_corp_region_and_two_non_corp_region() { + tester.controllerTester().zoneRegistry().setZones(ZoneId.from("prod", "corp-us-east-1"), + ZoneId.from("prod", "us-east-3"), + ZoneId.from("prod", "us-west-1")); ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .globalServiceId("foo") .region("us-east-3") @@ -177,7 +183,6 @@ public class RotationTest { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .globalServiceId("foo") .region("us-east-3") - .region("corp-us-east-1") .region("us-west-1") .build(); Application application = tester.createApplication("app2", "tenant2", 22L, |