FCP-INDI / cpac

A convenience wrapper for https://github.com/FCP-INDI/C-PAC that provides a simple command line interface.
https://fcp-indi.github.io/docs/latest/user/cpac
MIT License
4 stars 3 forks source link

🚸 Just bind data config file instead of whole directory containing data config file #25

Open shnizzedy opened 2 years ago

shnizzedy commented 2 years ago

Related problem

Right now, cpac read-only binds the directory containing a user-provided data config file https://github.com/FCP-INDI/cpac/blob/9be16ca2144ef18fad36c6efe8199308859674c2/src/cpac/backends/platform.py#L214-L219 which can cause trouble if the output (or logging or working) directory is a descendant of that directory (see 이지원 Google Groups/cpax_forum: Re: RuntimeError)

Proposed feature

Just bind the data config file itself, something like

 dc_file = os.path.abspath(kwargs['data_config_file']) 
 self._bind_volume(dc_file, dc_file, 'r') 
 locals_from_data_config = Locals_to_bind() 
 locals_from_data_config.from_config_file( 
     dc_file 
 ) 

Acceptance criteria

Alternatives

No response

Additional context

Maybe also bind individual files from the data config instead of their parent directories too?