210 likes | 375 Views
APST Internals. Sathish Vadhiyar. apstd daemon should be started on the local resource Opens a port to listen for apst client requests Runs on the host where input files are located Input files can also be specified by running <files> element
E N D
APST Internals Sathish Vadhiyar
apstd daemon should be started on the local resource • Opens a port to listen for apst client requests • Runs on the host where input files are located • Input files can also be specified by running <files> element • apstd automatically copies output files from working directory to where apstd is started • apst and apstd started by same user since apstd writes files on behalf of apst’s user
A APST run is associated with a XML file • Task dependency can be enforced by APST XML <apst> <tasks> <task executable='second' input='anyfile'/> <task executable='first' output='anyfile'/> </tasks> </apst>
Some times there may not be file dependency but task dependency <apst> <files> <file id='anyfile' download='no' transfer='no'/> </files> <tasks> <task executable='second' input='anyfile'/> <task executable='first' output='anyfile'/> </tasks> </apst>
XML example • <apst> <storage> <disk id='blueDisk'><scp server='blue.ufo.edu'/></disk> <disk id='greenDisk'><scp server='green.ufo.edu'/></disk> <disk id='redDisk'><scp server='red.ufo.edu'/></disk> <disk id='grayDisk'><scp server='gray.ufo.edu'/></disk> </storage> <compute> <host id='blueHost disk='blueDisk'><ssh server='blue.ufo.edu'/></host> <host id='greenHost disk='greenDisk'><ssh server='green.ufo.edu'/></host> <host id='redHost disk='redDisk'><ssh server='red.ufo.edu'/></host> <host id='grayHost disk='grayDisk'><ssh server='gray.ufo.edu'/></host> </compute> <files> <file id='blueOrGreenOnly' transfer='no'> <copy disk='blueDisk'/> <copy disk='greenDisk'/> </file> </files> <tasks> <task executable='first' input='blueOrGreenOnly'/> </tasks> </apst>
security • Some kind of security regarding what kind of commands will apstd accept over socket • Given a description of the tasks to do and the resources (disks and machines) available, APST will assign individual tasks to available machines, copy the input files, run the tasks, and return the output files. APST also tries to assign tasks to machines intelligently, using information such as the load and speed of individual machines. • The main APST program, apstd, handles all of the task assignment, application execution, and file copying. • Splitting the control and user interface portions of APST like this allows you, for example, to run apstd on your main system but control it from your laptop.
Using local resources • <apst> <compute> <host id='myMachine'/> </compute> <tasks> <task executable='perl' arguments='/home/${USER}/apst/Examples/charcount.pl /home/${USER}/apst/Examples/charcount0.dat' stdout='charcount0.out' /> </tasks> </apst> • /home/${USER}/apst/bin/apstd -d --port 7890 first.xml
APST can use remote machines accessed through either a Globus GRAM or ssh, remote storage accessed through a Globus GASS server, scp, ftp, sftp, or an SRB server, and queueing systems controlled by Condor, DQS, LoadLeveler, LSF, PBS, or SGE.
Accessing remote resources – walk through <apst> <compute> <host id='blueHost'> <ssh server='blue.ufo.edu'/> </host> </compute> </apst> Launches task on blueHost through ssh but assume files on local disk can be directly accessed
<apst> <storage> <disk id='blueDisk'> <scp server='blue.ufo.edu'/> </disk> </storage> <compute> <host id='blueHost' disk='blueDisk'> <ssh server='blue.ufo.edu'/> </host> </compute> </apst> • This tells apstd that blueHost can see files available on blueDisk, rather than those on the local disk.
<apst> <storage> <disk id='blueDisk'> <scp server='blue.ufo.edu'/> </disk> </storage> <compute> <host id='blueHost' disk='blueDisk'> <ssh server='blue.ufo.edu'/> </host> </compute> <tasks> <task executable='perl' arguments='/home/${USER}/apst/Examples/charcount.pl /home/${USER}/apst/Examples/charcount0.dat' stdout='charcount0.out' /> </tasks> </apst> • The problem with this XML is that it requires that APST be installed on the remote machine in /home/${USER}/apst, since the arguments task attribute refers to files in this directory.
<apst> <storage> <disk id='local' datadir='/home/${USER}/apst/example'/> <disk id='blueDisk' datadir='/tmp'> <scp server='blue.ufo.edu'/> </disk> </storage> <compute> <host id='blueHost' disk='blueDisk'> <ssh server='blue.ufo.edu'/> </host> </compute> <tasks> <task executable='perl' arguments='./charcount.pl ./charcount0.dat' input='charcount.pl charcount0.dat' stdout='charcount0.out' /> </tasks> </apst> • Equivalent to • scp /home/${USER}/apst/Examples/charcount.pl blue.ufo.edu:/tmp/charcount.pl scp /home/${USER}/apst/Examples/charcount0.dat blue.ufo.edu:/tmp/charcount0.dat ssh blue.ufo.edu 'cd /tmp; perl ./charcount.pl ./charcount0.dat > charcount0.out' scp blue.ufo.edu:/tmp/charcount0.out /home/${USER}/apst/Examples/charcount0.out
Run the above example: /home/${USER}/apst/bin/apstd -d --port 7890 second.xml • For globus: • Scp -> gass • Ssh -> globus • <globus server='blue.ufo.edu:4300'/> - i.e. machine and port where gatekeeper is running • E.g. <gass server='gridftp://blue.ufo.edu:2345'/>. • Run grid-proxy-init before starting apstd
Apst client program • You can use apst to examine your application's state, add, stop, or restart tasks, and add or disable resources • /home/${USER}/apst/bin/apst --host localhost:7890 command
Accessing batch systems • <apst> <storage> <disk id='bigDisk'> <scp server='big.ufo.edu'/> </disk> </storage> <compute> <host id='bigHost' disk='bigDisk' cpus='8'> <ssh server='big.ufo.edu'/> <pbs nodes='20' time='240' queue='normal'/> </host> </compute> </apst> • Can replace pbs with lsf, condor, loadleveler
Gridinfo tag • <apst> <gridinfo> <infosource id='localInfo'> <local/> </infosource> <infosource id='gangliaInfo'> <ganglia server='ganglia.ufo.edu'/> </infosource> <infosource id='mdsInfo'> <mds server='mds.ufo.edu:2345' basedn='mds-vo-name=local,o=grid'/> </infosource> <infosource id='nwsInfo'> <nws server='nws.ufo.edu:8800'/> </infosource> </gridinfo> </apst>
Apstd daemon • Can be started –heuristic= option. Default is wq • Xml file has <storage>, <compute>, <files>, <tasks> • <disk> • Attributes – unique id, datadir • Access method element • Access method can be <ftp/>, <gass/>, <local/>, <scp/>, <sftp/>, or <srb/>
<host> • Attributes – unique ID, cpus, disk, dnsname, memory, wd • Access method - <globus/>, <local/>, or <ssh/> • Batch queuing system - <condor\>, <dqs/>, <loadleveler/>, <lsf/>, <pbs/>, or <sge/> • Attributes – account, memory, node, nodetype, queue, stdin, stdout, stderr, time, option
<files> • Specifies input, output and executable files • Contains one or more file attribute • <file> • Input files may have transfer attribute (yes or no) – whether files have to be transferred from submitting machine • Output files have analogously download attribute, may also have size attribute indicating the size of the output file – useful for scheduling decisions
<file> element may have <copy> element for input files • To indicate the placement of copies of the file that you have pre-staged to remote disks • Will have disk attribute and copy attribute
<task> • Attributes – executable, id, groups, wd, arguments, input, stdin, stdout, stderr, priority, host, memory, cost • <infosource> • Access method - <ganglia/>, <local/>, <mds/>, or <nws/>.