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

Include return progress arg #76

Merged
merged 41 commits into from
Jan 15, 2024
Merged

Include return progress arg #76

merged 41 commits into from
Jan 15, 2024

Conversation

burnout87
Copy link
Contributor

No description provided.

@burnout87 burnout87 self-assigned this Nov 29, 2023
@burnout87 burnout87 linked an issue Nov 29, 2023 that may be closed by this pull request
@dsavchenko
Copy link
Member

jobdir added to the response of nb2service for running jobs by oda-hub/nb2workflow#129

@burnout87
Copy link
Contributor Author

First round of review, mainly to understand if something is missing.

a small change in the dispatcher oda-hub/dispatcher-app#632 will also be needed

Copy link
Member

@dsavchenko dsavchenko left a comment

Choose a reason for hiding this comment

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

That's nice overall.

We need to agree on how this is treated by both frontend and oda_api to properly structure the dispatcher response, so we can get rid of unneded product methods (e.g. we don't really required to save this notebook representation into file with write if there won't be a "download" button)

dispatcher_plugin_nb2workflow/products.py Outdated Show resolved Hide resolved
dispatcher_plugin_nb2workflow/queries.py Show resolved Hide resolved
dispatcher_plugin_nb2workflow/products.py Outdated Show resolved Hide resolved
dispatcher_plugin_nb2workflow/dataserver_dispatcher.py Outdated Show resolved Hide resolved
dispatcher_plugin_nb2workflow/dataserver_dispatcher.py Outdated Show resolved Hide resolved
@dsavchenko
Copy link
Member

Edge cases:

  1. There is no such job in backend (normally, this doesn't happen, of course). In this case, we need to keep both _async_request_callback and _async_request in the request, the job will be submitted just like with run_query(). May be, there is even no need for additional adaptations. But the jobdir will most probably be None (see case 2)
  2. If the job is submitted to the async queue, but is not already running (status=submitted), the jobdir hasn't been set yet and will be returned as None. Needs separate treatment.
  3. Synchronous request. Not sure if this will work at all (at least I didn't do any adaptations to nb2workflow regarding jobdir for synchronous case). Need to check. (But generally speaking, synchronous backend is only applicable to really short jobs, and there is no need to track progress. Probably it makes sense to just disable this method somehow in this case?)

@dsavchenko
Copy link
Member

So, if I understand correctl the _async_request_callback arg is needed.

Seems so, finally

Copy link
Member

@dsavchenko dsavchenko left a comment

Choose a reason for hiding this comment

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

Only one fix and cool overall!

I only wonder how the response will then be used on the frontend side. We have full page html in json, how to show it there?

tests/test_plugin.py Outdated Show resolved Hide resolved
@dsavchenko dsavchenko self-requested a review January 4, 2024 18:14
@burnout87 burnout87 merged commit 54e1e15 into master Jan 15, 2024
2 checks passed
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.

use extra return_progress to return notebook
3 participants