-
Notifications
You must be signed in to change notification settings - Fork 23
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
Added flow ExpandCluserWithDetectedPeers #831
Added flow ExpandCluserWithDetectedPeers #831
Conversation
This flow would be invoked from tendrl-node-agent on the additionally detected new peers of the cluster. New nodes would be provisioned with monitoring etc and imported into the cluster in tendrl system. tendrl-bug-id: Tendrl#805 Signed-off-by: Shubhendu <shtripat@redhat.com>
@r0h4n @nthomas-redhat @GowthamShanmugam @a2batic @gnehapk plz review |
} | ||
_cluster.save() | ||
|
||
node_ids = self.parameters.get("Node[]", []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to detect which nodes are new (check :https://github.com/Tendrl/commons/blob/master/tendrl/commons/flows/import_cluster/__init__.py#L40)
Also, Add a flag "is_managed" to cluster node context, set this from tendrl-gluster-integration service, use this to figure out which nodes are new ("clusternodecontext.is_managed") wouldnt exist for such nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought detection code would be separate and after detection, it would invoke this flow. Anyway will try to introduce this is_managed
flag with cluster_node_context object and use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still feel flow should be independent of detection code and as expected it should expect a nodes list for executing the expand of cluster. If that was the case we could just formed and saved jobs while detection itself, why have a separate flow defined for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not talking about detecting the sds or making detected_cluster_id. This flow will be called only after the new nodes have the same TendrlContext (i.e same integration_id). So all you need to do is read list of nodes from here https://github.com/Tendrl/commons/blob/master/tendrl/commons/flows/import_cluster/__init__.py#L38
and then import those nodes for which ClusterNodeContext.is_managed is "no"
enabled: true | ||
inputs: | ||
mandatory: | ||
- "Node[]" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node[] not required
Codecov Report
@@ Coverage Diff @@
## master #831 +/- ##
=========================================
Coverage ? 73.32%
=========================================
Files ? 85
Lines ? 3254
Branches ? 408
=========================================
Hits ? 2386
Misses ? 811
Partials ? 57
Continue to review full report at Codecov.
|
|
||
loop_count = 0 | ||
# Wait for (no of nodes) * 6 minutes for import to complete | ||
wait_count = len(node_ids) * 36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r0h4n node_ids
is not the list of nodes with which the cluster is expanded. Rather this is the full list of nodes as few skips might happen at L#70. We should wait for only no of nodes which actually executed import cluster flow here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please send a fix
This flow would be invoked from tendrl-node-agent on the additionally
detected new peers of the cluster. New nodes would be provisioned with
monitoring etc and imported into the cluster in tendrl system.
tendrl-bug-id: #805
Signed-off-by: Shubhendu shtripat@redhat.com