Project

Profile

Help

Story #6929

Updated by dalley almost 4 years ago

The Bandersnatch tool for creating local mirrors of PyPI has 
  configured on the PythonRemote as JSON.    This doesn't seem ideal to me from a straightforwards config file format which UX perspective.    Configuring Pulp this way is much more user friendly quite difficult compared to creating editing a complex JSON configuration object as you need to do config file like with Pulp.    It bandersnatch. 

 https://bandersnatch.readthedocs.io/en/latest/filtering_configuration.html 

 Since there's already a tool which has tread this ground and is widely used, it would be ideal excellent if users could use Pulp was able to parse these config files as-is and create with their existing Bandersnatch configs. 

 There are different ways we could go about this, broadly speaking: 

 1) Create a PythonRemote from them. 

 https://bandersnatch.readthedocs.io/en/latest/filtering_configuration.html 

 Bandersnatch's existing configuration parsing code should be used to parse the a bandersnatch config files (we should not do parsing ourselves), and file - continue storing all of the sync settings which are relevant to Pulp should be stored in some appropriate format on the remote, but provide some API for users to create / update their PythonRemote object. 

 Not all fields able to be expressed in by uploading the Bandersnatch bandersnatch config file are applicable to Pulp - they should be ignored. Examples of this include (but not limited to): 

 * directory https://bandersnatch.readthedocs.io/en/latest/mirror_configuration.html#directory file. 
 * json https://bandersnatch.readthedocs.io/en/latest/mirror_configuration.html#json 
 * logging configurations https://bandersnatch.readthedocs.io/en/latest/mirror_configuration.html#log-config 

 Regex filtering support should also likely be ignored for 2) Don't store anything directly on the initial implementation. PythonRemote, and instead have them parsed from the config file at sync time. 

 In keeping 1 is probably more idiomatic with this change, Pulp's overall workflows, and is probably the best way to go.    2 is potentially simpler.    Either way, we will likely want might be able to make changes to leverage existing bandersnatch code for the schema and database representation parsing of PythonRemote to better match the Bandersnatch representation, such as moving from a list of dicts for "project specification" to a list of strings. this config file format, which would be nice.

Back