| 305 | |
| 306 | simple.xml is a Gush application description file. At the highest level, we define the project, which in this case is called "simple." Next we define any software packages that are needed. Gush application descriptions are comprised of different types of "blocks." |
| 307 | |
| 308 | {{{ |
| 309 | <?xml version="1.0" encoding="utf-8"?> |
| 310 | <gush> |
| 311 | <project name="simple"> |
| 312 | <software name="SimpleSoftwareName" type="none"> |
| 313 | <package name="Package" type="web"> |
| 314 | <path>http://localhost/software.tar</path> //Software tarball |
| 315 | <dest_path>software.tar</dest_path> |
| 316 | </package> |
| 317 | </software> |
| 318 | <component name="Cluster1"> |
| 319 | <rspec> |
| 320 | <num_hosts>2</num_hosts> //Number of remote clients |
| 321 | </rspec> |
| 322 | <software name="SimpleSoftwareName" /> |
| 323 | <resources> |
| 324 | <resource type="ssh" group="local"/> |
| 325 | </resources> |
| 326 | </component> |
| 327 | <experiment name="simple"> |
| 328 | <execution> |
| 329 | <component_block name="cb1"> |
| 330 | <component name="Cluster1" /> |
| 331 | <process_block name="p2"> |
| 332 | <process name="cat"> //Define actual execution |
| 333 | <path>cat</path> //"cat software.txt" |
| 334 | <cmdline> |
| 335 | <arg>software.txt</arg> |
| 336 | </cmdline> |
| 337 | <cwd/> |
| 338 | </process> |
| 339 | </process_block> |
| 340 | </component_block> |
| 341 | </execution> |
| 342 | </experiment> |
| 343 | </project> |
| 344 | </gush> |
| 345 | }}} |
| 346 | |
| 347 | === Environment Configuration: directory.xml === |
| 348 | |
| 349 | directory.xml defines the Gush resource directory. This file tells the Gush default matcher where to locate resources during execution. In the following example, we specify PlanetLab slices available to us, and define a mapping between slice names and port numbers. |
| 350 | |
| 351 | {{{ |
| 352 | <?xml version="1.0" encoding="UTF-8"?> |
| 353 | <gush> |
| 354 | <resource_manager type="ssh"> |
| 355 | <node hostname="amazon.machine.ip:15400" user="root" group="local" /> |
| 356 | </resource_manager> |
| 357 | <resource_manager type="ssh"> |
| 358 | <node hostname="amazon.machine.ip:15400" user="root" group="local" /> |
| 359 | </resource_manager> |
| 360 | </gush> |
| 361 | }}} |
| 362 | |
| 363 | === Gush Preferences: gush.prefs === |
| 364 | |
| 365 | The gush.prefs file defines basic preferences that customize the way applications are run. In this example we specify the ClientPrefix and ClientPath which control how the client is started ({ClientPrefix}/client) and what working directory the client uses when executing commands (chdir {ClientPath}). We can leave UsePlanetLab set to true even though we aren't using PlanetLab in this example. |
| 366 | |
| 367 | {{{ |
| 368 | <preferences> |
| 369 | <pref key="ClientPrefix">./</pref> |
| 370 | <pref key="ClientPath">./</pref> |
| 371 | <pref key="UsePlanetLab">true</pref> |
| 372 | </preferences> |
| 373 | }}} |
| 374 | |
| 375 | === Start Gush === |
| 376 | |
| 377 | Now we are ready to run our example. The following shows the output from a run using two clients. You only need to type the commands that appear after "gush>". |
| 378 | |
| 379 | {{{ |
| 380 | $ ./gush -P 15000 |
| 381 | gush> |
| 382 | gush> info nodes |
| 383 | There are 2 known nodes: |
| 384 | [ U ] root@amazon.machine.ip:15400(pref=0) (Disconnected.) |
| 385 | [ U ] root@amazon.machine2.ip:15400(pref=0) (Disconnected.) |
| 386 | gush> |
| 387 | gush> load tests/simple-ssh.xml |
| 388 | Project "simple" is selected. |
| 389 | Experiment "simple" is selected. |
| 390 | gush> |
| 391 | gush> run |
| 392 | Starting experiment run. |
| 393 | Running experiment simple... |
| 394 | gush> The configuration matcher has finished matching. |
| 395 | The resource allocator has finished successfully. |
| 396 | root@amazon.machine.ip:15400 has joined the mesh. |
| 397 | The file transfer of Package to amazon.machine.ip has been completed. |
| 398 | The software installation of Package on amazon.machine.ip was successful. |
| 399 | root@amazon.machine2.ip:15400 has joined the mesh. |
| 400 | The file transfer of Package to amazon.machine2.ip has been completed. |
| 401 | The software installation of Package on amazon.machine2.ip was successful. |
| 402 | root@amazon.machine2.ip:15400,26347: Hello World |
| 403 | |
| 404 | jeannie@machine2.cs.williams.edu:15400,18302: Hello World |
| 405 | |
| 406 | The experiment has ended. |
| 407 | |
| 408 | gush> disconnect |
| 409 | gush> geni@amazon.machine.ip:15400 has decided to leave the mesh. |
| 410 | geni@amazon.machine.ip:15400 has decided to leave the mesh. |
| 411 | |
| 412 | gush> quit |
| 413 | }}} |