Skip to content

Commit

Permalink
Fix endpoint of s3 in production (#943) (#944)
Browse files Browse the repository at this point in the history
  • Loading branch information
mguidon authored Jul 12, 2019
1 parent 9bf21ac commit 1313669
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions packages/s3wrapper/src/s3wrapper/s3_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def __init__(self, endpoint, access_key=None, secret_key=None, secure=False):
self.endpoint = endpoint
self.access_key = access_key
self.secret_key = secret_key
self.secure = secure
self.endpoint_url = ("https://" if secure else "http://") + endpoint
try:
self.client = Minio(endpoint,
access_key=access_key,
Expand Down
5 changes: 4 additions & 1 deletion services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,10 @@ services:
- MINIO_ACCESS_KEY=12345678
- MINIO_SECRET_KEY=12345678
ports:
- "9000"
- "9001:9000"
command: server /data
volumes:
- minio:/data
#--------------------------------------------------------------------
maintenance:
image: ${DOCKER_REGISTRY:-itisfoundation}/maintenance:${DOCKER_IMAGE_TAG:-latest}
Expand Down Expand Up @@ -276,3 +278,4 @@ volumes:
output:
log:
postgres:
minio:
2 changes: 1 addition & 1 deletion services/storage/src/simcore_service_storage/dsm.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ async def list_files(self, user_id: str, location: str, uuid_filter: str ="", re
# MaG: This is inefficient: Do this automatically when file is modified
_loop = asyncio.get_event_loop()
session = aiobotocore.get_session(loop=_loop)
async with session.create_client('s3', endpoint_url="http://"+self.s3_client.endpoint, aws_access_key_id=self.s3_client.access_key,
async with session.create_client('s3', endpoint_url=self.s3_client.endpoint_url, aws_access_key_id=self.s3_client.access_key,
aws_secret_access_key=self.s3_client.secret_key) as client:
responses = await asyncio.gather(*[client.list_objects_v2(Bucket=d.bucket_name, Prefix=_d) for _d in [__d.object_name for __d in data]])
for d, resp in zip(data, responses):
Expand Down

0 comments on commit 1313669

Please sign in to comment.