Execute arbitrary python code remotely - can it be done?

后端 未结 6 1599
醉话见心
醉话见心 2020-12-09 06:08

I\'m working on a grid system which has a number of very powerful computers. These can be used to execute python functions very quickly. My users have a number of python fun

6条回答
  •  眼角桃花
    2020-12-09 06:46

    It sounds like you want to do the following.

    • Define a shared filesystem space.

    • Put ALL your python source in this shared filesystem space.

    • Define simple agents or servers that will "execfile" a block of code.

    • Your client then contacts the agent (REST protocol with POST methods works well for
      this) with the block of code. The agent saves the block of code and does an execfile on that block of code.

    Since all agents share a common filesystem, they all have the same Python library structure.

    We do with with a simple WSGI application we call "batch server". We have RESTful protocol for creating and checking on remote requests.

提交回复
热议问题