Permalink
Browse files

add testing mode to load management script

  • Loading branch information...
1 parent c171d7f commit c2bddd2de959ced24a378972148990191762ed73 @lstein lstein committed Nov 1, 2012
View
2 Build.PL
@@ -64,6 +64,8 @@ my $build = GBrowseInstall->new(
'bin/gbrowse_import_ucsc_db.pl',
'bin/gbrowse_create_account.pl',
'bin/gbrowse_change_passwd.pl',
+ 'bin/gbrowse_launch_aws_slaves.pl',
+ 'bin/gbrowse_configure_slaves.pl',
'bin/gbrowse_metadb_config.pl',
'bin/gbrowse_grow_cloud_vol.pl',
'bin/gbrowse_slave',
View
2 bin/gbrowse_add_slaves.pl → bin/gbrowse_configure_slaves.pl
@@ -13,7 +13,7 @@
'remove=s' => \@to_remove,
'set=s' => \@to_set
) or die <<USAGE;
-Usage: gbrowse_update_renderers.pl [--options]
+Usage: gbrowse_add_slaves.pl [--options]
Options:
View
10 bin/gbrowse_launch_aws_slaves.pl
@@ -62,6 +62,7 @@
while (1) { # main loop
my $load = get_load();
+ warn "current load = $load\n";
my @instances = adjust_spot_requests($load);
adjust_configuration(@instances);
sleep (POLL_INTERVAL * 60);
@@ -72,7 +73,12 @@
exit 0;
sub get_load {
- if (-e '/proc/loadavg') {
+ if (-e '/tmp/gbrowse_load') {
+ open my $fh,'/tmp/gbrowse_load';
+ chomp(my $load = <$fh>);
+ return $load;
+ }
+ else (-e '/proc/loadavg') {
open my $fh,'/proc/loadavg';
my ($one,$five,$fifteen) = split /\s+/,<$fh>;
return $five;
@@ -148,7 +154,7 @@ sub adjust_configuration {
"http://$_:8102",
"http://$_:8103")} @addresses;
my @args = map {('--set'=> "$_") } @a;
- system 'sudo','gbrowse_add_slaves.pl',@args;
+ system 'sudo','gbrowse_configure_slaves.pl',@args;
}
sub terminate_instances {
View
3 bin/gbrowse_slave_start_aws.sh
@@ -1,3 +1,6 @@
#!/bin/sh
+
+# pass this as the user data file to the GBrowse AWS image
+# in order to start up the instance in slave mode.
exec /opt/gbrowse/etc/init.d/gbrowse-slave start

0 comments on commit c2bddd2

Please sign in to comment.