diff --git a/doc/source/job-content.rst b/doc/source/job-content.rst index 737fd7981c..e06753d917 100644 --- a/doc/source/job-content.rst +++ b/doc/source/job-content.rst @@ -1461,6 +1461,14 @@ executor running the job is available: A private IPv6 address of the node. + .. var:: node_properties + + Arbitrary mapping of node properties, such as boolean flags representing + criteria that were taken into account when a node is allocated to Zuul by + Nodepool. Notable properties are `spot` for when a node is an AWS spot + instance or `fleet` when the node was created by Nodepool using the AWS + fleet API. + SSH Keys -------- diff --git a/tests/base.py b/tests/base.py index 28e7fc404a..05c456838e 100644 --- a/tests/base.py +++ b/tests/base.py @@ -1301,7 +1301,8 @@ class FakeNodepool(object): image_id=None, host_keys=host_keys, executor='fake-nodepool', - hold_expiration=None) + hold_expiration=None, + node_properties={"spot": False}) if self.resources: data['resources'] = self.resources if self.remote_ansible: diff --git a/zuul/executor/server.py b/zuul/executor/server.py index f28bc8705f..b3b61208bf 100644 --- a/zuul/executor/server.py +++ b/zuul/executor/server.py @@ -2119,7 +2119,8 @@ class AnsibleJob(object): public_ipv4=node.public_ipv4, private_ipv4=node.private_ipv4, public_ipv6=node.public_ipv6, - private_ipv6=node.private_ipv6))) + private_ipv6=node.private_ipv6, + node_properties=node.node_properties))) # Ansible >=2.8 introduced "auto" as an # ansible_python_interpreter argument that looks up diff --git a/zuul/model.py b/zuul/model.py index 0f512750a7..b0ef6fa1ab 100644 --- a/zuul/model.py +++ b/zuul/model.py @@ -1895,6 +1895,7 @@ class Node(ConfigObject): self.attributes = {} self.tenant_name = None self.requestor = None + self.node_properties = {} @property def state(self):