Skip to content

Commit 04f3ac5

Browse files
committed
Updated script to handle more recent builds of MinIO S3 which are more strict on parsing the region explicitly
1 parent 8ea986b commit 04f3ac5

File tree

3 files changed

+5
-169
lines changed

3 files changed

+5
-169
lines changed

examples/data-processing/dbc_files/CSS-Electronics-SAE-J1939-DEMO.ini

Lines changed: 0 additions & 165 deletions
This file was deleted.

examples/data-processing/process_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
pw = {"default": "password"}
1717

1818
# setup filesystem (local/S3), load DBC files and list log files for processing
19-
fs = setup_fs(s3=False, key="", secret="", endpoint="", passwords=pw)
19+
fs = setup_fs(s3=False, key="", secret="", endpoint="", region="", passwords=pw)
2020
db_list = load_dbc_files(dbc_paths)
2121
log_files = canedge_browser.get_log_files(fs, devices, start_date=start, stop_date=stop, passwords=pw)
2222
print(f"Found a total of {len(log_files)} log files")

examples/data-processing/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
1+
def setup_fs(s3, key="", secret="", endpoint="", region="",cert="", passwords={}):
22
"""Given a boolean specifying whether to use local disk or S3, setup filesystem
33
Syntax examples: AWS (http://s3.us-east-2.amazonaws.com), MinIO (http://192.168.0.1:9000)
44
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
56
67
The block_size is set to accomodate files up to 55 MB in size. If your log files are larger, adjust this value accordingly
78
"""
@@ -17,14 +18,14 @@ def setup_fs(s3, key="", secret="", endpoint="", cert="", passwords={}):
1718
fs = s3fs.S3FileSystem(
1819
key=key,
1920
secret=secret,
20-
client_kwargs={"endpoint_url": endpoint, "verify": cert},
21+
client_kwargs={"endpoint_url": endpoint, "verify": cert, "region_name": region},
2122
default_block_size=block_size,
2223
)
2324
else:
2425
fs = s3fs.S3FileSystem(
2526
key=key,
2627
secret=secret,
27-
client_kwargs={"endpoint_url": endpoint},
28+
client_kwargs={"endpoint_url": endpoint, "region_name": region},
2829
default_block_size=block_size,
2930
)
3031

0 commit comments

Comments
 (0)