Open carlito-scality opened 5 years ago
Quick update:
__orchestration_jid__
global)metalk8s.orchestrate.deploy_node
)Now, all of this works until we start using SaltAPI: for some reason, the JID returned by calling runner_async
is not passed down to state.orchestrate
as the orchestration_jid
, and all aforementioned events and annotation are now decorrelated from the parent job.
It is not just related to the async aspect of the execution, since salt-run --async state.orchestrate metalk8s...
has the expected behaviour.
Component: salt
Why this is needed:
In the UI, we want to watch events (see Salt docs) sent during a Node deployment via Salt.
When starting a job through SaltAPI using the
async
variant, we retrieve a JID (Job ID). However, the runner itself only sends two events:salt/run/<jid>/new
andsalt/run/<jid>/ret
. The states/other runners triggered by the parent runner will not know the parent JID, hence leaving no way to link them to the parent job.Consequently, we cannot show progress information during the deployment if relying on native events.
What should be done:
We need to be able to track all jobs spawned by a runner from the UI. Also, we need to track progress with higher-level info than detailed state names, since we want to make it as easy as possible for our users.
Implementation proposal (strongly recommended):
On Salt side, we should:
metalk8s.scality.com/active-orchestration
The UI should then:
LocalStorage
with themetalk8s.scality.com/active-orchestration
Node annotationmetalk8s/orchestrate/deploy_node/<jid>/<suffix>
for high-level infoTest plan:
One should be able to:
Relates to: #1045