Comments (7)
Converting this issue to a docs update issue. I'll make a PR sometime after I've used it a bit more.
from girder_worker.
I assume we want to pass some small information to the endpoint, such as the job's completion status and the job ID, but not large data, like an output file. Further, I assume the hook could have some auth token to send to the endpoint to show that it is a trusted source.
Do all status hooks get triggered after all result hooks, as the success of processing result hooks is part of the final status of the job? Or would you want a flag indicating where in the job's life cycle the status hook should be called?
from girder_worker.
I assume we want to pass some small information to the endpoint, such as the job's completion status and the job ID, but not large data, like an output file
Yes.
Further, I assume the hook could have some auth token to send to the endpoint to show that it is a trusted source.
Also yes.
Do all status hooks get triggered after all result hooks.
That's how I imagine it would work.
Or would you want a flag indicating where in the job's life cycle the status hook should be called?
I don't know. I've never had a use case where I cared about a status other than completion. We could definitely have hooks that trigger for specific statuses, like queued, started, completed, but I've never needed any of that, so I think I'd prefer to do option 1 I really don't know.
from girder_worker.
The way I've always handled this is to attach special metadata fields to the job, then hook into the job update event on the server and check if it's a status update, and if so take action on whatever piece of data I linked into the job.
# create some job
job = ...
# link it to some piece of data
job['relatedThingId'] = item['_id']
Job().save(job)
def load(self, info):
events.bind('jobs.job.update', 'my_plugin', jobUpdated)
Maybe you already knew about that and were making a case that the webhook approach is superior, however unless we actually have a use case to talk to something other than Girder I'm not convinced. What makes this preferable to using the existing job update endpoint to listen to job updates? If we just want more specificity of events, we could add those as more granular server-side events, such as jobs.jobs.update.status
instead of just jobs.job.update
, for example.
from girder_worker.
Maybe you already knew about that and were making a case that the webhook approach is superior.
No, I didn't know this was possible. It would be great to add this to the docs. I'll try it out. Thanks!
from girder_worker.
Cool. FWIW, another common need is to come from the other direction when linking data -- that is, linking file(s) produced by a worker job back to some existing data in Girder. The way to accomplish that is using the reference
feature on the output, like so.
from girder_worker.
Thanks. Our docs for the new girder_worker architecture are abysmal. We've heretofore done everything via tribal knowledge and reading source code.
from girder_worker.
Related Issues (20)
- RFC: Consider cache configuration in new girder worker tasks HOT 2
- Girder worker integration test plugin is not compatible with girder 3.
- Create "How to write an integration test" documentation for girder worker
- spaces in girder folder name are incorrectly converted to container args. HOT 5
- Check if Celery Pinning is still necessary HOT 24
- Docker in docker permission issue HOT 1
- Girder Client 2.4.0 breaking integration test HOT 7
- girder_plugin settings for worker.api_url, worker.broker, worker.backend are not being picked up correctly HOT 3
- Using kwargs in chained tasks fails to create Job object
- Revoke integration tests are hanging HOT 1
- girder_result_hooks cleanup methods are not called after task is done
- File paths from docker transforms should be wrapped in quotes HOT 1
- Running NVidia dockers
- docker_run can't process non-string arguments HOT 3
- Exceptions are silently ignored during plugin load
- Girder plugin: use setting default HOT 1
- Pin celery version in requirements.in HOT 1
- How can I pass env variables from within DSA to a image that is being added through slicer web task
- Is the "DIRECT_PATH" checkbox actually used ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from girder_worker.