diff options
author | Jon Marius Venstad <jonmv@users.noreply.github.com> | 2023-11-09 14:35:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 14:35:17 +0100 |
commit | 7a716e90869023449fdc470159e4e7352966e0ef (patch) | |
tree | ea87519e76198754904d8eac1256f25b446ebdce | |
parent | ea760f0d787c439e95d44e213df1fc174fb3bf52 (diff) | |
parent | 220a6188df1cf8540c1d57c2acefaa51d955bd42 (diff) |
Merge pull request #29297 from vespa-engine/jonmv/re-tag-hosts
Jonmv/re tag hosts
2 files changed, 6 insertions, 2 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/HostProvisioner.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/HostProvisioner.java index 38cbfa7fe5f..8ef4b6c8bd1 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/HostProvisioner.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/HostProvisioner.java @@ -1,6 +1,7 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.provision.provisioning; +import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.CloudAccount; import com.yahoo.config.provision.HostEvent; import com.yahoo.config.provision.NodeAllocationException; @@ -56,7 +57,7 @@ public interface HostProvisioner { Runnable provisionHosts(HostProvisionRequest request, Predicate<NodeResources> realHostResourcesWithinLimits, Consumer<List<ProvisionedHost>> whenProvisioned) throws NodeAllocationException; /** - * Continue provisioning of given list of Nodes. + * Continue provisioning of the given host. * * @param host the host to provision * @return IP config for the provisioned host and its children @@ -93,4 +94,7 @@ public interface HostProvisioner { /** Returns whether flavor for given host can be upgraded to a newer generation */ boolean canUpgradeFlavor(Node host, Node child, Predicate<NodeResources> realHostResourcesWithinLimits); + /** Updates the given hosts to indicate that they are allocated to the given application. */ + default void updateAllocation(Collection<Node> hosts, ApplicationId owner) { } + } diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java index 978a69978b8..5f26b52ea4e 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/Preparer.java @@ -175,7 +175,7 @@ public class Preparer { if (parentLockOrNull != null) { List<Node> exclusiveParents = allocation.parentsRequiredToBeExclusive(); nodeRepository.nodes().setExclusiveToApplicationId(exclusiveParents, parentLockOrNull, application); - // TODO: also update tags + hostProvisioner.ifPresent(provisioner -> provisioner.updateAllocation(exclusiveParents, application)); } acceptedNodes = allocation.finalNodes(); nodeRepository.nodes().reserve(allocation.reservableNodes()); |