Skip to content

Commit 5a70b51

Browse files
Merge pull request #276 from runpod/275-cant-set-bucket-name-in-rp_uploadupload_image
275 cant set bucket name in rp uploadupload image
2 parents f994e18 + cf6cc8b commit 5a70b51

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## Release 1.5.3 (TBD)
4+
5+
### Added
6+
7+
- Expose bucket name for rp_upload.
8+
39
## Release 1.5.2 (1/16/24)
410

511
### Fixed

runpod/serverless/utils/rp_upload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_boto_client(
9393
# ---------------------------------------------------------------------------- #
9494
# Upload Image #
9595
# ---------------------------------------------------------------------------- #
96-
def upload_image(job_id, image_location, result_index=0, results_list=None): # pragma: no cover
96+
def upload_image(job_id, image_location, result_index=0, results_list=None, bucket_name: Optional[str] = None): # pylint: disable=line-too-long # pragma: no cover
9797
'''
9898
Upload a single file to bucket storage.
9999
'''
@@ -122,7 +122,7 @@ def upload_image(job_id, image_location, result_index=0, results_list=None): #
122122

123123
return sim_upload_location
124124

125-
bucket = time.strftime('%m-%y')
125+
bucket = bucket_name if bucket_name else time.strftime('%m-%y')
126126
boto_client.put_object(
127127
Bucket=f'{bucket}',
128128
Key=f'{job_id}/{image_name}{file_extension}',

0 commit comments

Comments
 (0)