saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.14k stars 5.47k forks source link

Update serialization #343

Closed thatch45 closed 12 years ago

thatch45 commented 12 years ago

Right now we are using python pickles for serialization and we have pickles inside pickles. We need to change line format and all local serialization to use something cross language, faster, and more secure than python pickles.

Right now the plan is to build in message pack and change Salt to be a binary package.

SEJeff commented 12 years ago

Bonus points if there is a way to make this pluggable on the fly. So that way if $OLD_MINION connects to $NEW_MASTER, there will be no issues with the serialization over the and all will be well until you've got a chance to upgrade $OLD_MINION to $NEW_MINION.

thatch45 commented 12 years ago

right the only problem is that the master will need to be configured to send out messages in pickles until all of the old minions are cleaned up. I wonder if there is a way to detect it.

SEJeff commented 12 years ago

Remember my idea on IRC? You make a base serializer class and then a factory function that implements each type just like the Outputter stuff. You then negotiate the serializer on initial authentication.

Perhaps you could have the master say to the minion:

A new Minion would respond with:

and the master would choose whatever it wants (ideally the first in the tuple).

An older minion would not implement whatever interface is designed for this or would just respond with:

This is totally doable and would be a pretty nifty feature.

thatch45 commented 12 years ago

The problem is that the pub mech does not support sending specific messages to specific servers, so if we have just one minion that does not support messagepack then we need to send pickles to all. Due to potential security issues in pickle I want to completely deprecate it after a few releases.

I do want to make the interface more pluggable though yours is a good idea and I will be mulling over the approach more tonight

thatch45 commented 12 years ago

Done, welcome to msgpack land!