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

Add support for declarative policies #141

Open
lauwers opened this issue Feb 20, 2023 · 1 comment
Open

Add support for declarative policies #141

lauwers opened this issue Feb 20, 2023 · 1 comment

Comments

@lauwers
Copy link
Contributor

lauwers commented Feb 20, 2023

TOSCA's current policy syntax supports imperative policies only. These policies follow an event-condition-action pattern. We should add support for declarative policies that follow a context-capability-constraint pattern and express invariant conditions that must hold true at all times. Ironically, all the policy examples in the spec (e.g. colocation and anti-colocation placement policies) are examples of declarative policies, but TOSCA currently does not include syntax that allows one to define the semantics of such policies.

@lauwers
Copy link
Contributor Author

lauwers commented Mar 2, 2023

I envision declarative policies to be defined using a set of invariants, i.e. Boolean expressions that must hold true at all times. However, this will likely require extensions to our TOSCA Path syntax to allow get_property functions to access members of a group. For example:

groups:
  sw-group:
    members: [ sw1, sw2, sw3 ]

policies:
  anti-colocation:
    target: sw-group
    conditions:
      $not:
        $equal:
          - $get_property: [ ALL, RELATIONSHIP, host, TARGET, uuid ]
          - $get_property: [ OTHER, RELATIONSHIP, host, TARGET, uuid ]

In this TOSCA Path proposal, the ALL keyword means all members of the target group and OTHER means *all other members of the group`.

Alternatively, we could introduce a GROUP keyword to avoid the need to identify the target group in the policy definition. Comments?

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

1 participant