Deploying components one by one, deploys all the components each time instead of only the new components

Bug #1362744 reported by Ryan Peters
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Murano
Invalid
Critical
Stan Lagun

Bug Description

To recreate:

Add app1 to an environment and deploy environment.
After that deploy finishes, add app2 to the same environment and deploy again.

It appears to be deploying both apps instead of just app2.

Revision history for this message
Ryan Peters (rjpeter2) wrote :
Revision history for this message
Ryan Peters (rjpeter2) wrote :
Revision history for this message
Ryan Peters (rjpeter2) wrote :
Changed in murano:
status: New → Confirmed
milestone: none → juno-3
assignee: nobody → Stan Lagun (slagun)
importance: Undecided → High
ruhe (ruhe)
Changed in murano:
importance: High → Critical
Revision history for this message
Stan Lagun (slagun) wrote :

This is expected behavior. Engine cannot just redeploy added application because it doesn't know that it is the only change you did. You could have possibly modify properties of other applications that are already deployed or want it to verify that is indeed in desired state. It is up to individual applications/components to examine what has changed since last deployment and to adopt to that change.

There is an attributes API that helps with that. Attributes are key-value storage that is bound to a pair (class, instance) and consists of just 2 methods: getAttr(name, optionalDefault) and setAttr(name, value) where value can be of any supported primitive type.

The simplest thing you can do in your application is to have something like
If: $.getAttr(isDeployed, false)
Then:
   - deploy
   - your
   - app
   - ...
   - $.setAttr(isDeployed, true)

But with such approach application will ignore any changes done to its properties after initial deployment. More advanced application will have such checks on a more granular level and will store in attribute storage previous property value rather than boolean flag

Changed in murano:
status: Confirmed → Invalid
Revision history for this message
Stan Lagun (slagun) wrote :

Sorry, it supposed to be

If: not $.getAttr(isDeployed, false)
Then:
  - ...

Revision history for this message
Stan Lagun (slagun) wrote :

And even better approach is to have such deployment scripts (shell etc.) that are idempotent e.g. can be run several times without causing errors. Typical script will check the state of the system and apply only the minimal needed actions to bring the system to desired state. Thus application redeployment will be very fix as there will be no changes in Heat stack resources and all scripts executed on VMs will actually do nothing and exit quickly. But if something was accidentally removed from VM or got broken script will repair it back ensuring that the application is in predictable state after deployment even if no properties were changed

ruhe (ruhe)
Changed in murano:
milestone: juno-3 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.