use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class DockerProvisioningTest method docker_application_deployment_change_to_exclusive_and_back.
/**
* Test making an application exclusive
*/
@Test
public void docker_application_deployment_change_to_exclusive_and_back() {
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);
for (Node node : tester.getNodes(application1, Node.State.active).asList()) assertFalse(node.allocation().get().membership().cluster().isExclusive());
prepareAndActivate(application1, 2, true, tester);
assertEquals(setOf("host1", "host2"), hostsOf(tester.getNodes(application1, Node.State.active)));
for (Node node : tester.getNodes(application1, Node.State.active).asList()) assertTrue(node.allocation().get().membership().cluster().isExclusive());
prepareAndActivate(application1, 2, false, tester);
assertEquals(setOf("host1", "host2"), hostsOf(tester.getNodes(application1, Node.State.active)));
for (Node node : tester.getNodes(application1, Node.State.active).asList()) assertFalse(node.allocation().get().membership().cluster().isExclusive());
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class MultigroupProvisioningTest method test_provisioning_of_multiple_groups.
@Test
public void test_provisioning_of_multiple_groups() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(21, "default");
deploy(application1, 6, 1, tester);
deploy(application1, 6, 2, tester);
deploy(application1, 6, 3, tester);
deploy(application1, 6, 6, tester);
deploy(application1, 6, 1, tester);
deploy(application1, 6, 6, tester);
deploy(application1, 6, 6, tester);
deploy(application1, 6, 2, tester);
deploy(application1, 8, 2, tester);
deploy(application1, 9, 3, tester);
deploy(application1, 9, 3, tester);
deploy(application1, 9, 3, tester);
deploy(application1, 12, 4, tester);
deploy(application1, 8, 4, tester);
deploy(application1, 12, 4, tester);
deploy(application1, 8, 2, tester);
deploy(application1, 6, 3, tester);
}
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_and_exiration.
@Test
public void test_provisioning_of_multiple_groups_after_flavor_migration_and_exiration() {
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);
// Expire small nodes
tester.advanceTime(Duration.ofDays(7));
MockDeployer deployer = new MockDeployer(tester.provisioner(), Collections.singletonMap(application1, new MockDeployer.ApplicationContext(application1, cluster(), Capacity.fromNodeCount(8, Optional.of("large"), false), 1)));
new RetiredExpirer(tester.nodeRepository(), tester.orchestrator(), deployer, tester.clock(), Duration.ofDays(30), Duration.ofHours(12), new JobControl(tester.nodeRepository().database())).run();
assertEquals(8, tester.getNodes(application1, Node.State.inactive).flavor("small").size());
deploy(application1, 8, 8, "large", tester);
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class MultigroupProvisioningTest method test_one_node_and_group_to_two_with_flavor_migration.
@Test
public void test_one_node_and_group_to_two_with_flavor_migration() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.perf, RegionName.from("us-east")));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(10, "small");
tester.makeReadyNodes(10, "large");
deploy(application1, Capacity.fromNodeCount(1, Optional.of("small"), true), 1, tester);
deploy(application1, Capacity.fromNodeCount(2, Optional.of("large"), true), 2, tester);
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class FilesApplicationPackageTest method testPreprocessing.
@Test
public void testPreprocessing() throws IOException, TransformerException, ParserConfigurationException, SAXException {
File appDir = temporaryFolder.newFolder();
IOUtils.copyDirectory(new File("src/test/resources/multienvapp"), appDir);
assertTrue(new File(appDir, "services.xml").exists());
assertTrue(new File(appDir, "hosts.xml").exists());
FilesApplicationPackage app = FilesApplicationPackage.fromFile(appDir);
ApplicationPackage processed = app.preprocess(new Zone(Environment.dev, RegionName.defaultName()), new BaseDeployLogger());
assertTrue(new File(appDir, ".preprocessed").exists());
String expectedServices = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><services xmlns:deploy=\"vespa\" xmlns:preprocess=\"properties\" version=\"1.0\">\n" + " <admin version=\"2.0\">\n" + " <adminserver hostalias=\"node0\"/>\n" + " </admin>\n" + " <content id=\"foo\" version=\"1.0\">\n" + " <redundancy>1</redundancy>\n" + " <documents>\n" + " <document mode=\"index\" type=\"music.sd\"/>\n" + " </documents>\n" + " <nodes>\n" + " <node distribution-key=\"0\" hostalias=\"node0\"/>\n" + " </nodes>\n" + " </content>\n" + " <jdisc id=\"stateless\" version=\"1.0\">\n" + " <search/>\n" + " <component bundle=\"foobundle\" class=\"MyFoo\" id=\"foo\"/>\n" + " <component bundle=\"foobundle\" class=\"TestBar\" id=\"bar\"/>\n" + " <nodes>\n" + " <node hostalias=\"node0\" baseport=\"5000\"/>\n" + " </nodes>\n" + " </jdisc>\n" + "</services>";
TestBase.assertDocument(expectedServices, processed.getServices());
String expectedHosts = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><hosts xmlns:deploy=\"vespa\" xmlns:preprocess=\"properties\">\n" + " <host name=\"bar.yahoo.com\">\n" + " <alias>node1</alias>\n" + " </host>\n" + "</hosts>";
TestBase.assertDocument(expectedHosts, processed.getHosts());
}
Aggregations