helpful-baker-78647
06/28/2024, 9:54 AMparent_folder = Path(__file__).parent.parent
global_configuration_path = parent_folder / "global_config.json"
current_folder = Path(__file__).parent
local_configuration_path = current_folder / "config_2.json"
Since I forgot to add ".json" to the package suffixes when creating the step function, I was thinking that it would be failing while reading the global_config.json file but it does not seem to be the case, and it fails while reading config_2.json.
By the way, I use a custom docker image where needed dependencies are installed, but all the files in folder are copied as well. I don't know if that could explain the behaviour.
Thanks for your support 🙏victorious-lawyer-58417
06/28/2024, 9:58 AMpython flow.py --package-suffixes=.json run to include all .json files in the package. See these docs for guidance how to structure projects in general.
Alternatively, you can use a JSON-typed Parameter or IncludeFile to include configuration in your runshelpful-baker-78647
06/28/2024, 10:02 AMvictorious-lawyer-58417
06/28/2024, 12:15 PMpython flow.py package list, do you see the JSON files in the listing?victorious-lawyer-58417
06/28/2024, 12:15 PMpackage list shows what gets packaged by Metaflow exactlyhelpful-baker-78647
06/28/2024, 12:20 PMvictorious-lawyer-58417
06/28/2024, 12:20 PMglobal_config.json is already included in your custom Docker imagehelpful-baker-78647
06/28/2024, 12:21 PMvictorious-lawyer-58417
06/28/2024, 12:23 PM.py files and files with suffixes listed in --package-suffixes that are in the same directory as your flow.py, including all subdirectories
Hence in your case config_2.json should be included when you do --package-suffixes=.json but global_config.json won't. If you want to include it, you can add a symlink to it in subfolder_2helpful-baker-78647
06/28/2024, 12:28 PMconfig_2.json.
I still have access to global_config.json so the symlink is not needed, but what you described is what I would have expected.
I will try to test in the coming days if I remove the json from the docker image if it still works or not.
Thanks for your support and have a nice day !victorious-lawyer-58417
06/28/2024, 12:28 PM