18794: Merge branch 'main'
authorTom Clegg <tom@curii.com>
Mon, 9 May 2022 13:49:36 +0000 (09:49 -0400)
committerTom Clegg <tom@curii.com>
Mon, 9 May 2022 13:49:36 +0000 (09:49 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

1  2 
cmd/arvados-server/cmd.go
sdk/python/tests/run_test_server.py

index 342446a811f228a2fffeff990056a09fe08b7704,c9a91c872160cb74c10d098c4ae2f0f9c16ce667..ae1e3fbeee2d1e2d4310bb3f221b1f14bf77b17b
@@@ -21,8 -21,8 +21,9 @@@ import 
        "git.arvados.org/arvados.git/lib/install"
        "git.arvados.org/arvados.git/lib/lsf"
        "git.arvados.org/arvados.git/lib/recovercollection"
 +      "git.arvados.org/arvados.git/sdk/go/health"
        "git.arvados.org/arvados.git/services/githttpd"
+       keepbalance "git.arvados.org/arvados.git/services/keep-balance"
        keepweb "git.arvados.org/arvados.git/services/keep-web"
        "git.arvados.org/arvados.git/services/keepproxy"
        "git.arvados.org/arvados.git/services/keepstore"
@@@ -36,7 -36,6 +37,7 @@@ var 
                "--version": cmd.Version,
  
                "boot":               boot.Command,
 +              "check":              health.CheckCommand,
                "cloudtest":          cloudtest.Command,
                "config-check":       config.CheckCommand,
                "config-defaults":    config.DumpDefaultsCommand,
@@@ -48,6 -47,7 +49,7 @@@
                "git-httpd":          githttpd.Command,
                "install":            install.Command,
                "init":               install.InitCommand,
+               "keep-balance":       keepbalance.Command,
                "keep-web":           keepweb.Command,
                "keepproxy":          keepproxy.Command,
                "keepstore":          keepstore.Command,
index 76893ac84217d9fbd576723a19e9aaaa06be72db,6f591b74a5a20f51b1d87e798c07eebf83606f3f..2c01b35aeac79b1642b18c7af7d166ef2cffdc3c
@@@ -331,19 -331,6 +331,19 @@@ def run(leave_running_atexit=False)
          os.makedirs(gitdir)
      subprocess.check_output(['tar', '-xC', gitdir, '-f', gittarball])
  
 +    # Customizing the passenger config template is the only documented
 +    # way to override the default passenger_stat_throttle_rate (10 s).
 +    # In the testing environment, we want restart.txt to take effect
 +    # immediately.
 +    resdir = subprocess.check_output(['bundle', 'exec', 'passenger-config', 'about', 'resourcesdir']).decode().rstrip()
 +    with open(resdir + '/templates/standalone/config.erb') as f:
 +        template = f.read()
 +    newtemplate = re.sub('http {', 'http {\n        passenger_stat_throttle_rate 0;', template)
 +    if newtemplate == template:
 +        raise "template edit failed"
 +    with open('tmp/passenger-nginx.conf.erb', 'w') as f:
 +        f.write(newtemplate)
 +
      port = internal_port_from_config("RailsAPI")
      env = os.environ.copy()
      env['RAILS_ENV'] = 'test'
      railsapi = subprocess.Popen(
          ['bundle', 'exec',
           'passenger', 'start', '-p{}'.format(port),
 +         '--nginx-config-template', 'tmp/passenger-nginx.conf.erb',
 +       '--no-friendly-error-pages',
 +       '--disable-anonymous-telemetry',
 +       '--disable-security-update-check',
           '--pid-file', pid_file,
           '--log-file', '/dev/stdout',
           '--ssl',
@@@ -974,6 -957,9 +974,9 @@@ if __name__ == "__main__"
                format(args.action, actions),
                file=sys.stderr)
          sys.exit(1)
+     # Create a new process group so our child processes don't exit on
+     # ^C in run-tests.sh interactive mode.
+     os.setpgid(0, 0)
      if args.action == 'start':
          stop(force=('ARVADOS_TEST_API_HOST' not in os.environ))
          run(leave_running_atexit=True)