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

✨Storage can return a S3 link instead of a presigned link on demand #3004

Merged
merged 7 commits into from
Apr 26, 2022

Conversation

sanderegg
Copy link
Member

@sanderegg sanderegg commented Apr 25, 2022

What do these changes do?

This PR let storage return a valid S3 link for upload and download links.
This is a pre-requisite to be able to avail the 5GiB issue in AWS.

Modifies storage micro-service REST API like so:

  • adds a link_type query parameter that accepts s3 or presigned (default) when calling GET/PUT entrypoints for download/upload link respectively

Related issue/s

How to test

Checklist

@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #3004 (cb2a133) into master (f1ab2d7) will increase coverage by 0.0%.
The diff coverage is 86.9%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #3004   +/-   ##
======================================
  Coverage    79.6%   79.7%           
======================================
  Files         688     688           
  Lines       28735   28748   +13     
  Branches     3705    3707    +2     
======================================
+ Hits        22899   22922   +23     
+ Misses       5026    5015   -11     
- Partials      810     811    +1     
Flag Coverage Δ
integrationtests 65.6% <ø> (+<0.1%) ⬆️
unittests 75.4% <86.9%> (+<0.1%) ⬆️

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

Impacted Files Coverage Δ
...ervices/storage/src/simcore_service_storage/dsm.py 72.3% <83.3%> (-0.1%) ⬇️
...es/storage/src/simcore_service_storage/handlers.py 71.6% <100.0%> (+0.3%) ⬆️
...ore_service_director_v2/utils/dask_client_utils.py 78.2% <0.0%> (-0.9%) ⬇️
.../director/src/simcore_service_director/producer.py 62.1% <0.0%> (+0.4%) ⬆️
...tor_v2/modules/dynamic_sidecar/scheduler/events.py 93.8% <0.0%> (+1.1%) ⬆️
...e_service_director_v2/modules/dask_clients_pool.py 93.9% <0.0%> (+1.5%) ⬆️
...rector_v2/modules/comp_scheduler/base_scheduler.py 88.6% <0.0%> (+1.8%) ⬆️
...c/simcore_service_catalog/core/background_tasks.py 68.4% <0.0%> (+2.1%) ⬆️
...ector_v2/modules/comp_scheduler/background_task.py 91.6% <0.0%> (+8.3%) ⬆️

@sanderegg sanderegg marked this pull request as ready for review April 26, 2022 10:38
@sanderegg sanderegg added this to the Macarons milestone Apr 26, 2022
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. Some observations and questions below.

services/storage/src/simcore_service_storage/dsm.py Outdated Show resolved Hide resolved
services/storage/src/simcore_service_storage/dsm.py Outdated Show resolved Hide resolved
@@ -343,7 +347,11 @@ async def upload_file(request: web.Request):
source_uuid=source_uuid,
)
else:
link = await dsm.upload_link(user_id=user_id, file_uuid=file_uuid)
link = await dsm.upload_link(
Copy link
Contributor

Choose a reason for hiding this comment

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

Obsservations:

  1. if you look above there is this extra_source and extra_location which ware optional. You should raise an error if link_type is also present.
  2. If you select dactore/pennsieve as a backend, the s3 links should probably be disabled both in upload and in download. Do you agree?

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 will check that in the next PR as I anyway need to bring that s3 link also to the frontend.

@sanderegg sanderegg requested a review from GitHK April 26, 2022 12:19
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.

👍 thanks!

@sanderegg sanderegg merged commit 1d90d78 into ITISFoundation:master Apr 26, 2022
@sanderegg sanderegg deleted the enhancement/pass_s3_links branch April 26, 2022 14:55
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.

3 participants