Search in sources :

Example 6 with NodeList

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);
}
Also used : Version(com.yahoo.component.Version) Zone(com.yahoo.config.provision.Zone) NodeList(com.yahoo.vespa.hosted.provision.NodeList) ApplicationId(com.yahoo.config.provision.ApplicationId) HostSpec(com.yahoo.config.provision.HostSpec) Test(org.junit.Test)

Example 7 with NodeList

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);
}
Also used : NodeList(com.yahoo.vespa.hosted.provision.NodeList) Node(com.yahoo.vespa.hosted.provision.Node) Font(java.awt.Font)

Aggregations

NodeList (com.yahoo.vespa.hosted.provision.NodeList)7 ApplicationId (com.yahoo.config.provision.ApplicationId)4 Zone (com.yahoo.config.provision.Zone)4 Test (org.junit.Test)4 HostSpec (com.yahoo.config.provision.HostSpec)3 Node (com.yahoo.vespa.hosted.provision.Node)3 Version (com.yahoo.component.Version)2 FlavorsConfig (com.yahoo.config.provisioning.FlavorsConfig)2 ImmutableSet (com.google.common.collect.ImmutableSet)1 Capacity (com.yahoo.config.provision.Capacity)1 ClusterMembership (com.yahoo.config.provision.ClusterMembership)1 ClusterSpec (com.yahoo.config.provision.ClusterSpec)1 Environment (com.yahoo.config.provision.Environment)1 Flavor (com.yahoo.config.provision.Flavor)1 NodeType (com.yahoo.config.provision.NodeType)1 OutOfCapacityException (com.yahoo.config.provision.OutOfCapacityException)1 RegionName (com.yahoo.config.provision.RegionName)1 NestedTransaction (com.yahoo.transaction.NestedTransaction)1 Curator (com.yahoo.vespa.curator.Curator)1 MockCurator (com.yahoo.vespa.curator.mock.MockCurator)1