1
- def setup_fs (s3 , key = "" , secret = "" , endpoint = "" , cert = "" , passwords = {}):
1
+ def setup_fs (s3 , key = "" , secret = "" , endpoint = "" , region = "" , cert = "" , passwords = {}):
2
2
"""Given a boolean specifying whether to use local disk or S3, setup filesystem
3
3
Syntax examples: AWS (http://s3.us-east-2.amazonaws.com), MinIO (http://192.168.0.1:9000)
4
4
The cert input is relevant if you're using MinIO with TLS enabled, for specifying the path to the certficiate.
5
+ For MinIO you should also parse the region_name
5
6
6
7
The block_size is set to accomodate files up to 55 MB in size. If your log files are larger, adjust this value accordingly
7
8
"""
@@ -17,14 +18,14 @@ def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
17
18
fs = s3fs .S3FileSystem (
18
19
key = key ,
19
20
secret = secret ,
20
- client_kwargs = {"endpoint_url" : endpoint , "verify" : cert },
21
+ client_kwargs = {"endpoint_url" : endpoint , "verify" : cert , "region_name" : region },
21
22
default_block_size = block_size ,
22
23
)
23
24
else :
24
25
fs = s3fs .S3FileSystem (
25
26
key = key ,
26
27
secret = secret ,
27
- client_kwargs = {"endpoint_url" : endpoint },
28
+ client_kwargs = {"endpoint_url" : endpoint , "region_name" : region },
28
29
default_block_size = block_size ,
29
30
)
30
31
0 commit comments