use of com.yahoo.vespa.hosted.provision.NodeList 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.vespa.hosted.provision.NodeList in project vespa by vespa-engine.
the class AllocationVisualizer method paintComponent.
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
System.out.println("PAINTING");
if (steps.size() == 0)
return;
int nodeX = 40;
// Start at the bottom
int nodeY = BOX_HEIGHT - 20;
// Draw the box
g.setColor(Color.WHITE);
g.fillRect(0, 0, BOX_WIDTH, BOX_HEIGHT);
// Find number of docker hosts (to calculate start, and width of each)
// Draw the docker hosts - and color each container according to application
AllocationSnapshot simStep = steps.get(step);
NodeList hosts = simStep.nodes.nodeType(NodeType.host);
for (Node host : hosts.asList()) {
// Paint the host
paintNode(host, g, nodeX, nodeY, true);
// Paint containers
NodeList containers = simStep.nodes.childrenOf(host);
for (Node container : containers.asList()) {
nodeY = paintNode(container, g, nodeX, nodeY, false);
}
// Next host
nodeX += nodeWidth + nodeSpacing;
nodeY = BOX_HEIGHT - 20;
}
// Display messages
g.setColor(Color.BLACK);
g.setFont(new Font("Courier New", Font.BOLD, 15));
g.drawString(simStep.task, 20, 30);
g.drawString(simStep.message, 20, 50);
}
Aggregations