Skip to content

Conversation

@giancarloromeo
Copy link
Contributor

@giancarloromeo giancarloromeo commented Apr 16, 2025

What do these changes do?

This PR enhances the storage service by adding support for storing and retrieving the task (job) name when listing Celery tasks. Key changes include:

  • Updating the API and AsyncJobGet model to include a job_name field.
  • Renaming methods (e.g. send_task to submit_task, set_progress to set_task_progress) and propagating these changes across tests and worker modules.
  • Adapting tests and RPC endpoints to account for the new task/job name handling.

When tasks are listed, the task_name is included into the response.

image

Related issue/s

How to test

Dev-ops checklist

@giancarloromeo giancarloromeo added the a:storage issue related to storage service label Apr 16, 2025
@giancarloromeo giancarloromeo added this to the Pauwel Kwak milestone Apr 16, 2025
@giancarloromeo giancarloromeo self-assigned this Apr 16, 2025
@codecov
Copy link

codecov bot commented Apr 16, 2025

Codecov Report

Attention: Patch coverage is 92.45283% with 8 lines in your changes missing coverage. Please review.

Project coverage is 88.89%. Comparing base (2c92f02) to head (8ea6823).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7538      +/-   ##
==========================================
+ Coverage   87.54%   88.89%   +1.35%     
==========================================
  Files        1747     1400     -347     
  Lines       67652    57725    -9927     
  Branches     1146      485     -661     
==========================================
- Hits        59224    51313    -7911     
+ Misses       8107     6280    -1827     
+ Partials      321      132     -189     
Flag Coverage Δ
integrationtests 65.20% <ø> (+<0.01%) ⬆️
unittests 87.96% <92.45%> (+1.24%) ⬆️
Components Coverage Δ
api ∅ <ø> (∅)
pkg_aws_library ∅ <ø> (∅)
pkg_dask_task_models_library ∅ <ø> (∅)
pkg_models_library 92.01% <100.00%> (+<0.01%) ⬆️
pkg_notifications_library ∅ <ø> (∅)
pkg_postgres_database ∅ <ø> (∅)
pkg_service_integration 70.03% <ø> (ø)
pkg_service_library ∅ <ø> (∅)
pkg_settings_library ∅ <ø> (∅)
pkg_simcore_sdk 85.40% <ø> (ø)
agent 96.46% <ø> (ø)
api_server 91.23% <ø> (ø)
autoscaling 96.08% <ø> (ø)
catalog 92.52% <ø> (ø)
clusters_keeper 99.24% <ø> (ø)
dask_sidecar 91.29% <ø> (ø)
datcore_adapter 98.12% <ø> (ø)
director 76.78% <ø> (ø)
director_v2 91.27% <ø> (-0.03%) ⬇️
dynamic_scheduler 97.40% <ø> (ø)
dynamic_sidecar 90.11% <ø> (ø)
efs_guardian 89.79% <ø> (ø)
invitations 93.28% <ø> (ø)
payments 92.66% <ø> (ø)
resource_usage_tracker 88.96% <ø> (-0.22%) ⬇️
storage 87.40% <91.91%> (-0.13%) ⬇️
webclient ∅ <ø> (∅)
webserver 85.98% <ø> (-0.01%) ⬇️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c92f02...8ea6823. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@giancarloromeo giancarloromeo requested a review from Copilot April 16, 2025 20:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

services/storage/src/simcore_service_storage/modules/celery/client.py:40

  • [nitpick] The renaming from 'send_task' to 'submit_task' improves clarity; please double-check that all call sites have been updated accordingly.
async def submit_task(

services/storage/src/simcore_service_storage/modules/celery/models.py:48

  • [nitpick] The legacy name validator in TaskMetadata sets a default empty 'name'; consider if an empty string is the most appropriate default for legacy tasks.
    @model_validator(mode="before")

services/storage/src/simcore_service_storage/modules/celery/backends/_redis.py:81

  • Verify that the ordering of keys from scan_iter aligns with the pipeline execution order to prevent any misalignment between keys and their corresponding metadata in the tasks list.
async for key in self._redis_client_sdk.redis.scan_iter(match=search_key + "*", count=_CELERY_TASK_SCAN_COUNT_PER_BATCH):

@giancarloromeo giancarloromeo requested a review from Copilot April 16, 2025 21:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the storage service by adding support for storing and retrieving the task (job) name when listing Celery tasks. Key changes include:

  • Updating the API and AsyncJobGet model to include a job_name field.
  • Renaming methods (e.g. send_task to submit_task, set_progress to set_task_progress) and propagating these changes across tests and worker modules.
  • Adapting tests and RPC endpoints to account for the new task/job name handling.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
services/web/server/tests/unit/with_dbs/01/storage/test_storage.py Updated test cases include job_name in AsyncJobGet instance.
services/web/server/src/simcore_service_webserver/tasks/_rest.py Changed task_name assignment from job.job_id to job.job_name.
services/storage/tests/unit/test_rpc_handlers_simcore_s3.py Updated to spy on the new set_task_progress method.
services/storage/tests/unit/test_modules_celery.py Updated task submission calls to use submit_task and adjusted dreamer_task signature.
services/storage/tests/unit/test_async_jobs.py Updated AsyncJobGet creation with job_name.
services/storage/src/simcore_service_storage/modules/celery/worker.py Renamed set_progress to set_task_progress.
services/storage/src/simcore_service_storage/modules/celery/models.py Introduced TaskName type alias and extended Task model.
services/storage/src/simcore_service_storage/modules/celery/client.py Changed send_task to submit_task and updated task metadata handling.
Other files (backends, RPC endpoints, REST endpoints, worker tasks, models-library) Adjusted implementation to support the additional job_name field.
Comments suppressed due to low confidence (1)

services/storage/tests/unit/test_modules_celery.py:92

  • The function 'dreamer_task' now requires an extra parameter 'task_id', but callers using submit_task do not supply this parameter. Consider updating the task registration or reverting the function signature to ensure consistent invocation.
async def dreamer_task(task: AbortableTask, task_id: TaskID) -> list[int]:

@giancarloromeo giancarloromeo marked this pull request as ready for review April 16, 2025 22:09
Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

thx!

Copy link
Member

@pcrespov pcrespov left a comment

Choose a reason for hiding this comment

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

Thx!

Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@bisgaard-itis bisgaard-itis left a comment

Choose a reason for hiding this comment

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

Very nice! I really like the solution with the pipeline. Thanks a lot for the effort. Left some small suggestions.

Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

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

Thanks!

@giancarloromeo giancarloromeo enabled auto-merge (squash) April 22, 2025 06:54
Copy link
Contributor

@GitHK GitHK left a comment

Choose a reason for hiding this comment

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

some minor things

@giancarloromeo giancarloromeo added the 🤖-automerge marks PR as ready to be merged for Mergify label Apr 22, 2025
@sonarqubecloud
Copy link

@giancarloromeo giancarloromeo merged commit 6dc3e0b into ITISFoundation:master Apr 22, 2025
94 checks passed
@matusdrobuliak66 matusdrobuliak66 mentioned this pull request May 8, 2025
34 tasks
@giancarloromeo giancarloromeo deleted the is7528/add-name-when-listing-tasks branch May 13, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖-automerge marks PR as ready to be merged for Mergify a:storage issue related to storage service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add task_name when listing Celery tasks

6 participants