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

added a new event 'progress' #2498

Merged
merged 2 commits into from
Aug 24, 2018
Merged

added a new event 'progress' #2498

merged 2 commits into from
Aug 24, 2018

Conversation

honnix
Copy link
Member

@honnix honnix commented Aug 22, 2018

@ulzha PTAL

Description

Added a new event named event.core.progress.

Motivation and Context

This event can be fired by the task itself while running. The purpose is
for the task to report progress, metadata or any generic info so that
event handler listening for this can keep track of the progress of
running task.

Have you tested this? If so, how?

I have included unit tests.

This event can be fired by the task itself while running. The purpose is
for the task to report progress, metadata or any generic info so that
event handler listening for this can keep track of the progress of
running task.
@ulzha
Copy link
Contributor

ulzha commented Aug 22, 2018

LGTM

@ulzha
Copy link
Contributor

ulzha commented Aug 22, 2018

One urging side thought - there is some existing code already, catering for similar communication:

  • TaskStatusReporter, that has update_progress_percentage method, among others, for sending some communication from the task
  • SchedulerMessage, that allows receiving communication from the scheduler by the task

I guess anyway the use of events would be preferable, could allow us to eventually replace the ad-hoc code?

@honnix
Copy link
Member Author

honnix commented Aug 22, 2018

Are those for communication from worker to scheduler? If that is the case, it doesn't seem to fit very well to our use case.

Copy link
Contributor

@Tarrasch Tarrasch left a comment

Choose a reason for hiding this comment

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

I know we're not the best at it, but can we start adding docs to all new Event entries?

Just copy what you said in this PR description and make sure it renders decently with pydocs (we have docs testing instructions)

@honnix
Copy link
Member Author

honnix commented Aug 22, 2018

@Tarrasch 👍 for that, will fix.

@@ -25,6 +25,10 @@ class Event(object):
DEPENDENCY_PRESENT = "event.core.dependency.present"
BROKEN_TASK = "event.core.task.broken"
START = "event.core.start"
#: This event can be fired by the task itself while running. The purpose is
Copy link
Member Author

Choose a reason for hiding this comment

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

Tried following existing inline doc. How does it look? @Tarrasch

@ulzha
Copy link
Contributor

ulzha commented Aug 23, 2018

I didn't mean to include communication with the scheduler in our solution. It was just an aside comment, that we'll now be "reporting progress" in 2 different ways, and that I prefer event approach among those.

@honnix
Copy link
Member Author

honnix commented Aug 23, 2018

OK. Got it.

@honnix honnix merged commit c87644d into master Aug 24, 2018
@honnix honnix deleted the progress-event branch August 24, 2018 08:04
honnix added a commit that referenced this pull request Aug 24, 2018
dlstadther added a commit to dlstadther/luigi that referenced this pull request Sep 1, 2018
* upstream-master:
  Fix S3Client.copy return value consistency (spotify#2488)
  s3client check for deprecated host keyword and raise error with the details (spotify#2493)
  Fix exception when toml lib is not installed (spotify#2506)
  Add Okko to companies that use luigi (spotify#2512)
  Added optional choice for hdfs clients  (spotify#2487)
  Version 2.7.8
  revert tornado upgrade
  Version 2.7.7
  added a new event 'progress' (spotify#2498)
  Add Uppsala University / pharmb.io as user (spotify#2496)
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.

4 participants