Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6244425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:19:27+00:00 2026-05-24T12:19:27+00:00

I’m building a test app on AWS. I have a ‘master’ machine that owns

  • 0

I’m building a test app on AWS. I have a ‘master’ machine that owns the application. I’d like, upon occasion, to be able to offload processing to some on-demand slave machines. Assuming an instantiated slave, with the bare minimum of required software (not including my main app), how can I ‘send’ functional units of Python code to one or more slaves for execution?

I know and accept that this architecture may not be optimal for many reasons – and I know it would be simpler if I could preinstall the relevant code on my instances at start-up. But let’s assume we have a hard constraint that the slave instances cannot be preloaded beyond the OS and some basic libraries – for example, what if I wanted to squirt some generated code at another machine?

EDIT: StackOverflow is such a SHIT HOT resource! Thanks to everyone for their replies. Awesome. Give me a couple of days and I’ll report back.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T12:19:29+00:00Added an answer on May 24, 2026 at 12:19 pm

    I’ve run into this problem several times in various flavors.

    Option 1 – eval()

    When I want to just hack something out quickly, I use eval() or one of it’s cousins in the stdlib. Transfer the source to your master, then compile and eval:

    src = getSourceFromMaster()
    obj = compile(src, "master.py", "exec")
    exec(obj)
    

    As long as your transport to get source from client to server is trustworthy and the actions the source needs to take are relatively straightforward, this works. A few times I’ve needed tighter integration between the master and slave machines, with lots of back and forth processing or complex data structures. In those cases, I use Pyro.

    Option 2 – Pyro

    Pyro is a full on, cross-platform remote method execution library for Python. I’ve used it in production environment to send processing from a linux machine to a windows machine and back, and it’s been super stable.

    Example from their docs:

    Master:

    # save this as greeting.py
    class GreetingMaker(object):
        def get_fortune(self, name):
            return "Hello, {0}. Here is your fortune message:\n" \
                   "Behold the warranty -- the bold print giveth and the fine print taketh away.".format(name)
    

    Slave:

    # save this as client.py
    import greeting
    name=raw_input("What is your name? ")
    greeting_maker=greeting.GreetingMaker()
    print greeting_maker.get_fortune(name)
    

    output:

    $ python client.py
    What is your name? Irmen
    Hello, Irmen. Here is your fortune message:
    Behold the warranty -- the bold print giveth and the fine print taketh away.
    

    The super-awesome thing about Pyro is the “import greeting” line in client.py — that code comes from the server.

    If you’re starting from a bare OS install, you can push down a python script to host the client code for either with SSH immediately after you spin up the new instance. Then you’ll have a nice infrastructure to work within.

    I cannot speak in anymore detail to the application of either of these to AWS, nor how they compare to the utilities provided by the AWS infrastructure. Welcome ideas or discussion on it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.