source: fedkit/start_seer.pl

Last change on this file was 9b3627e, checked in by Ted Faber <faber@…>, 14 years ago

SEER support

  • Property mode set to 100644
File size: 1.5 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4
5use gateway_lib;
6
7use IO::File;
8
9use Getopt::Long;
10
11my $ssh_pubkey;
12my $ssh_privkey;
13my $active;
14my $tunnelip;
15my $peer;
16my $fedkit_dir= "/usr/local/federation";
17my $perl = "/usr/bin/perl";
18my $iface_file = "/var/emulab/boot/ifmap";
19my $ssh = "/usr/bin/ssh";
20my $seer;
21my $ssh_port = 22;
22my @ports;
23my $use_file;
24my $ssh_privkey;
25
26my %opts = (
27    'peer=s' => \$peer,
28    'ssh_privkey=s' => \$ssh_privkey,
29    'fedkit=s' => \$fedkit_dir,
30    'perl=s' => \$perl,
31    'ssh=s' => \$ssh,
32    'use_file' => \$use_file,
33    'seer' => \$seer,
34);
35
36exit(20) unless GetOptions(%opts);
37
38if ($use_file) {
39    gateway_lib::read_config(gateway_lib::config_filename(), \%opts)
40}
41
42my $client = gateway_lib::client_conf_filename();
43my $f = new IO::File($client);
44my $eid;
45my $pid;
46
47while (<$f>) {
48    /^ExperimentID:\s+(\S+)/ && do {
49        ($pid, $eid) = split("/", $1);
50    };
51}
52$f->close();
53while (!-e "/proj/$pid/exp/$eid/tbdata/node.pem") {
54    print "Waiting for key\n";
55    sleep(10);
56}
57
58my $cmd = "/usr/bin/scp  -o \"StrictHostKeyChecking no\" " .
59    "-i $ssh_privkey /proj/$pid/exp/$eid/tbdata/*.pem $peer:$fedkit_dir/etc";
60print "calling $cmd\n";
61system($cmd);
62
63my $cmd = "$ssh  -o \"StrictHostKeyChecking no\" -o \"ForwardX11 no\" " .
64    "-i $ssh_privkey $peer python /usr/local/seer/experiment-setup.py " . 
65    "-F -c 0 Basic &";
66print "calling $cmd\n";
67system($cmd);
68
69$cmd = "python /usr/local/seer/experiment-setup.py -r control.$eid.$pid -r $peer Basic";
70print "Calling $cmd\n";
71system($cmd);
Note: See TracBrowser for help on using the repository browser.