use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class ProvisioningTest method application_deployment_is_not_given_unallocated_nodes_having_retired_flavor.
@Test
public void application_deployment_is_not_given_unallocated_nodes_having_retired_flavor() {
String flavorToRetire = "default";
String replacementFlavor = "new-default";
FlavorConfigBuilder b = new FlavorConfigBuilder();
b.addFlavor(flavorToRetire, 1., 1., 10, Flavor.Type.BARE_METAL).cost(2).retired(true);
FlavorsConfig.Flavor.Builder newDefault = b.addFlavor(replacementFlavor, 2., 2., 20, Flavor.Type.BARE_METAL).cost(2);
b.addReplaces(flavorToRetire, newDefault);
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")), b.build());
ApplicationId application = tester.makeApplicationId();
// Add nodes
tester.makeReadyNodes(4, flavorToRetire);
tester.makeReadyNodes(4, replacementFlavor);
SystemState state = prepare(application, 2, 0, 2, 0, flavorToRetire, tester);
tester.activate(application, state.allHosts);
List<Node> nodes = tester.getNodes(application).asList();
assertTrue("Allocated nodes have flavor " + replacementFlavor, nodes.stream().allMatch(n -> n.flavor().name().equals(replacementFlavor)));
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class ProvisioningTest method deploy_specific_vespa_version.
@Test
public void deploy_specific_vespa_version() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.dev, RegionName.from("us-east")));
ApplicationId application = tester.makeApplicationId();
tester.makeReadyNodes(4, "default");
SystemState state = prepare(application, 2, 2, 3, 3, "default", Version.fromString("6.91"), tester);
assertEquals(4, state.allHosts.size());
tester.activate(application, state.allHosts);
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class ProvisioningTest method out_of_capacity_no_replacements_for_retired_flavor.
@Test
public void out_of_capacity_no_replacements_for_retired_flavor() {
String flavorToRetire = "default";
String replacementFlavor = "new-default";
FlavorConfigBuilder b = new FlavorConfigBuilder();
b.addFlavor(flavorToRetire, 1., 1., 10, Flavor.Type.BARE_METAL).cost(2).retired(true);
FlavorsConfig.Flavor.Builder newDefault = b.addFlavor(replacementFlavor, 2., 2., 20, Flavor.Type.BARE_METAL).cost(2);
b.addReplaces(flavorToRetire, newDefault);
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")), b.build());
ApplicationId application = tester.makeApplicationId();
try {
prepare(application, 2, 0, 2, 0, flavorToRetire, tester);
fail("Expected exception");
} catch (OutOfCapacityException e) {
assertTrue(e.getMessage().startsWith("Could not satisfy request"));
}
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class ProvisioningTest method application_deployment_multiple_flavors_default_per_type.
@Test
public void application_deployment_multiple_flavors_default_per_type() {
ConfigserverConfig.Builder config = new ConfigserverConfig.Builder();
config.environment("prod");
config.region("us-east");
config.defaultFlavor("not-used");
config.defaultContainerFlavor("small");
config.defaultContentFlavor("large");
ProvisioningTester tester = new ProvisioningTester(new Zone(new ConfigserverConfig(config), new NodeFlavors(new FlavorsConfig(new FlavorsConfig.Builder()))));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(10, "small");
tester.makeReadyNodes(9, "large");
// deploy
SystemState state1 = prepare(application1, 2, 3, 4, 5, null, tester);
tester.activate(application1, state1.allHosts);
assertEquals("'small' nodes are used for containers", 2 + 3, tester.getNodes(application1, Node.State.active).flavor("small").size());
assertEquals("'large' nodes are used for content", 4 + 5, tester.getNodes(application1, Node.State.active).flavor("large").size());
}
use of com.yahoo.config.provision.Zone in project vespa by vespa-engine.
the class ProvisioningTest method dev_deployment_size.
@Test
public void dev_deployment_size() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.dev, RegionName.from("us-east")));
ApplicationId application = tester.makeApplicationId();
tester.makeReadyNodes(4, "default");
SystemState state = prepare(application, 2, 2, 3, 3, "default", tester);
assertEquals(4, state.allHosts.size());
tester.activate(application, state.allHosts);
}
Aggregations