Michael DeHaan wrote:
> Michael DeHaan wrote:
>   
>> One thing I've been thinking about is finally improving the YAML serializer.
>>
>> It's fine for a reasonable number of systems, but it's not easy to 
>> hand-edit (if needed) a system if you have 500 of them in the systems 
>> file.   There's also the problem if you are hand editing and mess up 
>> your file.  Backups are great, but wouldn't it be better to break just 
>> that one object, rather than all objects of the same type?  Probably true.
>>
>> A solution to this is probably a directory layout like:
>>
>> /var/lib/cobbler/config/systems.d/
>> /var/lib/cobbler/config/repos.d/
>>
>> And so on...
>>
>> The idea is we can tweak the YAML serializer to load the original file 
>> if it exists, and on those loads, write the new files out.  This should 
>> allow for seamless upgrades to the new version without anyone needing to 
>> change modules.conf.
>>
>> I'm only going to do this if performance does not suffer on each invocation.
>>
>> However as we can lazy-load the objects as needed (unless making a 
>> "find" call), I'm not sure that will be a problem.
>>
>> As a design point, we will not be requiring a database, and I think 
>> things have been working pretty good so far, so, by default, no database :)
>>
>> --Michael
>>
>>
>>
>>
>> _______________________________________________
>> cobbler mailing list
>> [email protected]
>> https://fedorahosted.org/mailman/listinfo/cobbler
>>   
>>     
>
> It turns out this is exceedingly fast as compared to the old method, 
> even w/o requiring a database.
>
> 80 seconds for YAML to edit 200 objects
> 0.5 seconds for this new proposal.
>
> So it looks like I'm going to be teaching cobbler how to migrate from 
> one to the other.
>
> We'll still ship serializer_yaml, but the new serializer_catalog will 
> probably be the new default in /etc/cobbler/modules.conf provided 
> testing pans out ok.
>
> serializer_catalog will know how to read the old format and convert to 
> the new.
>
> --Michael
> _______________________________________________
> cobbler mailing list
> [email protected]
> https://fedorahosted.org/mailman/listinfo/cobbler
>   

For those who would like to try this, you can do so by checking out the 
latest git branch and changing the serializers (all of them) in 
modules.conf to "serializer_catalog".

Then just run a simple command like "cobbler report" and it will migrate 
you over.

If this is a production system, you may want to make backups, as you 
can't go back.

Files are saved as 
/var/lib/cobbler/config/$collection_name.d/$object_name so it's now easy 
to trade distro/profile/system objects with people if you want to do so.

The format won't change any more than the serializer_yaml version does, 
though I may be making some code tweaks WRT performance and such.

--Michael
_______________________________________________
cobbler mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/cobbler

Reply via email to