Panoptes Docs

NOTE:

Sorry, the distributed shell is currently broken and has been removed as Panoptes::Grid has been reconceptualized and is being rebuilt as GRID::Launcher.

A new and improved distributed shell is under construction.


CURRENTLY BROKEN, SEE NOTE ABOVE.

Panoptes is designed to be a distributed tool. While the distributed component is still under development, there are some interesting things that can already be done.

Getting Started

Install the Panoptes::Grid component. For more info on installing components, see [[GettingStarted]].

Using the shell

  pansh 'hostname1,hostname2,hostname3'

This starts an interactive shell that connects to the three specified hosts. Give the shell a few seconds to start up and connect. If you run a command too soon you will get an error. This will be a bit cleaner in the future.

What may not be apparent is that pansh didn't just connect to the hosts, it connected using GRID::Machine and launched perl. You now have an interactive shell running perl on all three machines at once. The shell stays connected to the remote hosts until you exit. But more on that later...

Commands are executed on all nodes in parallel. For long-running commands, no output will be generated until the command completes. In the near future all output from the remote nodes will be sent back as it is generated using Panoptes::Messaging.

The shell supports readline and will store your history on exit so you can recall previous commands in future sessions.

Running built-in shell commands

Try running some of the build-in commands.

  pansh> hostname
  EXECUTING COMMAND: hostname
  hostname1   : hostname1
  hostname2   : hostname2
  hostname3   : hostname3

  pansh> uptime
  EXECUTING COMMAND: uptime
  hostname1   :   9:48pm  up 44 day(s), 19:07,  2 users,  load average: 0.00, 0.00, 0.00
  hostname2   :   9:48pm  up 21 day(s),  7:12,  1 user,  load average: 0.62, 0.62, 0.62
  hostname3   :   9:48pm  up 48 day(s), 1:03,  8 users,  load average: 0.00, 0.00, 0.00

running system commands

The builtin commands are just convenient wrappers around the 'system' command. Note that commands are currently limited to one line.

  pansh> system hostname
  EXECUTING COMMAND: hostname
  hostname1   : hostname1
  hostname2   : hostname2
  hostname3   : hostname3

Note that commands are currently limited to a single line per command. This will be resolved in the future.

running perl code

You can run arbitrary perl code on the remote host with the 'perl' command. For example,

  pansh> perl print 5 + 2;
  EXECUTING PERL CODE: print 5 + 2;
  hostname1   : 7
  hostname2   : 7
  hostname3   : 7

Note that perl code must fit on a single line. This will be improved in the future.

persistent connection and state

The remote connection stays connected and thus maintains state between commands. To illustrate this, navigate around a bit.

  pansh> cd /etc
  EXECUTING PERL CODE: chdir "/etc"
  pansh> pwd
  EXECUTING COMMAND: pwd
  hostname1   : /etc
  hostname2   : /etc
  hostname3   : /etc

disconnecting

To disconnect from the shell, simply type 'exit' or ctrl+d. All child processes and remote connections should be killed off, your history file will be written, and the shell will exit.

coming soon