Open ipeterov opened 8 years ago
It maybe makes sense to marshal functions and pass whole functions instead of function desctiptions. But will this work with functions from packages (which may have C extensions)?
There is a cloud
module that pickles functions into strings, which then can be unpickled and executed. Though, all the modules have to be installed AND imported. We could maybe make use of this module integrate it with the system that installs and imports packages from PyPi.
http://stackoverflow.com/questions/10048061/how-to-pickle-a-python-function-with-its-dependencies
Pickling funcions with cloudpickle
implemented, but issue is still open - we have to implement the thing I originally suggested.
Now workers use virtualenvs and virtualenv-api which don't allow them to be able to complete tasks that require different versions of one package.
If there is no readymade solution to that, we could probalby download modules from PyPi, unpack them in folder named after 'hash(package_name+version)', and import them by path. We could even write a python module for that. Probably isn't such a bad solution - workers will be in docker containers.