use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.
the class DynamicDockerProvisioningTest method non_prod_do_not_have_spares.
@Test
public void non_prod_do_not_have_spares() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.perf, RegionName.from("us-east")), flavorsConfig());
tester.makeReadyNodes(3, "host-small", NodeType.host, 32);
deployZoneApp(tester);
Flavor flavor = tester.nodeRepository().getAvailableFlavors().getFlavorOrThrow("d-3");
ApplicationId application1 = tester.makeApplicationId();
List<HostSpec> hosts = tester.prepare(application1, ClusterSpec.request(ClusterSpec.Type.content, ClusterSpec.Id.from("myContent"), Version.fromString("6.100"), false), 3, 1, flavor.canonicalName());
tester.activate(application1, ImmutableSet.copyOf(hosts));
List<Node> initialSpareCapacity = findSpareCapacity(tester);
assertThat(initialSpareCapacity.size(), is(0));
}
use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.
the class ProvisioningTest method application_deployment_above_then_at_capacity_limit.
@Test
public void application_deployment_above_then_at_capacity_limit() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.prod, RegionName.from("us-east")));
ApplicationId application1 = tester.makeApplicationId();
tester.makeReadyNodes(5, "default");
// deploy
SystemState state1 = prepare(application1, 2, 0, 3, 0, "default", tester);
tester.activate(application1, state1.allHosts);
// redeploy a too large application
try {
SystemState state2 = prepare(application1, 3, 0, 3, 0, "default", tester);
fail("Expected out of capacity exception");
} catch (OutOfCapacityException expected) {
}
// deploy first state again
SystemState state3 = prepare(application1, 2, 0, 3, 0, "default", tester);
tester.activate(application1, state3.allHosts);
}
use of com.yahoo.config.provision.ApplicationId in project vespa by vespa-engine.
the class ProvisioningTest method staging_deployment_size.
@Test
public void staging_deployment_size() {
ProvisioningTester tester = new ProvisioningTester(new Zone(Environment.staging, RegionName.from("us-east")));
ApplicationId application = tester.makeApplicationId();
tester.makeReadyNodes(14, "default");
// becomes 1, 1, 1, 6
SystemState state = prepare(application, 1, 1, 1, 64, "default", tester);
assertEquals(9, state.allHosts.size());
tester.activate(application, state.allHosts);
}
use of com.yahoo.config.provision.ApplicationId 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.ApplicationId 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);
}
Aggregations