Skip to content
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

Update job status and workflow node job status based on websocket events #7940

Conversation

mabashian
Copy link
Member

@mabashian mabashian commented Aug 19, 2020

SUMMARY

link #6616
link #7157

This PR does a couple of things:

  1. Workflow results will now update (job status) in real time based on consuming websocket messages.
    workflow_sockets
  2. When a workflow finishes running, the nodes are refreshed via the API so that we can display all data that comes available after a job finishes.
  3. The status of any job (playbook, project sync, etc) will now update in real time based on consuming websocket messages.
    playbook_sockets
  4. Once a job finishes running, the job is refreshed via the API so that we can display all data that comes available after a job finishes.
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME
  • UI

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@mabashian
Copy link
Member Author

Note to self - remove this line:

{/* TODO: hookup status to websockets */}

summary_fields: {
job: {
name: 'Foo Job Template',
elapsed: 9000,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elapsed: 9000,
elapsed: 9001,


if (
['successful', 'failed', 'error', 'cancelled'].includes(
lastMessage.status
Copy link
Contributor

@jakemcdermott jakemcdermott Aug 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once a job finishes running, the job is refreshed via the API so that we can display all data that comes available after a job finishes.

I like the approach of adding the auto-reload to the hook in order to fetch the summary data when a final status event is received. 👍

The summary statistics may not be correct until the job details endpoint returns "event_processing_finished": true,. Depending on the scale of the job, this can happen long after the final job status message is received.

To detect when event processing is actually finished, we might need to enter a retry loop and poll the api until the event_processing_finished flag is true or some reasonable retry limit is reached.

Copy link
Contributor

@jakemcdermott jakemcdermott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I would like to see a retry loop added for event_processing_finished (see: https://github.com/ansible/awx/pull/7940/files#r474040690) but doesn't necessarily need to be in this PR.

@unlikelyzero
Copy link

unlikelyzero commented Sep 3, 2020

@mabashian this bug is live on devel and this branch: #8076
Will finish testing by EOD today

@mabashian mabashian force-pushed the 6616-workflow-results-sockets branch from 237a9b0 to 679465d Compare September 3, 2020 18:50
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@dsesami
Copy link
Contributor

dsesami commented Sep 8, 2020

@unlikelyzero verify that the Jobs List websocket events work alongside the workflow in two different windows. I'd like to make sure it all lines up.

@unlikelyzero
Copy link

@mabashian we have a working test for this but need some sort of testability added to the sparkline elements. At the moment, there is no way to determine their state.

…an determine whether or not a status has been updated via websockets.
@mabashian mabashian force-pushed the 6616-workflow-results-sockets branch from 5ebe4f0 to 8fab455 Compare September 11, 2020 13:28
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@mabashian
Copy link
Member Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@mabashian
Copy link
Member Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

@mabashian
Copy link
Member Author

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

@unlikelyzero
Copy link

tested via #5501

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 412a294 into ansible:devel Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants