hypershell 2.9.0a4__tar.gz → 2.9.0a6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/PKG-INFO +1 -1
  2. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/cluster_help.rst +2 -1
  3. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_param_ref.rst +166 -0
  4. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/database.rst +29 -0
  5. hypershell-2.9.0a6/docs/_include/relay_desc.rst +76 -0
  6. hypershell-2.9.0a6/docs/_include/relay_help.rst +64 -0
  7. hypershell-2.9.0a6/docs/_include/relay_usage.rst +2 -0
  8. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/templates.rst +16 -1
  9. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/index.rst +1 -0
  10. hypershell-2.9.0a6/docs/cli/relay.rst +40 -0
  11. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/manual.rst +14 -0
  12. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/security.rst +128 -8
  13. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/pyproject.toml +1 -1
  14. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/bash_completion.d/hs +26 -1
  15. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/man/man1/hs.1 +337 -2
  16. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/man/man1/hsx.1 +337 -2
  17. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/man/man1/hyper-shell.1 +337 -2
  18. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/zsh/site-functions/_hs +21 -0
  19. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/__init__.py +4 -1
  20. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/client.py +59 -4
  21. hypershell-2.9.0a6/src/hypershell/cluster/launch.py +382 -0
  22. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/cluster/remote.py +45 -98
  23. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/cluster/ssh.py +31 -37
  24. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/config.py +92 -1
  25. hypershell-2.9.0a6/src/hypershell/core/heartbeat.py +120 -0
  26. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/logging.py +1 -1
  27. hypershell-2.9.0a6/src/hypershell/core/reconnect.py +537 -0
  28. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/template.py +15 -7
  29. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/data/model.py +95 -35
  30. hypershell-2.9.0a6/src/hypershell/relay/__init__.py +1036 -0
  31. hypershell-2.9.0a6/src/hypershell/relay/site.py +318 -0
  32. hypershell-2.9.0a6/src/hypershell/relay/store.py +401 -0
  33. hypershell-2.9.0a6/src/hypershell/relay/upstream.py +868 -0
  34. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/server.py +79 -6
  35. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/__init__.py +10 -3
  36. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_autoscale.py +4 -1
  37. hypershell-2.9.0a6/tests/test_cluster_launch.py +1448 -0
  38. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_contended_recovery.py +26 -0
  39. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_contended_write.py +28 -4
  40. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_logging.py +2 -0
  41. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_main.py +11 -1
  42. hypershell-2.9.0a6/tests/test_relay_connector.py +639 -0
  43. hypershell-2.9.0a6/tests/test_relay_db.py +415 -0
  44. hypershell-2.9.0a6/tests/test_relay_fsm.py +929 -0
  45. hypershell-2.9.0a6/tests/test_relay_judge.py +331 -0
  46. hypershell-2.9.0a6/tests/test_relay_launch.py +700 -0
  47. hypershell-2.9.0a6/tests/test_relay_link.py +390 -0
  48. hypershell-2.9.0a6/tests/test_relay_outage.py +267 -0
  49. hypershell-2.9.0a6/tests/test_relay_return.py +716 -0
  50. hypershell-2.9.0a6/tests/test_relay_roster.py +519 -0
  51. hypershell-2.9.0a6/tests/test_relay_workload.py +1152 -0
  52. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_upgrade_cli.py +3 -1
  53. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_writeback.py +19 -0
  54. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_zone_postgres.py +23 -2
  55. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/uv.lock +1 -1
  56. hypershell-2.9.0a4/src/hypershell/core/heartbeat.py +0 -81
  57. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/.gitignore +0 -0
  58. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/CODE_OF_CONDUCT.md +0 -0
  59. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/LICENSE +0 -0
  60. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/README.rst +0 -0
  61. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/Makefile +0 -0
  62. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/citation.rst +0 -0
  63. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/client_desc.rst +0 -0
  64. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/client_help.rst +0 -0
  65. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/client_usage.rst +0 -0
  66. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/cluster_desc.rst +0 -0
  67. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/cluster_usage.rst +0 -0
  68. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_desc.rst +0 -0
  69. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_edit_desc.rst +0 -0
  70. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_edit_help.rst +0 -0
  71. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_edit_usage.rst +0 -0
  72. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_get_desc.rst +0 -0
  73. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_get_help.rst +0 -0
  74. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_get_usage.rst +0 -0
  75. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_help.rst +0 -0
  76. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_intro.rst +0 -0
  77. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_intro_alt.rst +0 -0
  78. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_pythonpath.rst +0 -0
  79. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_set_desc.rst +0 -0
  80. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_set_help.rst +0 -0
  81. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_set_usage.rst +0 -0
  82. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_site_vars.rst +0 -0
  83. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_task_env.rst +0 -0
  84. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_task_env_alt.rst +0 -0
  85. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_usage.rst +0 -0
  86. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_which_desc.rst +0 -0
  87. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_which_help.rst +0 -0
  88. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/config_which_usage.rst +0 -0
  89. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/database_alt.rst +0 -0
  90. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/desc.rst +0 -0
  91. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/exit_status.rst +0 -0
  92. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/initdb_desc.rst +0 -0
  93. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/initdb_help.rst +0 -0
  94. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/initdb_usage.rst +0 -0
  95. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/license.rst +0 -0
  96. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/security_alt.rst +0 -0
  97. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/server_desc.rst +0 -0
  98. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/server_help.rst +0 -0
  99. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/server_usage.rst +0 -0
  100. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/signals.rst +0 -0
  101. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/submit_desc.rst +0 -0
  102. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/submit_help.rst +0 -0
  103. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/submit_usage.rst +0 -0
  104. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_groups_alt.rst +0 -0
  105. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_info_desc.rst +0 -0
  106. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_info_help.rst +0 -0
  107. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_info_usage.rst +0 -0
  108. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_run_desc.rst +0 -0
  109. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_run_help.rst +0 -0
  110. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_run_usage.rst +0 -0
  111. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_search_desc.rst +0 -0
  112. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_search_help.rst +0 -0
  113. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_search_usage.rst +0 -0
  114. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_submit_desc.rst +0 -0
  115. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_submit_help.rst +0 -0
  116. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_submit_usage.rst +0 -0
  117. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_update_desc.rst +0 -0
  118. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_update_help.rst +0 -0
  119. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_update_usage.rst +0 -0
  120. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_wait_desc.rst +0 -0
  121. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_wait_help.rst +0 -0
  122. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/task_wait_usage.rst +0 -0
  123. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/templates_alt.rst +0 -0
  124. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_include/tls_cli_options.rst +0 -0
  125. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_static/custom.css +0 -0
  126. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_static/logo-dark-mode.png +0 -0
  127. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/_static/logo-light-mode.png +0 -0
  128. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/alternatives.rst +0 -0
  129. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/client.rst +0 -0
  130. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/cluster.rst +0 -0
  131. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/data.rst +0 -0
  132. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/index.rst +0 -0
  133. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/server.rst +0 -0
  134. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/api/submit.rst +0 -0
  135. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/client.rst +0 -0
  136. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/cluster.rst +0 -0
  137. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/config.rst +0 -0
  138. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/config_edit.rst +0 -0
  139. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/config_get.rst +0 -0
  140. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/config_set.rst +0 -0
  141. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/config_which.rst +0 -0
  142. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/initdb.rst +0 -0
  143. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/server.rst +0 -0
  144. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/submit.rst +0 -0
  145. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_info.rst +0 -0
  146. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_run.rst +0 -0
  147. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_search.rst +0 -0
  148. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_submit.rst +0 -0
  149. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_update.rst +0 -0
  150. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/cli/task_wait.rst +0 -0
  151. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/conf.py +0 -0
  152. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/config.rst +0 -0
  153. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/database.rst +0 -0
  154. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/getting_started.rst +0 -0
  155. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/index.rst +0 -0
  156. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/install.rst +0 -0
  157. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/logging.rst +0 -0
  158. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/docs/templates.rst +0 -0
  159. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/share/bash_completion.d/hsx +0 -0
  160. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/cluster/__init__.py +0 -0
  161. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/cluster/local.py +0 -0
  162. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/config.py +0 -0
  163. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/__init__.py +0 -0
  164. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/dispatch.py +0 -0
  165. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/exceptions.py +0 -0
  166. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/fsm.py +0 -0
  167. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/platform.py +0 -0
  168. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/pretty_print.py +0 -0
  169. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/queue.py +0 -0
  170. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/remote.py +0 -0
  171. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/resource.py +0 -0
  172. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/signal.py +0 -0
  173. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/sys.py +0 -0
  174. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/tag.py +0 -0
  175. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/thread.py +0 -0
  176. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/tls.py +0 -0
  177. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/types.py +0 -0
  178. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/core/uuid.py +0 -0
  179. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/data/__init__.py +0 -0
  180. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/data/core.py +0 -0
  181. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/data/timescale.py +0 -0
  182. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/data/upgrade.py +0 -0
  183. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/submit.py +0 -0
  184. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/src/hypershell/task.py +0 -0
  185. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/bench/bench_queue.py +0 -0
  186. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/cluster/build_archive.sh +0 -0
  187. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/cluster/compare.py +0 -0
  188. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/cluster/drive.sh +0 -0
  189. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/cluster/smoke.sh +0 -0
  190. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/conftest.py +0 -0
  191. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/fixtures/README.md +0 -0
  192. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/fixtures/hypershell-2.8.3.db +0 -0
  193. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/fixtures/make-2.8.3-db.sh +0 -0
  194. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/fixtures/make-legacy-postgres.sh +0 -0
  195. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_cancel.py +0 -0
  196. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_card_info.py +0 -0
  197. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_card_integration.py +0 -0
  198. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_card_render.py +0 -0
  199. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_client.py +0 -0
  200. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_client_request.py +0 -0
  201. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_cluster.py +0 -0
  202. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_cluster_compare.py +0 -0
  203. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_completions.py +0 -0
  204. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_data/__init__.py +0 -0
  205. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_data/test_core.py +0 -0
  206. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_data/test_model.py +0 -0
  207. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_data/test_upgrade.py +0 -0
  208. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_dispatch.py +0 -0
  209. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_dispatch_staged.py +0 -0
  210. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_dispatch_version.py +0 -0
  211. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_dispatch_workload.py +0 -0
  212. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_factory_fsm.py +0 -0
  213. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_group_order.py +0 -0
  214. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_groups.py +0 -0
  215. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_initdb.py +0 -0
  216. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_list.py +0 -0
  217. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_meta_status.py +0 -0
  218. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue.py +0 -0
  219. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_address_family.py +0 -0
  220. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_gc.py +0 -0
  221. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_limits.py +0 -0
  222. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_start.py +0 -0
  223. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_tls.py +0 -0
  224. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_queue_workload.py +0 -0
  225. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_restart.py +0 -0
  226. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_retry_gate.py +0 -0
  227. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_server.py +0 -0
  228. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_server_fsm.py +0 -0
  229. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_signal.py +0 -0
  230. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_source.py +0 -0
  231. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_status_label.py +0 -0
  232. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_submit.py +0 -0
  233. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_submit_json.py +0 -0
  234. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_template.py +0 -0
  235. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_timescale.py +0 -0
  236. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_update.py +0 -0
  237. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_upgrade_postgres.py +0 -0
  238. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_writeback_postgres.py +0 -0
  239. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_writeback_statement.py +0 -0
  240. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_zone_dispatch.py +0 -0
  241. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_zone_display.py +0 -0
  242. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_zone_model.py +0 -0
  243. {hypershell-2.9.0a4 → hypershell-2.9.0a6}/tests/test_zone_workload.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: hypershell
3
- Version: 2.9.0a4
3
+ Version: 2.9.0a6
4
4
  Summary: A cross-platform, high-throughput computing utility for processing shell commands over a distributed, asynchronous queue.
5
5
  Project-URL: Homepage, https://hypershell.org
6
6
  Project-URL: Documentation, https://hypershell.readthedocs.io
@@ -195,7 +195,8 @@ Options
195
195
 
196
196
  ``-E``, ``--env``
197
197
  Send environment variables. Only for ``--ssh`` mode, all ``HYPERSHELL_`` prefixed environment
198
- variables can be exported to the remote clients.
198
+ variables can be exported to the remote clients, except ``HYPERSHELL_SERVER_AUTH``, which is
199
+ never sent this way.
199
200
 
200
201
  ``--remote-exe`` *PATH*
201
202
  Path to remote executable on the client side.
@@ -517,6 +517,172 @@
517
517
  For a *dynamic* autoscaling policy, this sets an upper limit on the number of launched
518
518
  clients. When this number is reached, scaling stops regardless of task pressure.
519
519
 
520
+ ``[relay]``
521
+ Section for the `relay` workflow, which connects a site to an upstream *server*.
522
+
523
+ ``.database``
524
+ Path to the relay database (default: <lib>/relay/<host>.db).
525
+
526
+ The relay database is always a private SQLite file, whatever ``[database]`` names; a relay
527
+ never opens the configured database. The default is named for the host, since a home
528
+ directory is often shared between hosts. A node-local disk is a good place for it.
529
+
530
+ See also ``--database`` command-line option.
531
+
532
+ ``.bind``
533
+ Bind address of the relay-local *server* (default: `0.0.0.0`).
534
+
535
+ The *clients* at the site connect here. See also ``--bind`` command-line option.
536
+
537
+ ``.port``
538
+ Port of the relay-local *server* (default: `50002`).
539
+
540
+ See also ``--port`` command-line option.
541
+
542
+ ``.bundlesize``
543
+ Size of task bundle for the relay-local *server* and the *clients* at its site
544
+ (default: `1`).
545
+
546
+ It is never smaller than ``relay.num_threads``: a *client* asks for one bundle at a time,
547
+ so a smaller bundle would leave its executors idle between requests.
548
+
549
+ ``.bundlewait``
550
+ Seconds the relay waits before returning finished tasks upstream regardless of
551
+ `bundlesize` (default: `5`).
552
+
553
+ ``.poll``
554
+ Maximum polling interval of the relay-local scheduler in seconds (default: `0.1`).
555
+
556
+ Received tasks wait at most this long before the relay-local *server* hands them out.
557
+
558
+ ``.retention``
559
+ Seconds a result is kept in the relay database after it has been returned upstream
560
+ (default: `300`). Results not yet returned are always kept.
561
+
562
+ ``.zone``
563
+ Zone or zones the relay serves (default: none, the default zone).
564
+
565
+ One zone name, a list of names, or one table per zone, ``[relay.zone.NAME]``, which may
566
+ give that zone's own ``launcher``, ``launcher_args`` and ``size`` (each in place of the
567
+ relay's, for that zone's *clients* only); an empty table serves the zone with the relay's.
568
+ Upstream the relay is one *client* per zone, each with its own identity; at the site it
569
+ keeps one fleet of *clients* per zone, all served by the relay-local *server*. The first
570
+ zone's identity lists the site's *clients* upstream.
571
+
572
+ .. code-block:: toml
573
+
574
+ [relay.zone.cpu]
575
+
576
+ [relay.zone.gpu]
577
+ size = 2
578
+ launcher = "srun"
579
+ launcher_args = "--gres=gpu:1"
580
+
581
+ See also ``--zone`` command-line option, which names the zones in place of this one.
582
+
583
+ ``.site``
584
+ Name of the relay's site (default: none, the relay's host name).
585
+
586
+ The upstream *server* records the relay, and the *clients* at its site, under this name.
587
+
588
+ ``.size``
589
+ Number of *clients* the relay keeps launched at its site (default: `1`, at least `1`).
590
+
591
+ See also ``-N``, ``--size`` command-line option.
592
+
593
+ ``.launcher``
594
+ Command prefix used to launch each *client* at the site (default: none).
595
+
596
+ An empty value launches clients directly as ``hs client ...``.
597
+ See also ``--launcher`` command-line option.
598
+
599
+ ``.launcher_args``
600
+ Extra arguments for the launcher (default: none).
601
+
602
+ See also ``--launcher-args`` command-line option.
603
+
604
+ ``.num_threads``
605
+ Executor threads for each *client* at the site (default: `1`).
606
+
607
+ ``.template``
608
+ Command template for the *clients* at the site (default: `{}`).
609
+
610
+ ``.timeout``
611
+ Seconds a *client* at the site waits for tasks before it exits (default: `0`, never).
612
+
613
+ ``[upstream]``
614
+ Connection to the upstream *server*. These settings are never read from ``[server]``,
615
+ so the *clients* at the site keep using the relay's own ``[server.tls]``.
616
+
617
+ ``.host``
618
+ Hostname of the upstream *server* (default: `localhost`).
619
+
620
+ See also ``--upstream-host`` command-line option.
621
+
622
+ ``.port``
623
+ Port of the upstream *server* (default: `50001`).
624
+
625
+ See also ``--upstream-port`` command-line option.
626
+
627
+ ``.auth``
628
+ Cryptographic key for the upstream *server*.
629
+
630
+ Use ``.auth_env`` or ``.auth_eval`` to keep it out of the file; whichever form is set
631
+ in the highest-precedence place is used (two forms in one place are refused). The
632
+ upstream key stays in the relay: the *clients* at the site use a key the relay mints for
633
+ each run.
634
+
635
+ ``.bundlesize``
636
+ Bundle size the relay advertises upstream (default: `1000`).
637
+
638
+ The relay holds at most twice its connected *clients* times ``relay.bundlesize`` in
639
+ unfinished tasks. It asks for more only once half of that is left, and then for the
640
+ whole difference (never more than this size at once), so the site has a second round
641
+ of work ready while the first runs.
642
+
643
+ ``.heartrate``
644
+ Seconds between heartbeats to the upstream *server* (default: `10`).
645
+
646
+ ``.deadline``
647
+ Seconds a call to the upstream *server* may take before the relay takes the connection
648
+ as lost (default: `30`).
649
+
650
+ While the upstream *server* cannot be reached, the site keeps running and finished
651
+ tasks are kept in the relay database; the relay connects again, with backoff, and then
652
+ returns them before it asks for more work.
653
+
654
+ ``.backoff``
655
+ Longest wait in seconds between attempts to reach the upstream *server* again
656
+ (default: `60`).
657
+
658
+ Each wait is drawn at random up to a bound that starts at one second and doubles with
659
+ each failed attempt, up to this value.
660
+
661
+ ``.evict_hint``
662
+ Seconds of lost contact after which the relay takes the upstream *server* to have
663
+ evicted it (default: `600`, the *server*'s own default ``server.evict``).
664
+
665
+ Set it to the upstream ``server.evict``. Past it, the relay warns that the results it
666
+ holds will likely be refused as stale (the upstream *server* has put those tasks back
667
+ for other *clients*), and it does not repeat a confirmation the outage cut off. The
668
+ results are still returned when the connection comes back.
669
+
670
+ ``[tls]``
671
+ ``.enabled``
672
+ Use TLS on the upstream connection (default: `true`).
673
+
674
+ See also ``--no-tls`` command-line option.
675
+
676
+ ``.cert``
677
+ Upstream server certificate (default: `<auto>`).
678
+
679
+ ``.cafile``
680
+ Trust anchor for the upstream server (default: `<auto>`).
681
+
682
+ ``.fingerprint``
683
+ Pin the upstream server certificate fingerprint, e.g. ``SHA256:AB:CD:...``
684
+ (default: none).
685
+
520
686
  ``[console]``
521
687
  Rich text display and output parameters.
522
688
 
@@ -129,6 +129,35 @@ See also the :ref:`command-line interface <cli_initdb>` for ``hs initdb``.
129
129
 
130
130
  -------------------
131
131
 
132
+ Relay Database
133
+ --------------
134
+
135
+ |
136
+
137
+ A relay (``hs relay``) keeps its own database, apart from the one configured here. It is always a
138
+ private SQLite file, whatever ``[database]`` names (PostgreSQL included), and the configured database
139
+ is never opened by a relay process. It holds the tasks the relay has received and not yet finished,
140
+ their upstream assignments, and the results the relay holds until it has handed them back
141
+ (and for ``relay.retention`` seconds after), so it stays about the same size however long the relay
142
+ runs.
143
+
144
+ The file is ``relay.database`` (``--database``), by default ``<lib>/relay/<host>.db``: named for the
145
+ host, since a home directory is often shared between hosts. One relay uses a file at a time; a
146
+ second relay on the same file refuses to start (a lock file beside it, ``<file>.lock``, guards it).
147
+
148
+ Every insert of received tasks is committed with ``synchronous = FULL`` before the relay confirms
149
+ them upstream, so the file sees a steady stream of small, durable writes. Put it on a **node-local
150
+ disk** where the relay runs, not on a network filesystem: SQLite's locking is unreliable on many
151
+ network filesystems, and their latency slows each commit. WAL journaling is not turned on, for the
152
+ same reason; a node-local file may use it through ``[database] pragmas`` if wanted. A relay
153
+ restarted on the same file picks up where its earlier run stopped: results it still held go back
154
+ upstream, and tasks it was running run again at the site.
155
+
156
+ A relay given a configuration file with relay settings in it writes a copy for its site beside the
157
+ relay database (``<file>.site.toml``, readable by its owner only), removed when the relay ends.
158
+
159
+ -------------------
160
+
132
161
  TimescaleDB
133
162
  -----------
134
163
 
@@ -0,0 +1,76 @@
1
+ Run relay for one site.
2
+
3
+ A *relay* connects a site to an upstream *server*. Upstream it is an ordinary *client*; at
4
+ the site it runs its own *server*, scheduling the tasks it receives to *clients* it launches
5
+ there, and returns their results upstream.
6
+
7
+ Upstream, the relay requests work for its zone under an identity of its own, derived from the
8
+ relay and the zone name and logged when it starts. It holds at most about two rounds of work for its
9
+ site (twice its connected *clients* times its bundle size, ``relay.bundlesize``, which is never
10
+ below a *client*'s executor threads), asks for more once half of that is left, and then for the
11
+ whole difference at once. It confirms the tasks it receives only once they are stored in the relay
12
+ database. The upstream key comes from
13
+ ``relay.upstream.auth`` (or its ``_env`` and ``_eval`` forms), never from the command line.
14
+ The key never reaches the site: before its first *client* is launched, the relay removes from its
15
+ own environment, which the site's *clients* and their tasks inherit, every relay setting
16
+ (``HYPERSHELL_RELAY_*``) and any variable holding the key. When ``HYPERSHELL_CONFIG_FILE`` names a
17
+ file that holds relay settings or the key, the site is given a copy of it instead, without the
18
+ ``[relay]`` section and without any value holding the key, readable by its owner only, and kept
19
+ beside the relay database; the site's *clients* keep the file's other settings, ``[server.tls]``
20
+ among them. (If the file cannot be read, the site gets none.) The copy is removed when the relay
21
+ exits, however it ends: when it finishes, when it fails, and on SIGINT or SIGTERM. Only a relay
22
+ killed outright leaves it behind (by SIGKILL, or by a second SIGTERM while it ends, which ends the
23
+ process at once), and the next relay on the same relay database to need a copy writes over it. The relay refuses to start if the *client* command line (launcher, launcher
24
+ arguments or template) or a variable exported to tasks (``[export]``) would carry the key.
25
+
26
+ At the site the relay runs its tasks on the *clients* it launches there, with a key it mints for
27
+ each run. Each *client* receives that key in its environment (``HYPERSHELL_SERVER_AUTH``), never on
28
+ its command line, and passes it to none of its tasks, so the launcher must pass the environment
29
+ through to the *client*. A site *client* that stops sending heartbeats is evicted by the relay
30
+ after ``server.evict`` seconds, and the tasks it held are run again at the site. The site never
31
+ retries a task: one that fails goes back upstream as it
32
+ ended, and the upstream *server* decides whether to run it again. Each result goes back attributed to the *client*
33
+ at the site that ran it, matched to the assignment the upstream *server* made. Results are kept in
34
+ the relay database until they have been handed over, and for a while after (``relay.retention``).
35
+ The relay's heartbeat names its site (``relay.site``, by default the relay's host name) and lists the
36
+ *clients* connected at the site, by id and host only. The upstream *server* records them as its own
37
+ *clients*, attributed to the site and the relay, and counts them (not the relay) as connected. They
38
+ never heartbeat upstream themselves: they disconnect there when they leave the site, and all at once
39
+ when the relay finishes or is evicted.
40
+ A relay may serve several zones (``--zone`` given more than once, or ``relay.zone`` as a list or as
41
+ one ``[relay.zone.NAME]`` table per zone). Upstream it is then one *client* per zone, each under its
42
+ own identity, all over the same connection: it takes the zones in turn, and asks for each only as
43
+ much as that zone's own *clients* at the site have room for. At the site it keeps one fleet of
44
+ *clients* per zone, launched alike but each serving its own zone, with that zone's own launcher,
45
+ launcher arguments and size if its table gives them; the one relay-local *server* serves them all.
46
+ The first zone's identity lists every *client* at the site upstream. Each identity sends its own
47
+ heartbeat, so if the relay fails, the upstream *server* evicts each one and puts back what each
48
+ held, in every zone.
49
+ When the upstream *server* shuts down, the relay finishes the tasks it holds, returns every result,
50
+ and ends its upstream registration. It hears of the shutdown in reply to a request for work, in any of
51
+ its zones; a zone with no *client* at the site and no task held then ends with the others. A relay
52
+ with no *client* at the site in any zone never asks, so it waits until it is drained or stopped.
53
+ SIGUSR1 or SIGUSR2, sent to the relay process, drain it the same way: the relay stops asking for work, its site finishes every task the relay holds (those not yet started
54
+ too), and the results go back before the registration ends. SIGINT and SIGTERM end the relay at
55
+ once, without draining: it ends the *clients* it launched and exits (on SIGTERM, by that signal; a
56
+ second SIGTERM ends the process at once). If
57
+ the relay fails (a part of its own *server* stops, say, or the upstream *server* refuses it), it ends
58
+ the *clients* it launched and exits with a non-zero status. Either way the upstream *server* puts
59
+ back the tasks the relay held when it evicts the relay.
60
+
61
+ A lost upstream connection is not a failure. While the upstream *server* cannot be reached (a call
62
+ gets no answer within ``relay.upstream.deadline``), the site keeps running the tasks the relay holds,
63
+ their results are kept in the relay database, and the relay connects again with backoff (at most
64
+ ``relay.upstream.backoff`` seconds apart). It logs the outage when it begins, now and then while it
65
+ lasts, and when it ends. Once connected again it sends a heartbeat first (the upstream *server*
66
+ registers it again if it had evicted it), then returns the results it holds, and only then asks for
67
+ more work. An outage shorter than the upstream eviction period (``relay.upstream.evict_hint``)
68
+ costs nothing: the results land. After a longer one, or after the upstream *server* restarted, the
69
+ upstream *server* has put those tasks back for other *clients*, so their results are refused as
70
+ stale and the tasks run again. A relay that is started while its upstream *server* cannot be reached
71
+ waits for it before it starts its site, and a relay restarted on the same relay database returns the
72
+ results its earlier run still held.
73
+
74
+ The relay database is always a private SQLite file, whatever database is configured, and the
75
+ configured database is never opened. One relay runs per process, and a second relay refuses to
76
+ start on the same relay database.
@@ -0,0 +1,64 @@
1
+ Options
2
+ ^^^^^^^
3
+
4
+ ``-H``, ``--upstream-host`` *ADDR*
5
+ Hostname or IP address of the upstream *server* (default: localhost).
6
+
7
+ See also ``relay.upstream.host``.
8
+
9
+ ``-p``, ``--upstream-port`` *NUM*
10
+ Port number of the upstream *server* (default: 50001).
11
+
12
+ See also ``relay.upstream.port``.
13
+
14
+ ``--no-tls``
15
+ Disable TLS on the connection to the upstream *server* (not recommended).
16
+
17
+ This affects only the upstream connection; the relay-local *server* keeps ``[server.tls]``.
18
+ See also ``relay.upstream.tls.enabled``.
19
+
20
+ ``--zone`` *NAME*
21
+ Zone this relay serves (default: the default zone). Give it more than once to serve several.
22
+
23
+ The relay asks upstream only for tasks of the zones it serves, and keeps one fleet of
24
+ *clients* at the site for each zone (``-N`` *clients* each, unless the zone gives its own
25
+ ``size``). Zones named here take the place of ``relay.zone``; each still takes its own
26
+ settings from ``[relay.zone.NAME]``. See also ``relay.zone``.
27
+
28
+ ``-N``, ``--size`` *NUM*
29
+ Number of *clients* the relay keeps launched at its site (default: 1).
30
+
31
+ A *client* that exits is launched again. The size must be at least 1: with no *client* at the
32
+ site the relay would never ask upstream for work. See also ``relay.size``.
33
+
34
+ ``--launcher`` *CMD*
35
+ Command prefix used to launch each *client* at the site (default: none).
36
+
37
+ With none, *clients* run directly on the relay's host. Otherwise each is launched as
38
+ ``CMD [ARGS...] hyper-shell client ...`` (e.g., ``srun``). The *clients* connect back to the
39
+ relay by its host name. The launcher must pass the environment through: each *client*
40
+ receives the site key there (``HYPERSHELL_SERVER_AUTH``), never on its command line.
41
+ See also ``relay.launcher``.
42
+
43
+ ``--launcher-args`` *ARGS*
44
+ Extra arguments for the launcher, placed after it (quoted as one argument).
45
+
46
+ See also ``relay.launcher_args``.
47
+
48
+ ``--bind`` *ADDR*
49
+ Bind address of the relay-local *server* (default: 0.0.0.0).
50
+
51
+ The *clients* at the site connect to the relay here, so it must be reachable from the
52
+ nodes they run on. See also ``relay.bind``.
53
+
54
+ ``--port`` *NUM*
55
+ Port of the relay-local *server* (default: 50002).
56
+
57
+ The default differs from the *server* default (50001), so a relay can run beside a
58
+ *server* on the same host. See also ``relay.port``.
59
+
60
+ ``--database`` *PATH*
61
+ Path to the relay database (default: <lib>/relay/<host>.db).
62
+
63
+ The default is named for the host, since a home directory is often shared between hosts.
64
+ A node-local disk is a good place for it. See also ``relay.database``.
@@ -0,0 +1,2 @@
1
+ ``hs`` ``relay`` ``[-h]`` ``[-H ADDR]`` ``[-p NUM]`` ``[--no-tls]`` ``[--zone NAME ...]`` ``[-N NUM]``
2
+ ``[--launcher CMD]`` ``[--launcher-args ARGS]`` ``[--bind ADDR]`` ``[--port NUM]`` ``[--database PATH]``
@@ -175,6 +175,13 @@ The incoming command-line args can be substituted with an ``@``.
175
175
  ``{% mktemp -d %}``
176
176
  Create temporary directory and insert its path.
177
177
 
178
+ When a client expands the template, the command runs with the client's own
179
+ environment, without ``HYPERSHELL_SERVER_AUTH`` (see :doc:`/security`). That is
180
+ the environment the client's tasks inherit, before the client adds the
181
+ ``[export]`` values and the ``TASK_*`` variables for each task. So the command
182
+ sees an ``[export]`` value only if the client's own environment already holds
183
+ it, as it does for a client that ``hs cluster`` starts through a launcher.
184
+
178
185
  -------------------
179
186
 
180
187
  Lambda Expressions
@@ -186,7 +193,15 @@ Arbitrary Python expressions can be expanded with the ``{= =}`` notation.
186
193
  The input argument can be used within the expression with the variable ``x``.
187
194
 
188
195
  Exposed standard library modules include ``os``, ``os.path`` as ``path``,
189
- ``math`` and ``datetime`` as ``dt``.
196
+ ``math`` and ``datetime`` as ``dt``. The expression is evaluated in the
197
+ process that expands the template, so ``os.environ`` is that process's own
198
+ environment. Under a client that ``hs cluster`` starts as a process of its own,
199
+ through a launcher or over SSH, it includes ``HYPERSHELL_SERVER_AUTH``
200
+ (see :doc:`/security`). Under the default local mode, whose client runs inside
201
+ the ``hs cluster`` process, it includes the variable only if the environment
202
+ that starts ``hs cluster`` already sets it: the key that run mints is never put
203
+ in that process's environment. A client started by hand with ``-k`` has it there
204
+ only if its own environment sets it.
190
205
 
191
206
  Incoming arguments are intelligently coerced into the expected type.
192
207
  E.g., ``2`` will be an integer, ``4.67`` a float, ``null`` and ``none``
@@ -19,6 +19,7 @@ Subcommands
19
19
  cluster <cluster>
20
20
  server <server>
21
21
  client <client>
22
+ relay <relay>
22
23
  submit <submit>
23
24
  initdb <initdb>
24
25
  info <task_info>
@@ -0,0 +1,40 @@
1
+ .. _cli_relay:
2
+
3
+ Relay
4
+ =====
5
+
6
+ Usage
7
+ -----
8
+
9
+ .. include:: ../_include/relay_usage.rst
10
+
11
+ Description
12
+ -----------
13
+
14
+ .. include:: ../_include/relay_desc.rst
15
+
16
+ |
17
+
18
+ .. include:: ../_include/relay_help.rst
19
+
20
+ What a relay does not do
21
+ ------------------------
22
+
23
+ A relay moves work across a wide-area hop to a site the upstream *server* cannot reach directly, and
24
+ keeps it running when that hop fails. It is not meant for, and does not provide:
25
+
26
+ - **More throughput.** A relay adds a hop. Tasks run no faster at its site than they would on
27
+ *clients* connected straight to the upstream *server*; it holds at most about two rounds of work
28
+ per site *client*, so it never takes more than its site can run soon.
29
+ - **Cancellation or output retrieval across sites.** ``hs update`` on the upstream *server* does not
30
+ reach a task the relay already holds, and ``hs info --stdout`` / ``--stderr`` reads captured output
31
+ from the host that ran the task, which upstream may have no route to.
32
+ - **Autoscaling by site topology.** Each served zone's fleet has a fixed size (``-N``, or the zone's
33
+ own ``size``); the relay launches another *client* only when one exits.
34
+ - **Tolerance of clock skew.** The upstream *server* ages a relay's heartbeats by the relay's own
35
+ clock, so a relay host whose clock is far off the upstream *server*'s is evicted while alive (and
36
+ its tasks put back). Keep every relay host's clock synchronised with the upstream *server*'s.
37
+
38
+ A task cut for the relay upstream but not yet confirmed when the relay dies (or when its connection
39
+ drops) stays assigned upstream with no *client*; this window exists for every *client*, and is larger
40
+ for a relay by its bundle size.
@@ -19,6 +19,10 @@ hs server [-h] FILE ...
19
19
  hs client [-h] ...
20
20
  Run stand-alone client.
21
21
 
22
+ hs relay [-h] [-H ADDR] [-p NUM] [--no-tls] [--zone NAME] [-N NUM] [--launcher CMD]
23
+ [--launcher-args ARGS] [--bind ADDR] [--port NUM] [--database PATH]
24
+ Run relay for one site.
25
+
22
26
  hs submit [-h] [ARGS... | -f FILE] ...
23
27
  Submit one or more tasks.
24
28
 
@@ -88,6 +92,16 @@ Client Usage
88
92
  .. include:: _include/client_help.rst
89
93
 
90
94
 
95
+ Relay Usage
96
+ -----------
97
+
98
+ .. include:: _include/relay_usage.rst
99
+
100
+ .. include:: _include/relay_desc.rst
101
+
102
+ .. include:: _include/relay_help.rst
103
+
104
+
91
105
  Submit Usage
92
106
  ------------
93
107
 
@@ -168,15 +168,84 @@ placeholder key and enforces a minimum key policy: the key must be at least 16 c
168
168
  drawn from ``[A-Za-z0-9._+/=-]`` (which admits hex, URL-safe tokens, and standard Base64). The
169
169
  key generators used in the deployment guides below satisfy this policy.
170
170
 
171
- .. admonition:: The key is visible on the client command line in cluster launches
171
+ .. admonition:: How cluster launches hand the key to their clients
172
172
  :class: note
173
173
 
174
- For ``SSHCluster`` and the MPI/SLURM launchers, the per-invocation key is passed to each
175
- client process as a ``-k`` command-line argument. On multi-user client hosts it is
176
- therefore visible in the process table (``ps`` / ``/proc``) and scheduler accounting for
177
- the lifetime of the client, even though it is redacted from *HyperShell*'s own launch
178
- logs. Treat every host that holds the key as inside the trust boundary. A directly
179
- configured ``server.auth`` is likewise stored in plaintext in the config file and printed
174
+ When ``hs cluster`` starts its clients as separate processes (``--launcher``, ``--mpi``,
175
+ ``--autoscaling`` and ``--ssh``), the per-invocation key is on no command line, either on
176
+ the launching host or on the client hosts. Every client reads its key from the
177
+ ``HYPERSHELL_SERVER_AUTH`` environment variable when no ``-k`` is given, and the launch
178
+ delivers it there.
179
+
180
+ * **Launcher modes** (``--launcher``, ``--mpi`` and ``--autoscaling``). The launcher is
181
+ started with the key in its environment, and must pass that environment through to the
182
+ clients it starts. ``srun`` (with its default ``--export=ALL``), MPICH, Intel MPI and
183
+ Flux do. Only when the launcher is one Open MPI may provide does the launch also ask
184
+ Open MPI to forward the variable to remote ranks, by name: through
185
+ ``OMPI_MCA_mca_base_env_list``, keeping names already set there, or, if the launcher's
186
+ arguments already hold ``-x`` (also written ``--x``, or either with ``=``; Open MPI 4
187
+ does not accept ``-x`` together with that parameter), by adding
188
+ ``-x HYPERSHELL_SERVER_AUTH``. That is ``--mpi``, or a ``--launcher`` whose first word
189
+ has the base name ``mpirun``, ``mpiexec``, ``orterun`` or ``prterun``, or ``mpirun`` or
190
+ ``mpiexec`` with a dotted suffix, such as Debian's ``mpirun.openmpi`` (an MPICH name
191
+ such as ``mpiexec.hydra`` matches too; MPICH ignores the Open MPI parameter). Only the
192
+ first word counts: ``srun mpirun`` gets neither, as do ``srun``, any other launcher,
193
+ and ``--autoscaling`` with no launcher. If such a launcher needs Open MPI to forward
194
+ the variable, add ``-x HYPERSHELL_SERVER_AUTH`` (the name only) to ``--launcher``. A
195
+ launcher set to drop the environment, such as ``srun --export=NONE``, leaves its
196
+ clients without the key, so they cannot authenticate.
197
+ Such a client exits with a ``CRITICAL`` error that names ``HYPERSHELL_SERVER_AUTH`` and
198
+ the launcher not passing the environment as the likely cause. With TLS on, where the
199
+ dropped environment also held the client's TLS settings, the client fails to verify the
200
+ server's certificate before it authenticates; when it has no key either, that error
201
+ names the same likely cause.
202
+
203
+ * **SSH** (``--ssh``). The key travels on the ssh channel's standard input. On each remote
204
+ host a short POSIX ``sh`` step reads it into ``HYPERSHELL_SERVER_AUTH`` using shell
205
+ builtins, exports it, and replaces itself with the client, so the key is on no command
206
+ line there either. With ``--env``, the other ``HYPERSHELL_*`` variables of the launching
207
+ environment are still passed on ssh's command line, one ``NAME=value`` word each, with
208
+ the value quoted for a POSIX shell, so a POSIX login shell on the remote host reads back
209
+ exactly that value, and no value can run into another word. ``HYPERSHELL_SERVER_AUTH`` is left out by name before any
210
+ word is built, so it is never among them, whatever the other values hold. (A name that
211
+ is not a valid shell variable name is left out too, with a warning.) The launch owns ssh's standard input and always passes ``-T``, so no remote
212
+ terminal is allocated. A ``-t`` or ``-tt`` in ``--ssh-args`` or ``ssh.args``
213
+ therefore has no effect on client launches, and a bare ``-n`` there is dropped with a
214
+ warning. If no key arrives, for example because a wrapper around ``ssh`` closes its
215
+ standard input, the remote step prints a message naming ``HYPERSHELL_SERVER_AUTH`` and
216
+ ssh's standard input, and exits before any client starts.
217
+
218
+ The key is also redacted from *HyperShell*'s own launch logs, at every level.
219
+
220
+ Tasks run with their client's environment, except that the client does not pass
221
+ ``HYPERSHELL_SERVER_AUTH`` to them, and takes that name out of
222
+ ``OMPI_MCA_mca_base_env_list`` (keeping any other names, and dropping the variable if none
223
+ is left). The client runs the shell commands of ``{% %}`` template patterns, once per
224
+ task, with that same environment. So, whatever the launch mode, neither a task's
225
+ environment nor a ``{% %}`` command's holds the key or the Open MPI entry the launch set,
226
+ unless the configuration gives it explicitly. This keeps the key out of an environment
227
+ that a task dumps or logs by accident. It does not hide the key from task code that looks
228
+ for it: a task runs as the same user as its client, and that user can generally read the
229
+ client's environment. This applies to clients from this release on; an older client under
230
+ a newer launcher still passes its environment to its tasks unchanged.
231
+
232
+ A task can be given the key in two explicit ways:
233
+
234
+ * An ``[export]`` entry for ``HYPERSHELL_SERVER_AUTH`` (or a
235
+ ``HYPERSHELL_EXPORT_HYPERSHELL_SERVER_AUTH`` variable) hands every task a key the
236
+ operator holds, such as the key of a hand-started ``hs server``. Its values are taken
237
+ literally, so it cannot carry the key an ``hs cluster`` run mints, which no one is shown.
238
+ * A ``{= =}`` lambda pattern is Python evaluated, with ``os`` exposed, in the process that
239
+ expands the template, so ``os.environ`` there is that process's own environment. For a
240
+ client that ``hs cluster`` starts as a process of its own (through a launcher, ``--mpi``,
241
+ ``--ssh`` or autoscaling), that includes ``HYPERSHELL_SERVER_AUTH``; under the default
242
+ local mode it holds the variable only if the environment that started ``hs cluster`` set
243
+ it (see :ref:`templates <templates>`). A template that reads it does so on purpose.
244
+
245
+ A task that runs a nested ``hs cluster`` needs neither: that run mints its own key for
246
+ its own server and clients.
247
+
248
+ A directly configured ``server.auth`` is stored in plaintext in the config file and printed
180
249
  verbatim by ``hs config get``; prefer the ``_eval`` / ``_env`` suffixes (see below) to
181
250
  keep the secret out of the file.
182
251
 
@@ -426,6 +495,57 @@ and audit ``authorized_keys`` for unexpected entries.
426
495
 
427
496
  -------------------
428
497
 
498
+ Relays
499
+ ------
500
+
501
+ |
502
+
503
+ A relay (``hs relay``, see :ref:`cli_relay`) joins a site to an upstream *server* across a wide-area
504
+ network. It is a *client* upstream and a *server* at its site, so it stands between two
505
+ authentication domains, and each keeps its own key.
506
+
507
+ * **Upstream.** The relay authenticates to the upstream *server* with the upstream key, read from
508
+ ``[relay.upstream]`` (``auth``, or its ``auth_env`` and ``auth_eval`` forms), never from
509
+ ``[server]`` and never from the relay's command line: there is no upstream ``-k`` option. The
510
+ connection uses TLS, configured by ``[relay.upstream.tls]`` alone, so the site keeps the relay's
511
+ own ``[server.tls]``. Across a wide-area hop, verify the upstream *server*: give
512
+ ``relay.upstream.tls.cafile`` (a certificate authority, or the upstream *server*'s own
513
+ certificate) or pin its ``relay.upstream.tls.fingerprint``. ``--no-tls`` turns TLS off on this
514
+ hop only, with a warning; do not use it outside a trusted network.
515
+
516
+ * **At the site.** The relay-local *server* mints a fresh key for each run, as an autoscaling
517
+ ``hs cluster`` does, and hands it to each site *client* in its environment
518
+ (``HYPERSHELL_SERVER_AUTH``), never on its command line, as described under
519
+ *How cluster launches hand the key to their clients* above. The launcher must pass the
520
+ environment through. A site *client* passes that key to none of its tasks.
521
+
522
+ * **The upstream key stays in the relay process.** Site *clients* inherit the relay's environment,
523
+ and tasks their *client*'s, so before the first site *client* starts the relay removes from its own
524
+ environment every relay setting (``HYPERSHELL_RELAY_*``) and every variable whose name or value
525
+ holds the upstream key. When ``HYPERSHELL_CONFIG_FILE`` names a file with relay settings or the key
526
+ in it, the site is given a copy without them (readable by its owner only, beside the relay
527
+ database, and removed when the relay ends; a relay ended by SIGKILL, or by a second SIGTERM while
528
+ it ends, leaves it behind, and the next relay on that database writes over it). The relay refuses
529
+ to start if a site *client*'s command line (launcher, launcher arguments or template), or a
530
+ variable exported to tasks (``[export]``), would carry the upstream key. This holds for every zone
531
+ a relay serves: each zone's *clients* are launched the same way.
532
+
533
+ * **What the fence cannot cover.** It governs what the relay hands on: command lines and
534
+ environments. A site *client* on a host that reads the same user or system configuration file as
535
+ the relay reads whatever ``[relay.upstream]`` holds there. Keep a literal upstream key out of a
536
+ shared configuration file: use ``auth_env`` or ``auth_eval``, or give the relay a configuration
537
+ file of its own through ``HYPERSHELL_CONFIG_FILE``.
538
+
539
+ * **The roster.** A relay lists its site *clients* upstream by id and host only. Upstream they are
540
+ attributed to the relay's site and the relay; a roster never claims a *client* of another relay.
541
+
542
+ A relay keeps its own SQLite database (see :ref:`database`); it holds the tasks the relay received
543
+ and their results until they are handed back, so protect it as you would the task database.
544
+
545
+ |
546
+
547
+ -------------------
548
+
429
549
  Deployment Guides
430
550
  -----------------
431
551
 
@@ -828,7 +948,7 @@ Independent of the deployment style above:
828
948
  * **Enable audit logging.** Set ``logging.style = "detailed"`` (or ``"system"``) and ship
829
949
  logs to a central collector. The server logs every client connection, every task
830
950
  dispatched, and every completion. See :ref:`logging <logging>` for details. The
831
- per-invocation auth key is redacted from launch logs, but avoid shipping full configuration
951
+ per-invocation auth key never appears in launch logs, but avoid shipping full configuration
832
952
  dumps (which contain a directly-set ``server.auth``) to shared log infrastructure.
833
953
 
834
954
  * **Sanitize task input.** When generating tasks programmatically, treat the command
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "hypershell"
3
- version = "2.9.0a4"
3
+ version = "2.9.0a6"
4
4
  description = "A cross-platform, high-throughput computing utility for processing shell commands over a distributed, asynchronous queue."
5
5
  readme = "README.rst"
6
6
  license = "Apache-2.0"