- 
                Notifications
    
You must be signed in to change notification settings  - Fork 32
 
♻️🐛🎨 Renaming and redesign of celery task metadata #8388
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
♻️🐛🎨 Renaming and redesign of celery task metadata #8388
Conversation
          Codecov Report❌ Patch coverage is  Additional details and impacted files@@            Coverage Diff             @@
##           master    #8388      +/-   ##
==========================================
+ Coverage   87.65%   87.91%   +0.25%     
==========================================
  Files        1832     1954     +122     
  Lines       71560    76107    +4547     
  Branches     1341     1342       +1     
==========================================
+ Hits        62726    66907    +4181     
- Misses       8433     8796     +363     
- Partials      401      404       +3     
 
 Continue to review full report in Codecov by Sentry. 
 🚀 New features to boost your workflow:
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
          
 | 
    
| 
           @Mergifyio queue  | 
    
          
 🟠 Waiting for conditions to match
  | 
    



What do these changes do?
celery-library) one can pass two different types of metadata:ExecutionMetadataandOwnerMetadata.ExecutionMetadataspecifies how and where a task should be executed and also additional properties associated with the behavior of the task (e.g.ephemeral).OwnerDatais a very flexible type of metadata which can be stored together with the task. The owner must specify who he is in theOwnerData(via theownerfield), but apart from that he can pass along other types of metadata as he pleases. Later he can filter his own tasks using a wildcard pattern.ExecutionMetadata(e.g. where the task should be executed) and hides that complexity for the api-server. On the other hand, when an osparc user requests the status for his task via the api-server, the api-server can now query the status directly via thecelery-library's task_manager. I.e. from the point of view of the api-server it is irrelevant where the task "lives" just to get the status. This works because the api-server'sOwnerMetadatais passed along in the storage rpc interface without modification.task_uuid, because that way, when the user requests the result of the task, the api-server could figure out what is the response model and validate it. This is required in order to adhere to the google api design guideline for long running task APIs (https://github.com/googleapis/googleapis/blob/master/google/longrunning/operations.proto#L150). With these design changes the endpoint'soperation_idcan easily be added to theOwnerMetadatato achieve exactly this.OwnerMetadatarequires anownerof a celery task to be specified means that owners will only see the tasks they own and no more. So this should work as a kind of security feature.Related issue/s
How to test
Dev-ops