Using TakTuk

From Grid5000
Jump to: navigation, search

During the course of an experiment on G5k, one often wants to run programs or scripts on all the reserved nodes simultaneously. For instance, to send data to remote workers. This could be achieved sequentially with a loop construct in a script, but this method does not scale well. That's why a launcher for parallel commands named TakTuk has been installed on each G5k site.

Contents

Short Explanation about TakTuk mechanics

To speed up the remote execution of the same command on a large number of nodes, TakTuk both

  • uses a deployment tree to initiate several connections to remote peers at the same time
  • initiates locally a few connections in parallel (the deployment window)

The balance beetween the two mechanism is ensured by an adaptive work-stealing algorithm combined with an on-line evaluation of the local machine load (see A guide to TakTuk use by Guillaume Huard for more details).

Taktuk schema.png

Therefore, for taktuk to operate correctly, peers should be able to connect to each other. By default, TakTuk uses ssh connections. So, to check if Taktuk execution can work, please follow instructions on this page: Test key authentication. There is also a practical example for setting up taktuk in the Advanced OAR tutorial.

Using TakTuk with the base environment

Prerequisites

You own a reservation for some machines:

Terminal.png users@frontale.site.grid5000.fr:
oarsub -I -l nodes=4

You are logged on one of the reserved nodes:

Terminal.png users@node-15.site.grid5000.fr:

Connections can be made without password from this node and between nodes using your account.

Using Taktuk to launch scripts

To execute scripts simultaneously on all the nodes:

Terminal.png users@node-15.site.grid5000.fr:
taktuk -f $OAR_FILE_NODES broadcast exec [ /home/site/user/testScript.sh ]

Note: do not forget to type the characters [ and ] and separate them from their content (using spaces for instance).

By default, TakTuk displays a lot of informations and part of it might not be necessary. Basically, you can choose exactly what is displayed by TakTuk (type of information and format of the displayed messages) using the output-template option. For instance, the following options suppress the connector and status streams and format the output of commands to use the host name followed by the content of the output:

-o connector -o status -o output='"$host: $line\n"'

Example:

To check if time clocks are synchronized on all the nodes (Result formated correctly)

Terminal.png users@node-15.site.grid5000.fr:
taktuk -c "oarsh" -o connector -o status -o output='"$host: $line\n"' -f $OAR_FILE_NODES broadcast exec [ date ]

Output

node-101.bordeaux.grid5000.fr: Fri Mar 23 09:38:46 CET 2007
node-23.bordeaux.grid5000.fr: Fri Mar 23 09:38:46 CET 2007
node-24.bordeaux.grid5000.fr: Fri Mar 23 09:38:46 CET 2007
node-67.bordeaux.grid5000.fr: Fri Mar 23 09:38:46 CET 2007
node-97.bordeaux.grid5000.fr: Fri Mar 23 09:38:46 CET 2007

To find CPUs installed on nodes:

Terminal.png user@node-15.site.grid5000.fr:
taktuk -c "oarsh" -o connector -o status -o output='"$host: $line\n"' -f $OAR_FILE_NODES broadcast exec [ "cat /proc/cpuinfo | grep 'model name'" ] | uniq

Output

node-101.bordeaux.grid5000.fr: model name       :                   Intel(R) Xeon(TM) CPU 3.00GHz
node-23.bordeaux.grid5000.fr: model name        : AMD Opteron(tm) Processor 248
node-24.bordeaux.grid5000.fr: model name        : AMD Opteron(tm) Processor 248
node-67.bordeaux.grid5000.fr: model name        :                   Intel(R) Xeon(TM) CPU 3.00GHz
node-97.bordeaux.grid5000.fr: model name        :                   Intel(R) Xeon(TM) CPU 3.00GHz

Note: instead of using the option -c "oarsh" in each command, we could have type the following command :

Terminal.png users@node-15.site.grid5000.fr:
export TAKTUK_CONNECTOR=oarsh

and then taktuk would know that it need to use oarsh as connector.

Using TakTuk with your own environment but without TakTuk installation

Prerequisites

Start by making a reservation:

Terminal.png users@frontale.site.grid5000.fr:
oarsub -I -l nodes=4 -t deploy

Deploy your environment:

Terminal.png users@frontale.site.grid5000.fr:
kadeploy3 -f $OAR_FILE_NODES -e wheezy-x64-nfs -k

Using Taktuk to launch programs

Using the -s option, you can use taktuk to deploy on remote hosts that don't have taktuk installed.

Terminal.png users@frontale.site.grid5000.fr:
taktuk -s -o connector -o status -o output='"$host: $line\n"' -f $OAR_FILE_NODES broadcast exec [ "apt-get update" ]

To execute an apt-get as root for system update, you have to use the following option: "-l root" before any machine specification.

Terminal.png users@frontale.site.grid5000.fr:
taktuk -l root -s -o connector -o status -o output='"$host: $line\n"' -f $OAR_FILE_NODES broadcast exec [ "apt-get update" ]
Personal tools
Namespaces

Variants
Actions
Public Portal
Users Portal
Admin portal
Wiki special pages
Toolbox