fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Fab-user] tricky parallel execution


From: Jeff Forcier
Subject: Re: [Fab-user] tricky parallel execution
Date: Sat, 8 Sep 2012 16:27:37 -0700

Hi Dmitry,

On Wed, Aug 29, 2012 at 1:39 PM, Dmitry Makovey <address@hidden> wrote:
> Hi,
>
> I tried to look through archive on this subject but it's either my
> undestanding of the subject that is limited or I just couldn't find a solution
> to my problem.
>
> Usecase:
> Use Fabric to start service on serverA in "single-user mode" (i.e. no
> background) and then accessing that service via Fabric for some operations,
> then tear it down at the end.
>
> Sample as a sequence of ssh commands in two parallel sessions (desktop and
> desktop2):
>
> desktop $ ssh address@hidden "/usr/bin/postmaster -p 8888 -D /alter/data -d3"
> desktop2 $ ssh address@hidden "pgdump -U postgres -p 8888" > /tmp/dump.sql
> desktop $ ^C

Unfortunately, right now this use case -- parallelism w/ different
commands against a single target -- is not possible, so I'm afraid
you're out of luck. Future versions will definitely make this easier,
but the parallel we added to Fab 1.x was oriented towards the "do the
same thing on multiple systems concurrently" which is distinct from
what you're trying to do here.

You should be able to use other "backgrounding" solutions to effect
this in Fab 1, however, e.g.:

* Spin up the postmaster in a screen session, storing its PID in a
known location, then sending TERM or similar to that PID after the
dump is done. (Might be possible to simply name the screen session and
figure out if killing the screen session sends the right signal to
postmaster -- not sure, but would be even easier than the PID
approach.)
* Use supervisord or similar, which basically encapsulates the above
process of "spin up a daemon, keep track of it, and make it easy to
shut down/restart/etc", while requiring a bit more "stuff"
(specifically, "pip install supervisord" + uploading a conf file).

Best,
Jeff

-- 
Jeff Forcier
Unix sysadmin; Python/Ruby engineer
http://bitprophet.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]