Using python for writing models: How to run models in restricted python mode?

Magnus Lycka lycka at carmen.se
Tue Nov 8 11:11:20 EST 2005


vinjvinj wrote:
> I have an application which allows multiple users to write models.
> These models get distributed on a grid of compute engines. users submit
> their models through a web interface. I want to
> 
> 1. restrict the user from doing any file io, exec, import, eval, etc. I
> was thinking of writing a plugin for pylint to do all the checks? Is
> this is a good way given that there is no restricted python. What are
> the things I should serach for in python code

I'm not sure why you want to prevent e.g. all file io. Let the jobs run
as users with very limited permissions.

> 2. restrict the amount of memory a module uses as well. For instance
> how can I restrict a user from doing a = range(10000000000) or similar
> tasks so that my whole compute farm does not come down.

Use Sun Grid Engine. http://gridengine.sunsource.net/documentation.html



More information about the Python-list mailing list