-
Notifications
You must be signed in to change notification settings - Fork 786
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
Add backend to support uploading large files. #2906
Conversation
@RishabhJain2018 @deshraj @Ram81 PTAL. |
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.
LGTM 👍 . @RishabhJain2018 can we delpoy this to staging. I can test it once on staging
apps/base/utils.py
Outdated
@@ -138,6 +138,17 @@ def send_email( | |||
return | |||
|
|||
|
|||
def get_aws_secret_keys(): |
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.
We do have this function, can you please use that instead of creating a new one.
cc: @Ram81
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.
Ca you point me to this? Didn't find one in base/utils.py
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.
I think it is in challenge/utils.py
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.
Okay...I've changed the function to get the storage bucket name as well when we are not using host's credentials.
But, do we need to add the bucket name field to the challenge model as well, to get the host's bucket name to the aws_keys when using host credentials? (I can make a separate PR for this.) @RishabhJain2018 @Ram81
Original function for reference:
EvalAI/apps/challenges/utils.py
Line 93 in 3e7286e
def get_aws_credentials_for_challenge(challenge_pk): |
apps/base/utils.py
Outdated
@@ -168,6 +179,31 @@ def get_boto3_client(resource, aws_keys): | |||
logger.exception(e) | |||
|
|||
|
|||
def get_presigned_url_for_file_upload(file_key): | |||
""" | |||
Function to get the presigned url to upload a file to s3 with name file_name and key as file_key. |
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.
file_key
-> Can we please change it something more meaningful.
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.
It's clear that it's the key for the file on S3 right. What else can we call it... file_key_on_s3
? cc: @Ram81
@KhalidRmb Is this complete? |
@RishabhJain2018 Yes |
@RishabhJain2018 I haven't tested the PR yet. Are we planning to test this one staging? |
Yes! |
@KhalidRmb did you also test these changes (for test annotations) with auto launch workers feature when challenge is approved? Because we will be auto approving challenges and launching workers before challenge approval would this break submission worker launch flow? |
I thought the admin won't approve a challenge without an annotation file. But if we're auto approving a challenge, the worker will fail after starting since there's no file yet to fetch. We'll have to catch this case in the auto approval pipeline, where we should check for annotation file being present before auto approving a challenge? On top this I think we should show an appropriate error message is case the host tries to start the worker through manage tab without an annotation file. |
@KhalidRmb can you resolve conflicts so that we can test this on staging |
Adds APIs and util methods to enable generation of a presigned url and enable the pipeline to upload large annotation files and submission files through CLI.
Related: Cloud-CV/evalai-cli#277