2dc78bc27b010545f6af079b46fe1b94b472e90d hiram Mon Oct 27 12:43:42 2025 -0700 fixup error in help message for fileServer refs #35575 diff --git src/hg/utils/automation/HgAutomate.pm src/hg/utils/automation/HgAutomate.pm index eb7c7e0d542..e9c2b43c730 100755 --- src/hg/utils/automation/HgAutomate.pm +++ src/hg/utils/automation/HgAutomate.pm @@ -98,30 +98,31 @@ ); my %obsoleteClusterFilesystem = ( 'scratch' => { root => '/scratch/data', clusterLocality => 1.0, distrHost => [], distrCommand => '', inputFor => \@allClusters, outputFor => [], }, 'hive' => { root => '/hive/data/genomes', clusterLocality => 0.3, distrHost => ['ku'], distrCommand => '', inputFor => ['memk', 'encodek', 'swarm'], outputFor => ['memk', 'encodek', 'swarm'], }, ); $defaultDbHost = 'hgwdev'; +my $defaultFileServer = "hgwdev"; sub readMainCluster() { # return the first line of the file cluster.txt in same directory as # HgAutomate.pm. This file is easy to parse from bash scripts and # other languages, easier than to have the value in this .pm file # my ($volume, $directory, $file) = File::Spec->splitpath(__FILE__); my $mainClusterFname = $directory."cluster.txt"; open (my $clusterFile, '<', $mainClusterFname) || die "Couldn't open \"$mainClusterFname\": $!\n"; my $mainCluster = <$clusterFile>; close $clusterFile; chomp $mainCluster; return $mainCluster; } @@ -295,31 +296,31 @@ } sub getFileServer { # Use df to determine the fileserver for $path. my ($path) = @_; confess "Must have exactly 1 argument" if (scalar(@_) != 1); my $host = `df $path 2>&1 | grep -v Filesystem`; if ($host =~ /(\S+):\/.*/) { return $1; } else { my $localhost = `uname -n`; # HOST not always present if ($localhost =~ s/^([\w-]+)(\..*)?$/$1/) { return $localhost; } } - confess "Could not extract server from output of \"df $path\":\n$host\n"; + return $defaultFileServer; } sub canLogin { # Return true if logins are enabled on the given fileserver. #*** hardcoded my ($mach) = @_; return ($mach =~ /^kkstore/ || $mach eq 'eieio'); confess "Must have exactly 1 argument" if (scalar(@_) != 1); } sub chooseFileServer { # Choose a suitable machine for an I/O-intensive task. # If -fileServer was given, use that. # Otherwise, determine the fileserver for $path, and if we can log in # on the fileserver, and its load is not too high, return it. @@ -446,31 +447,31 @@ "smallClusterHub=s", "ram=s", "cpu=n", "priority=n", "verbose=n", "debug", "help", ); my %optionHelpText = ( 'workhorse' => ' -workhorse machine Use machine (default: %s) for compute or memory-intensive steps. ', 'fileServer' => ' -fileServer mach Use mach (default: fileServer of the build directory) - for I/O-intensive steps. + for I/O-intensive steps, fallback: %s. ', 'dbHost' => ' -dbHost mach Use mach (default: %s) as database server. ', 'bigClusterHub' => ' -bigClusterHub mach Use mach (default: %s) as parasol hub for cluster runs with very large job counts. ', 'smallClusterHub' => ' -smallClusterHub mach Use mach (default: %s) as parasol hub for cluster runs with smallish job counts. ', 'ram' => ' -ram Ng Use -ram=Ng for cluster jobs (default: %s) e.g. -ram=6g. @@ -484,30 +485,31 @@ ', 'debug' => ' -debug Don\'t actually run commands, just display them. ', 'verbose' => ' -verbose num Set verbose level to num (default %d). ', 'help' => ' -help Show detailed help and exit. ', ); my %optionDefaultDefaults = ( 'workhorse' => 'least loaded', 'dbHost' => $defaultDbHost, 'priority' => '10', + 'fileServer' => $defaultFileServer, 'bigClusterHub' => 'most available', 'smallClusterHub' => 'most available', 'ram' => $defaultRamG, 'cpu' => $defaultCpu, 'verbose' => $defaultVerbose, ); sub getCommonOptionHelp { # Return description of common options, given defaults, for usage message. # Input is a hash of applicable options and default values (which can be # empty, in which case %optionDefaultDefaults will be used). # debug, verbose and help will be added if not specified. my %optionSpec = @_; my $help = "";