Skip to content

Commit

Permalink
storage: Allow downloading a single s3 object
Browse files Browse the repository at this point in the history
Downstream patch from kfserving
  • Loading branch information
Che Vu Gia Hy committed Oct 9, 2019
1 parent f645ce1 commit e0851ff
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions python/seldon_core/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def _download_s3(uri, temp_dir: str):
for obj in objects:
# Replace any prefix from the object key with temp_dir
subdir_object_key = obj.object_name.replace(bucket_path, "", 1).strip("/")
client.fget_object(bucket_name, obj.object_name,
os.path.join(temp_dir, subdir_object_key))
# fget_object handles directory creation if does not exist
if not obj.is_dir:
if subdir_object_key == "":
subdir_object_key = obj.object_name
client.fget_object(bucket_name, obj.object_name,
os.path.join(temp_dir, subdir_object_key))

@staticmethod
def _download_gcs(uri, temp_dir: str):
Expand Down

0 comments on commit e0851ff

Please sign in to comment.