-
Notifications
You must be signed in to change notification settings - Fork 232
Modify process_local_sources to support mount paths #1635
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,9 +231,11 @@ def register_data_path(collaborator_name, data_path=None, silent=False): | |
| type=ClickPath(exists=True), | ||
| help=( | ||
| "Path to directory containing sources.json file defining the data sources of the dataset. " | ||
| "This file should contain a JSON object with the data sources to be registered. For 'local'" | ||
| " type, 'params' must include: 'path'. For 's3' type, 'params' must include: 'uri', " | ||
| "'access_key_env_name', 'secret_key_env_name', 'secret_name', and optionally 'endpoint'." | ||
| "This file should contain a JSON object with the data sources to be registered. For local " | ||
| "data source, 'type' is 'fs', and 'params' must include: 'path'. For 's3' type, 'params' " | ||
| "must include: 'uri', 'access_key_env_name', 'secret_key_env_name', 'secret_name', and " | ||
| "optionally 'endpoint'. For azure_blob, 'type' is 'ab', and 'params' must include: " | ||
| "'connection_string', 'container_name', and optionally 'folder_prefix'." | ||
|
Comment on lines
+234
to
+238
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion would be to point to OpenFL documentation URL that describes data sources in detail with examples, in addition to the format of JSON files.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. @teoparvanov what doc file should we insert that info to? |
||
| ), | ||
| ) | ||
| def calchash(data_path): | ||
|
|
@@ -258,7 +260,7 @@ def calchash(data_path): | |
| sys.exit(1) | ||
| with open(datasources_json_path, "r", encoding="utf-8") as file: | ||
| data = file.read() | ||
| vds = DataSourcesJsonParser.parse(data) | ||
| vds = DataSourcesJsonParser.parse(data, check_dir_traversal=True) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead, can we
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. That means we go over the json one more time to look for the local data sources. Makes sense? currently happens only in |
||
| root_hash = vds.create_dataset_hash() | ||
| hash_file_path = os.path.join(data_path, "hash.txt") | ||
| with open(hash_file_path, "w", encoding="utf-8") as hash_file: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is also supposed to be
staticmethod?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, right.