Skip to content

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

@shnizzedy

Description

@shnizzedy

Related problem

Right now, cpac read-only binds the directory containing a user-provided data config file

dc_dir = os.path.dirname(kwargs['data_config_file'])
self._bind_volume(dc_dir, dc_dir, 'r')
locals_from_data_config = Locals_to_bind()
locals_from_data_config.from_config_file(
kwargs['data_config_file']
)
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

  • data config file binds read-only but doesn't (necessarily) bind its parent directory read-only

Alternatives

No response

Additional context

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions