Skip to content

Commit

Permalink
feat: return bucket upload
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmerrell committed Jan 19, 2023
1 parent 947ef25 commit 446715c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions runpod/serverless/utils/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,17 @@ def bucket_upload(job_id, file_list, bucket_creds):
config=temp_boto_config
)

bucket_urls = []

for file in file_list:
with open(file, 'rb') as file_data:
temp_boto_client.put_object(
Bucket=str(bucket_creds['bucketName']),
Key=f'{job_id}/{file}',
Body=file_data,
)

bucket_urls.append(
f"{bucket_creds['endpointUrl']}/{bucket_creds['bucketName']}/{job_id}/{file}")

return bucket_urls

0 comments on commit 446715c

Please sign in to comment.