use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class DockerProvisioningTest method docker_application_deployment_with_exclusive_app_last.
/**
* Non-exclusive app first, then an exclusive: Should give the same result as above
*/
@Test
public void docker_application_deployment_with_exclusive_app_last() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
for (int i = 1; i <= 4; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host1");
for (int i = 5; i <= 8; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host2");
for (int i = 9; i <= 12; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host3");
for (int i = 13; i <= 16; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host4");
ApplicationId application1 = tester.makeApplicationId();
prepareAndActivate(application1, 2, false, tester);
assertEquals(setOf("host1", "host2"), hostsOf(tester.getNodes(application1, Node.State.active)));
ApplicationId application2 = tester.makeApplicationId();
prepareAndActivate(application2, 2, true, tester);
assertEquals("Application is assigned to separate hosts", setOf("host3", "host4"), hostsOf(tester.getNodes(application2, Node.State.active)));
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class DockerProvisioningTest method get_specified_flavor_not_default_flavor_for_docker.
// In dev, test and staging you get nodes with default flavor, but we should get specified flavor for docker nodes
@Test
public void get_specified_flavor_not_default_flavor_for_docker() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.test, RegionName.from("corp-us-east-1")));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyDockerNodes(1, dockerFlavor, "dockerHost");
List<HostSpec> hosts = tester.prepare(application1, ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("myContent"), Version.fromString("6.42"), false), 1, 1, dockerFlavor);
tester.activate(application1, new HashSet<>(hosts));
NodeList nodes = tester.getNodes(application1, Node.State.active);
assertEquals(1, nodes.size());
assertEquals(dockerFlavor, nodes.asList().get(0).flavor().canonicalName());
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class DockerProvisioningTest method docker_application_deployment.
@Test
public void docker_application_deployment() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
ApplicationId application1 = tester.makeApplicationId();
for (int i = 1; i < 10; i++) tester.makeReadyDockerNodes(1, dockerFlavor, "dockerHost" + i);
Version wantedVespaVersion = Version.fromString("6.39");
int nodeCount = 7;
List<HostSpec> hosts = tester.prepare(application1, ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("myContent"), wantedVespaVersion, false), nodeCount, 1, dockerFlavor);
tester.activate(application1, new HashSet<>(hosts));
NodeList nodes = tester.getNodes(application1, Node.State.active);
assertEquals(nodeCount, nodes.size());
assertEquals(dockerFlavor, nodes.asList().get(0).flavor().canonicalName());
// Upgrade Vespa version on nodes
Version upgradedWantedVespaVersion = Version.fromString("6.40");
List<HostSpec> upgradedHosts = tester.prepare(application1, ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("myContent"), upgradedWantedVespaVersion, false), nodeCount, 1, dockerFlavor);
tester.activate(application1, new HashSet<>(upgradedHosts));
NodeList upgradedNodes = tester.getNodes(application1, Node.State.active);
assertEquals(nodeCount, upgradedNodes.size());
assertEquals(dockerFlavor, upgradedNodes.asList().get(0).flavor().canonicalName());
assertEquals(hosts, upgradedHosts);
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class DockerProvisioningTest method docker_application_deployment_with_exclusive_app_first.
/**
* Exclusive app first, then non-exclusive: Should give the same result as below
*/
@Test
public void docker_application_deployment_with_exclusive_app_first() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
for (int i = 1; i <= 4; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host1");
for (int i = 5; i <= 8; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host2");
for (int i = 9; i <= 12; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host3");
for (int i = 13; i <= 16; i++) tester.makeReadyVirtualNode(i, dockerFlavor, "host4");
ApplicationId application1 = tester.makeApplicationId();
prepareAndActivate(application1, 2, true, tester);
assertEquals(setOf("host1", "host2"), hostsOf(tester.getNodes(application1, Node.State.active)));
ApplicationId application2 = tester.makeApplicationId();
prepareAndActivate(application2, 2, false, tester);
assertEquals("Application is assigned to separate hosts", setOf("host3", "host4"), hostsOf(tester.getNodes(application2, Node.State.active)));
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class MultigroupProvisioningTest method test_provisioning_of_multiple_groups_after_flavor_migration.
@Test
public void test_provisioning_of_multiple_groups_after_flavor_migration() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(10, "small");
tester.makeReadyNodes(10, "large");
deploy(application1, 8, 1, "small", tester);
deploy(application1, 8, 1, "large", tester);
deploy(application1, 8, 8, "large", tester);
}
Aggregations