IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Version 1 and Version 2 of Pantasks_server_mode


Ignore:
Timestamp:
Jun 19, 2009, 4:47:02 PM (17 years ago)
Author:
watersc1
Comment:

the outdated mixed coding method was making my head hurt, so I fixed it.

Legend:

Unmodified
Added
Removed
Modified
  • Pantasks_server_mode

    v1 v2  
    66=== Configuration ===
    77
    8 Ensure the following is in your <code>~/.ptolemyrc</code> file:
    9 <pre>
     8Ensure the following is in your {{{~/.ptolemyrc}}} file:
     9{{{
    1010PANTASKS_SERVER         XXXXX.ifa.hawaii.edu
    1111PASSWORD                XXXXX
    1212#PANTASKS_SERVER_STDOUT  pantasks.stdout.log
    1313#PANTASKS_SERVER_STDERR  pantasks.stderr.log
    14 </pre>
    15 
    16  * <code>PANTASKS_SERVER</code> defines the name of the server for the client to connect to.  There's no real need to update this, since we'll use a script to set this on the fly, allowing multiple pantasks servers to be used simultaneously.
    17  * <code>PASSWORD</code> provides minimal access control for the pantasks server.  Set this to a unique word.
    18  * <code>PANTASKS_SERVER_STDOUT</code> and <code>PANTASKS_SERVER_STDERR</code> define where the output goes that is usually displayed in the pantasks session.  Since setting these also affects the standalone version of pantasks, I recommend leaving them commented out; we'll use a script to set them on the fly.
     14}}}
     15
     16
     17 * {{{PANTASKS_SERVER}}} defines the name of the server for the client to connect to.  There's no real need to update this, since we'll use a script to set this on the fly, allowing multiple pantasks servers to be used simultaneously.
     18 * {{{PASSWORD}}} provides minimal access control for the pantasks server.  Set this to a unique word.
     19 * {{{PANTASKS_SERVER_STDOUT}}} and {{{PANTASKS_SERVER_STDERR}}} define where the output goes that is usually displayed in the pantasks session.  Since setting these also affects the standalone version of pantasks, I recommend leaving them commented out; we'll use a script to set them on the fly.
    1920
    2021
    2122If you are using Nebulous, you will also need to set up an ipphosts.config file.  This config file has METADATA cards that assign a particular host to each chip on the camera, so that nebulous can distribute every  exposure consistently, without piling too many chips onto the same machine.  There is also a metadata card for indicating which hosts are to be used for skycell processing.  Here is an example of how this config file should look:
    2223
    23 <pre>
     24{{{
    2425ipphosts MULTI
    2526
     
    5859  XY76  STR  ipp015
    5960END
    60 </pre>
     61}}}
    6162
    6263
     
    6768
    6869 * Save the following script as '''start_pantasks_server''' in some directory on your path
    69 <pre>
     70{{{
    7071#!/bin/bash
    7172# Start up a pantasks server
     
    7677echo pantasks_server $server_redirect
    7778pantasks_server $server_redirect
    78 </pre>
     79}}}
    7980
    8081 * Save this one as '''start_pantasks_client''' on your path
    8182
    82 <pre>
     83{{{
    8384#!/bin/bash
    8485# start up pantasks_client
     
    9596   echo "Please provide the hostname of the pantasks server."
    9697fi
    97 </pre>
     98}}}
    9899
    99100
     
    101102
    102103Starting the server is as easy as:
    103 <pre>
     104{{{
    104105% start_pantasks_server
    105106bound to port: 2000
    106 </pre>
     107}}}
    107108You can start it in the background if you want: it's not going to print anything more to the terminal.
    108109
    109110In a different window (or machine or user), start the client:
    110 <pre>
     111{{{
    111112% start_pantasks_client mymachine
    112 </pre>
    113 where <code>mymachine</code> is the name of the machine on which the server is running.
     113}}}
     114where {{{mymachine}}} is the name of the machine on which the server is running.
    114115
    115116You should be presented with the usual pantasks environment.  However, some things are subtly different: the environment you see before you is particular to the client, not the server, and it's the server that runs everything.  This is important to keep in mind, and it means that you should bury within macros some commands that you would ordinarily just type on the pantasks command-line.
     
    120121 * Save this as server.pro in your pantasks modules directory
    121122
    122 <pre>
     123{{{
    123124macro setup
    124125    $LABEL = "my_label"
     
    152153    controller host add machine4 -threads $1
    153154end
    154 </pre>
     155}}}
    155156
    156157 * If you're not using Nebulous, you can remove the lines that are specific to Nebulous use (these send jobs to particular machines).
    157  * Ensure the <code>my_label</code> is changed to the label of the data you're processing (or <code>"NONE"</code> including quotes if none).
    158  * Ensure the <code>my_database</code> is changed to the database you're using.
    159  * Ensure the <code>machineN</code> are changed according to your system.
     158 * Ensure the {{{my_label}}} is changed to the label of the data you're processing (or <code>"NONE"</code> including quotes if none).
     159 * Ensure the {{{my_database}}} is changed to the database you're using.
     160 * Ensure the {{{machineN}}} are changed according to your system.
    160161
    161162So, now in the pantasks client, you can say:
    162 <pre>
     163{{{
    163164pantasks: server input server.pro
    164 </pre>
     165}}}
    165166to load the macro file.  Note that the server has to do this command, hence the prefix <code>server</code>.
    166167
    167168Here is how you would set up for processing, and add hosts with a maximum of 4 threads each:
    168 <pre>
     169{{{
    169170pantasks: setup
    170171pantasks: machines 4
    171 </pre>
     172}}}
    172173
    173174Now you should be able to simply say:
    174 <pre>
     175{{{
    175176pantasks: run
    176 </pre>
    177 and pantasks will run as usual.  The <code>status</code>, <code>stop</code> and <code>halt</code> commands are also available as usual (no need to prepend <code>server</code> or anything like that).  But if you want to change the label, then you should do:
    178 <pre>
     177}}}
     178and pantasks will run as usual.  The {{{status}}}, {{{stop}}} and {{{halt}}} commands are also available as usual (no need to prepend {{server}}} or anything like that).  But if you want to change the label, then you should do:
     179{{{
    179180pantasks: change_label "new_label"
    180 </pre>
     181}}}
    181182whereas in the standalone pantasks, you could have done:
    182 <pre>
     183{{{
    183184pantasks: $LABEL = "new_label"
    184 </pre>
     185}}}
    185186Such commands now have to be buried within macros.
    186187
     
    188189
    189190You can quit out of the client at any time by saying:
    190 <pre>
     191{{{
    191192pantasks: quit
    192 </pre>
     193}}}
    193194
    194195This does not stop the server from continuing to process.  You can reconnect to the server as you please.
    195196
    196197When you're all done, you can force the server to quit by issuing the following command from the client:
    197 <pre>
     198{{{
    198199pantasks: shutdown now
    199 </pre>
     200}}}