Nodes can be exluded from deployment, if there is no tasks to run on this nodes.
Such nodes should not be switched to deployment state.
Change-Id: I4cd23769b7643aae7b149ba30e5b0e91a3021563
At now moment Astute do not send global progress
for transaction/deploy tasks. Nailgun should
calculate it using nodes progress.
This fix add ability to calculate progress in case
of transaction same way as for deploy.
Change-Id: I2c87b0de0bacb83ef98ff230f8ad0d5f7904becd
Closes-Bug: #1645612
(cherry picked from commit edc19fd0fc)
This commit switching tasks resolution approach to the tags based one.
Tag - minimal unit what's necessary only for task resolution and can be
mapped to the node through the role interface only. Each role provides set
of tags in its 'tags' field and may be modified via role API. Tag may be
created separately via tag API, but, this tag can not be used unless it's
stuck to the role.
Change-Id: Icd78fd124997c8aafb07964eeb8e0f7dbb1b1cd2
Implements: blueprint role-decomposition
A 'tags' attribute has been added to each role in 'roles_metadata'.
Initially all non-controller roles will only have a tag of their own
role name. This will allow existing tasks which do not have tags
associated with them to work correctly. In the abscence of tags a
task's roles will be used to determine which nodes it will run on.
Implements: blueprint role-decomposition
Change-Id: I390580146048b6e00ec5c42d0adf995a4cff9167
In transaction manager we need some custom node
serializer, since there is different number of fields
and raw status of node instead of calculated status of node.
So the new NodeSerializerForDeployment was introduced.
Change-Id: Id78a8549a293c98acf0bcd0d4c174e551ecf666a
Related-Bug: 1630605
If graph does not contain node_filter the default filter
will be used. this will help to improve UX when user works
with graph concept.
Change-Id: I237189436b4ed5dd64ef6d60a05c674d2f974eb4
Closes-Bug: 1630605
Pass through subgraphs list for Astute execution.
The format is a list of subgraphs with start/end.
The option is passed as-is to Astute.
Change-Id: I5c705076adcce4e47a62edc30d3d5a191f5ec813
Closes-bug: #1612616
Initializing of primary roles should be called
before creation of role_resolver.
Change-Id: I18146845f951f743dfb6a32554c3d35c2d1bd55b
Closes-Bug: 1622942
Because in-progress status has high priority in
mehtod Node.get_status, the status of node was not
recognized properly durring checking for redeploy.
Change-Id: I3e0ac97b02d25803b810950cda383c220611c309
Closes-Bug: 1622972
If yaql expression returned empty list the nodes_fillter
was not applied and graph was executed on all nodes from cluster.
Change-Id: I3bc70fa04453e051e31ff31949fd51e1ca5fa896
Closes-Bug: 1622650
In order to enable building a history of deployment transactions
for a custer it is necessary to keep track of start and end time
for them. This patch adds timestamp_start and timestamp_end attributes
to transactions, makes changes to the API serializers and introduces
appropriate database fields to store that information
I've added times only for 'deployment' task, which is the only
one, needed by new UI feature. At this point there is no single
point, where task switches to error or ready state and I'd have
to set in in many places.
Whem everything-is-a-graph approach will be fully implemented
it would be very easy. So let's not add unnecessary code now.
Co-authored by: Roman Prykhodchenko <me@romcheg.me>
Co-authored by: Dmitry Guryanov <dguryanov@mirantis.com>
DocImpact
Closes-bug: #1593753
Change-Id: Ib206d75a8d2215f8fd6b3f89e209c6e86ed20d0f
Also reworked legacy task manger to use this flag
instead of patch every deployment task
Change-Id: Ic4031b94ee359d414f1834a56b085ff12cc6b38f
Closes-Bug: 1618774
The size of deployment_info grows as n^2 depending on
nodes number. That's because common_attrs, which is
merged into each node's contains info about all nodes.
For example for 600 nodes we store about 1Gb of data in
the database. So as first step let's store common_attrs
separately in deployment_info structure inside python
code and in the database.
Also removed old test for migrations, which are not related
to actual database state.
Change-Id: I431062b3f9c8dedd407570729166072b780dc59a
Partial-Bug: #1596987
UI expects that name of supertask is deploy.
Also create supertask in running state to improve
responsibility of UI.
Added dry_run and graph_type to task serialization output
Change-Id: I6f8620e3dbefd6d3b1dfaf8015f6c2c56e9db09a
Closes-Bug: 1618541
Simultaneous run of 2 or tasks may cause
side-effects and the simplest way is prevent this action.
Also fixed all places where rpc.cast called without commit
Change-Id: I029768900d345540c3b501f1fa3649b063d3a55d
Partial-Bug: 1615557
Task model is extended with noop_run boolean column;
Introdicing and passing down the noop_run param from API to
execution manager;
Execution manager supports noop_run argument,
and uses it for creating astute message;
DeploymentHistory model is extended with summary JSON column;
The summary column should be returned only if some
include_summary=1 query string is passed to API.
Implements blueprint: puppet-noop-run
Change-Id: I80090d96f818cef7c6f88208bdacf5849f0f5d0f
Temporary enable saving error status in db, because
there is a lot of logic which relaes to error status of node.
Need to split node status to 2 different fields:
node.state and node.status
Change-Id: Id75f05826dd8116c8bc768709f7779b4aeac0167
Blueprint: graph-concept-extension
Added support for node filters and node_transitions.
If one of node_transitions status is not specified,
the default will be used, where default is:
- on success: switch node to status ready
- on error: switch node to status error
- on stop: swith node to status stopped
Change-Id: I8b4d49dc1bada2479017697bf5858e85958579f2
Blueprint: graph-concept-extension
The transient statuses are not persited in DB because
the status of node should represent the current state
of node, for example: node is provisioned or node is deployed.
The synthetic states: like error, deploying, etc. are used
only for providing additional for user about status of node at this moment.
This statuses can be calculated on demand.
Also node.error_type has type 'String' instead of 'Enum'
Also added handling status 'deleted' in response, which means that node should be deleted from cluster.
Change-Id: If5e79b9274f34e01d2b795491c23361c9050669d
Blueprint: graph-concept-extension
So far Nailgun has a bunch of managers for various tasks (transactions).
The way towards everything-is-a-graph means we won't have hardcoded
transactions and hence requires a new single manager to handle them all.
Transaction manager runs specified graphs on specified nodes within
single transaction (task), so anyone can poll it to check the progress.
Co-Authored-By: Igor Kalnitsky <igor@kalnitsky.org>
Change-Id: I98df7b98a07f64d97b561b85faa8472c3c551346
Blueprint: graph-concept-extension