Title: [290369] trunk/Tools
Revision
290369
Author
[email protected]
Date
2022-02-23 06:01:56 -0800 (Wed, 23 Feb 2022)

Log Message

[JSC] Set ssh keepalive in run-jsc-stress-tests
https://bugs.webkit.org/show_bug.cgi?id=237031

Reviewed by Adrian Perez de Castro.

If a remote goes down after an ssh connection has been established, we
need to be able to detect that. Keep the common ssh config options in
one constant and add ServerAliveInterval=30 to it.

While here, change sshRead to execute ssh directly (instead of
going through the shell). Similarly, don't open-code the read
loop, just call IO.read.

* Scripts/run-jsc-stress-tests:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (290368 => 290369)


--- trunk/Tools/ChangeLog	2022-02-23 13:47:10 UTC (rev 290368)
+++ trunk/Tools/ChangeLog	2022-02-23 14:01:56 UTC (rev 290369)
@@ -1,3 +1,20 @@
+2022-02-23  Angelos Oikonomopoulos  <[email protected]>
+
+        [JSC] Set ssh keepalive in run-jsc-stress-tests
+        https://bugs.webkit.org/show_bug.cgi?id=237031
+
+        Reviewed by Adrian Perez de Castro.
+
+        If a remote goes down after an ssh connection has been established, we
+        need to be able to detect that. Keep the common ssh config options in
+        one constant and add ServerAliveInterval=30 to it.
+
+        While here, change sshRead to execute ssh directly (instead of
+        going through the shell). Similarly, don't open-code the read
+        loop, just call IO.read.
+
+        * Scripts/run-jsc-stress-tests:
+
 2022-02-23  Kimmo Kinnunen  <[email protected]>
 
         Fix GPUP WebGL generator script wrt uninitialised sized span

Modified: trunk/Tools/Scripts/run-jsc-stress-tests (290368 => 290369)


--- trunk/Tools/Scripts/run-jsc-stress-tests	2022-02-23 13:47:10 UTC (rev 290368)
+++ trunk/Tools/Scripts/run-jsc-stress-tests	2022-02-23 14:01:56 UTC (rev 290369)
@@ -87,6 +87,13 @@
                                   :iterationsCeiling => 10)
 
 REMOTE_TIMEOUT = 120
+SSH_OPTIONS_DEFAULT = [
+    "-o",
+    "NoHostAuthenticationForLocalhost=yes",
+    "-o",
+    "ServerAliveInterval=30",
+]
+
 begin
     require 'shellwords'
 rescue Exception => e
@@ -2550,12 +2557,13 @@
     raise unless $remote
 
     result = ""
-    IO.popen("ssh -o NoHostAuthenticationForLocalhost=yes -p #{remoteHost.port}" + (remoteHost.identity_file_path ? " -i #{remoteHost.identity_file_path}" : "") + " #{remoteHost.user}@#{remoteHost.host} '#{cmd}'", "r") {
-      | inp |
-      inp.each_line {
-        | line |
-        result += line
-      }
+    ssh_cmd = ["ssh"] +
+              SSH_OPTIONS_DEFAULT +
+              ["-p", remoteHost.port.to_s] +
+              (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) +
+             ["#{remoteHost.user}@#{remoteHost.host}", cmd]
+    IO.popen(ssh_cmd, "r") { |inp|
+        result = inp.read
     }
     raise "#{$?}" unless $?.success? or options[:ignoreFailure]
     result
@@ -2689,8 +2697,8 @@
 end
 
 def copyBundleToRemote(remoteHost)
-    mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", "mkdir -p #{remoteHost.remoteDirectory}"])
-    mysys(["scp", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-P", remoteHost.port.to_s, ($outputDir.dirname + $tarFileName).to_s, "#{remoteHost.user}@#{remoteHost.host}:#{remoteHost.remoteDirectory}"])
+    mysys(["ssh"] + SSH_OPTIONS_DEFAULT + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", "mkdir -p #{remoteHost.remoteDirectory}"])
+    mysys(["scp"] + SSH_OPTIONS_DEFAULT + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-P", remoteHost.port.to_s, ($outputDir.dirname + $tarFileName).to_s, "#{remoteHost.user}@#{remoteHost.host}:#{remoteHost.remoteDirectory}"])
 end
 
 def exportBaseEnvironmentVariables(escape)
@@ -2724,7 +2732,7 @@
         remoteScript += exportBaseEnvironmentVariables(true)
         $envVars.each { |var| remoteScript += "export " << var << "\n" }
         remoteScript += "#{testRunner.command(remoteIndex)}\""
-        runAndMonitorTestRunnerCommand(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", remoteScript])
+        runAndMonitorTestRunnerCommand(["ssh"] + SSH_OPTIONS_DEFAULT + (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + ["-p", remoteHost.port.to_s, "#{remoteHost.user}@#{remoteHost.host}", remoteScript])
     else
         Dir.chdir($runnerDir) {
             runAndMonitorTestRunnerCommand(Shellwords.shellsplit(testRunner.command))
@@ -3049,8 +3057,8 @@
 def unpackBundleGnuParallel(remoteHosts)
     forEachRemote(remoteHosts, :dropOnFailure => true, :timeout => REMOTE_TIMEOUT) {
         | _, remoteHost |
-        mysys(["ssh", "-o", "NoHostAuthenticationForLocalhost=yes"] + 
-               (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) + 
+        mysys(["ssh"] + SSH_OPTIONS_DEFAULT +
+               (remoteHost.identity_file_path ? ["-i", remoteHost.identity_file_path] : []) +
                ["-p", remoteHost.port.to_s,
                "#{remoteHost.user}@#{remoteHost.host}",
                "cd #{Shellwords.shellescape(remoteHost.remoteDirectory)} && rm -rf #{$outputDir.basename} && tar xzf #{$tarFileName}"])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to