scality / metalk8s

An opinionated Kubernetes distribution with a focus on long-term on-prem deployments
Apache License 2.0
357 stars 45 forks source link

Node-Management Send fire_event for deployement steps #1111

Open carlito-scality opened 5 years ago

carlito-scality commented 5 years ago

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 and salt/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:

The UI should then:

Test plan:

One should be able to:


Relates to: #1045

gdemonet commented 5 years ago

Quick update:

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.