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

✨ Webserver reports copy progress #3287

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Aug 26, 2022

What do these changes do?

webserver micro-service

  • POST /projects now reports progress of copy as % and gives info on how much data was already copied in its message
  • frontend will receive a progress between 0.0 and 1.0 together with a message of containing the progress in absolute data size value

storage micro-service

  • changes POST /{api_vtag}/simcore-s3/folders to a long running task (e.g. Accepted, get status, get result)

image
@odeimaiz : this will need your 🪄 here

Related issue/s

NOTE: first #3290 must go in

How to test

Checklist

@sanderegg sanderegg added this to the Brutalism milestone Aug 26, 2022
@sanderegg sanderegg self-assigned this Aug 26, 2022
@codecov
Copy link

codecov bot commented Aug 26, 2022

Codecov Report

Merging #3287 (07c1174) into master (07c1174) will not change coverage.
The diff coverage is n/a.

❗ Current head 07c1174 differs from pull request most recent head a83b282. Consider uploading reports for the commit a83b282 to get more accurate results

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3287   +/-   ##
======================================
  Coverage    76.2%   76.2%           
======================================
  Files         321     321           
  Lines       10863   10863           
  Branches     1541    1541           
======================================
  Hits         8288    8288           
  Misses       2367    2367           
  Partials      208     208           
Flag Coverage Δ
unittests 76.2% <0.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch from de5c04f to 8518652 Compare August 26, 2022 12:50
@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch 6 times, most recently from 6a76b75 to 1fc28e5 Compare August 30, 2022 15:56
@sanderegg sanderegg modified the milestones: Brutalism, Brutalism+1 Aug 30, 2022
@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch from 6dc29c0 to e0edfb3 Compare August 30, 2022 19:44
@sanderegg sanderegg marked this pull request as ready for review August 30, 2022 19:47
@sanderegg sanderegg requested a review from odeimaiz August 30, 2022 19:47
@sanderegg sanderegg changed the title ✨ migrate copy folder endpoint to long running async request ✨ Webserver reports copy progress Aug 30, 2022
@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch from 2ee04e6 to 434c5fb Compare August 31, 2022 08:39
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.

Very nice, I've appreciated the long running tasks interface.

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.

Excellent work.
Some minor comments and one request: can we limit the digits in the progress to at most 3 ? e.g. for a progress between 0 - 1, I find a bit strange to have to deal with the digits that are not highlighted 0.051234567899

@@ -4985,7 +4985,7 @@ paths:
content:
application/json:
schema:
$ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/put/responses/200/content/application~1json/schema'
$ref: '#/paths/~1projects~1%7Bproject_id%7D~1nodes~1%7Bnode_id%7D~1resources/get/responses/200/content/application~1json/schema'
Copy link
Member

Choose a reason for hiding this comment

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

curious that the generator takes now the get instead of the put path to find the schema. I guess this has to do with the version issue we saw some days ago.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes I'll regenerate it again at the office to be sure...

new_project, new_project["uuid"], hidden=False
)
starting_value = task_progress.percent
async for long_running_task in copy_data_folders_from_project(
Copy link
Member

Choose a reason for hiding this comment

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

Just to see if i understood: here you are connecting two long-running tasks

So this mean that the webserver waits (i.e. polls storage until tasks is completed) until the all the data is fully copied. since this coroutine is awaited within create_project. Then the webserver handler for CREATE project is built as a long running task as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

yes 2 long running tasks are connected here.

technically the create_project was already waiting for storage to complete. The long running task allows:

  • no super large request anymore (the request can spend several minutes)
  • it is potentially possible to retry in case of network issue (retrials, this is not yet the case in the frontend, but the client does retry on connection lost (60 seconds)
  • progress reporting is now possible (and is implemented as such)
  • potentially could also return faster if the request completed fast (not implemented)

@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch 6 times, most recently from 42dbfa4 to c2955a0 Compare September 5, 2022 09:16
@sanderegg sanderegg force-pushed the enhancement/storage_copy_long_running_task branch from c2955a0 to a83b282 Compare September 5, 2022 12:43
@sonarqubecloud
Copy link

sonarqubecloud bot commented Sep 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sanderegg sanderegg merged commit 72565a6 into ITISFoundation:master Sep 5, 2022
@sanderegg sanderegg deleted the enhancement/storage_copy_long_running_task branch September 5, 2022 16:36
@elisabettai
Copy link
Collaborator

I've just tried to copy a "large" (10-20 Gb on AWS staging) and it fails with a 500.
image

@sanderegg
Copy link
Member Author

@elisabettai : the frontend was improved regarding retries as well in #3326
this is not yet in staging and I would try again when this one is in. Then if this happens again we shall open a new issue, and link it with ITISFoundation/osparc-issues#558

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