Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic group membership #146

Open
lauwers opened this issue Mar 2, 2023 · 3 comments
Open

Dynamic group membership #146

lauwers opened this issue Mar 2, 2023 · 3 comments

Comments

@lauwers
Copy link
Contributor

lauwers commented Mar 2, 2023

I have a use case where I need dynamic group membership. For example, I may need a group of all the Compute nodes with less than 4G of RAM (where the memory size is either provided as an input or obtained through a discovery process). With our current group syntax, the only way to specify group members is through node template names. What if instead we defined some type of member filter that dynamically selects group members based on property values? Of course this may require extensions to our TOSCA Path syntax to identify group members inside get_property functions. Any suggestions?

@pmjordan
Copy link
Contributor

pmjordan commented Mar 6, 2023

Groups with dynamically assigned members have been useful to me in other contexts. Perhaps the node_filter syntax could be used to define the group membership?
TOSCA Traversal Path already complex; is there really a need to add further complexity? Are you suggesting getting a property of the group or getting a property of one or more members of the group?

@lauwers
Copy link
Contributor Author

lauwers commented Mar 9, 2023

Yes, I'm suggesting that the node_filter syntax could be leveraged for this purpose. I probably confused things by using the word member_filter rather than node_filter. I envisioned that the syntax would be the same, but the purpose would be different.

After thinking about this more, perhaps we don't need extensions to the TOSCA Path syntax, as long as we specify that the SELF keyword refers to any node in the service topology that is a candidate for inclusion in the group. We may, however, need to introduce some additional functions. Using the example above, I could express dynamic group membership as follows:

groups:
  tiny_compute:
    members:
      $and:
        - $has_type: [ SELF, tosca:Compute ]
        - $less_or_equal:
          - $get_property: [ SELF, mem_size ]
          - 4 GB

Of course, the syntax should continue to allow specifying members using the node template name as well.

@pmjordan
Copy link
Contributor

pmjordan commented Mar 9, 2023

OK the concept and syntax is clearer to me now.
The example above couldn't be used in the V2 document as we no longer have tosca:Compute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants