ominfra 0.0.0.dev135__tar.gz → 0.0.0.dev136__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (120) hide show
  1. {ominfra-0.0.0.dev135/ominfra.egg-info → ominfra-0.0.0.dev136}/PKG-INFO +3 -3
  2. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/_manage.py +22 -11
  3. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/main.py +8 -5
  4. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/pyremote.py +14 -6
  5. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136/ominfra.egg-info}/PKG-INFO +3 -3
  6. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra.egg-info/requires.txt +2 -2
  7. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/pyproject.toml +3 -3
  8. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/LICENSE +0 -0
  9. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/MANIFEST.in +0 -0
  10. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/README.rst +0 -0
  11. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/.manifests.json +0 -0
  12. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/__about__.py +0 -0
  13. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/__init__.py +0 -0
  14. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/__init__.py +0 -0
  15. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/__init__.py +0 -0
  16. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/__main__.py +0 -0
  17. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/auth.py +0 -0
  18. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/cli.py +0 -0
  19. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/dataclasses.py +0 -0
  20. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/__init__.py +0 -0
  21. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/__main__.py +0 -0
  22. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/cursor.py +0 -0
  23. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/driver.py +0 -0
  24. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/main.py +0 -0
  25. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/journald2aws/poster.py +0 -0
  26. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/logs.py +0 -0
  27. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/aws/metadata.py +0 -0
  28. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/gcp/__init__.py +0 -0
  29. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/clouds/gcp/auth.py +0 -0
  30. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/cmds.py +0 -0
  31. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/configs.py +0 -0
  32. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/journald/__init__.py +0 -0
  33. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/journald/fields.py +0 -0
  34. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/journald/genmessages.py +0 -0
  35. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/journald/messages.py +0 -0
  36. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/journald/tailer.py +0 -0
  37. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/__init__.py +0 -0
  38. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/__init__.py +0 -0
  39. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/_executor.py +0 -0
  40. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/configs.py +0 -0
  41. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/__init__.py +0 -0
  42. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/base.py +0 -0
  43. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/__init__.py +0 -0
  44. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/dirs.py +0 -0
  45. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/nginx.py +0 -0
  46. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/repo.py +0 -0
  47. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/supervisor.py +0 -0
  48. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/systemd.py +0 -0
  49. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/user.py +0 -0
  50. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/concerns/venv.py +0 -0
  51. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/executor/main.py +0 -0
  52. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/__init__.py +0 -0
  53. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/_main.py +0 -0
  54. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/base.py +0 -0
  55. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/configs.py +0 -0
  56. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/deploy.py +0 -0
  57. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/main.py +0 -0
  58. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/nginx.py +0 -0
  59. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/repo.py +0 -0
  60. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/runtime.py +0 -0
  61. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/site.py +0 -0
  62. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/supervisor.py +0 -0
  63. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/poly/venv.py +0 -0
  64. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/deploy/remote.py +0 -0
  65. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/manage.py +0 -0
  66. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/__init__.py +0 -0
  67. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/commands/__init__.py +0 -0
  68. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/commands/base.py +0 -0
  69. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/manage/new/commands/subprocess.py +0 -0
  70. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/scripts/__init__.py +0 -0
  71. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/scripts/journald2aws.py +0 -0
  72. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/scripts/supervisor.py +0 -0
  73. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/ssh.py +0 -0
  74. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/LICENSE.txt +0 -0
  75. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/__init__.py +0 -0
  76. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/__main__.py +0 -0
  77. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/configs.py +0 -0
  78. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/dispatchers.py +0 -0
  79. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/dispatchersimpl.py +0 -0
  80. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/events.py +0 -0
  81. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/exceptions.py +0 -0
  82. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/groups.py +0 -0
  83. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/groupsimpl.py +0 -0
  84. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/http.py +0 -0
  85. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/inject.py +0 -0
  86. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/io.py +0 -0
  87. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/main.py +0 -0
  88. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/pipes.py +0 -0
  89. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/privileges.py +0 -0
  90. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/process.py +0 -0
  91. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/processimpl.py +0 -0
  92. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/setup.py +0 -0
  93. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/setupimpl.py +0 -0
  94. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/signals.py +0 -0
  95. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/spawning.py +0 -0
  96. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/spawningimpl.py +0 -0
  97. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/states.py +0 -0
  98. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/supervisor.py +0 -0
  99. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/types.py +0 -0
  100. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/__init__.py +0 -0
  101. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/collections.py +0 -0
  102. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/diag.py +0 -0
  103. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/fds.py +0 -0
  104. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/fs.py +0 -0
  105. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/os.py +0 -0
  106. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/ostypes.py +0 -0
  107. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/signals.py +0 -0
  108. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/strings.py +0 -0
  109. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/supervisor/utils/users.py +0 -0
  110. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/tailscale/__init__.py +0 -0
  111. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/tailscale/api.py +0 -0
  112. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/tailscale/cli.py +0 -0
  113. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/threadworkers.py +0 -0
  114. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/tools/__init__.py +0 -0
  115. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra/tools/listresources.py +0 -0
  116. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra.egg-info/SOURCES.txt +0 -0
  117. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra.egg-info/dependency_links.txt +0 -0
  118. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra.egg-info/entry_points.txt +0 -0
  119. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/ominfra.egg-info/top_level.txt +0 -0
  120. {ominfra-0.0.0.dev135 → ominfra-0.0.0.dev136}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev135
3
+ Version: 0.0.0.dev136
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev135
16
- Requires-Dist: omlish==0.0.0.dev135
15
+ Requires-Dist: omdev==0.0.0.dev136
16
+ Requires-Dist: omlish==0.0.0.dev136
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -87,10 +87,10 @@ Basically this: https://mitogen.networkgenomics.com/howitworks.html
87
87
  ##
88
88
 
89
89
 
90
- _PYREMOTE_BOOTSTRAP_COMM_FD = 100
90
+ _PYREMOTE_BOOTSTRAP_INPUT_FD = 100
91
91
  _PYREMOTE_BOOTSTRAP_SRC_FD = 101
92
92
 
93
- _PYREMOTE_BOOTSTRAP_CHILD_PID_VAR = '_OPYR_CPID'
93
+ _PYREMOTE_BOOTSTRAP_CHILD_PID_VAR = '_OPYR_CHILD_PID'
94
94
  _PYREMOTE_BOOTSTRAP_ARGV0_VAR = '_OPYR_ARGV0'
95
95
 
96
96
  _PYREMOTE_BOOTSTRAP_ACK0 = b'OPYR000\n'
@@ -121,7 +121,7 @@ def _pyremote_bootstrap_main(context_name: str) -> None:
121
121
  # Parent process
122
122
 
123
123
  # Dup original stdin to comm_fd for use as comm channel
124
- os.dup2(0, _PYREMOTE_BOOTSTRAP_COMM_FD)
124
+ os.dup2(0, _PYREMOTE_BOOTSTRAP_INPUT_FD)
125
125
 
126
126
  # Overwrite stdin (fed to python repl) with first copy of src
127
127
  os.dup2(r0, 0)
@@ -179,7 +179,7 @@ def pyremote_build_bootstrap_cmd(context_name: str) -> str:
179
179
  bs_src = textwrap.dedent(inspect.getsource(_pyremote_bootstrap_main))
180
180
 
181
181
  for gl in [
182
- '_PYREMOTE_BOOTSTRAP_COMM_FD',
182
+ '_PYREMOTE_BOOTSTRAP_INPUT_FD',
183
183
  '_PYREMOTE_BOOTSTRAP_SRC_FD',
184
184
 
185
185
  '_PYREMOTE_BOOTSTRAP_CHILD_PID_VAR',
@@ -424,6 +424,7 @@ class PyremoteBootstrapDriver:
424
424
  @dc.dataclass(frozen=True)
425
425
  class PyremotePayloadRuntime:
426
426
  input: ta.BinaryIO
427
+ output: ta.BinaryIO
427
428
  main_src: str
428
429
  env_info: PyremoteEnvInfo
429
430
 
@@ -450,12 +451,19 @@ def pyremote_bootstrap_finalize() -> PyremotePayloadRuntime:
450
451
  os.write(1, struct.pack('<I', len(env_info_json)))
451
452
  os.write(1, env_info_json.encode('utf-8'))
452
453
 
454
+ # Setup IO
455
+ input = os.fdopen(_PYREMOTE_BOOTSTRAP_INPUT_FD, 'rb', 0) # noqa
456
+ output = os.fdopen(os.dup(1), 'wb', 0) # noqa
457
+ os.dup2(nfd := os.open('/dev/null', os.O_WRONLY), 1)
458
+ os.close(nfd)
459
+
453
460
  # Write fourth ack
454
- os.write(1, _PYREMOTE_BOOTSTRAP_ACK3)
461
+ output.write(_PYREMOTE_BOOTSTRAP_ACK3)
455
462
 
456
463
  # Return
457
464
  return PyremotePayloadRuntime(
458
- input=os.fdopen(_PYREMOTE_BOOTSTRAP_COMM_FD, 'rb', 0),
465
+ input=input,
466
+ output=output,
459
467
  main_src=main_src,
460
468
  env_info=env_info,
461
469
  )
@@ -1536,7 +1544,7 @@ def _remote_main() -> None:
1536
1544
 
1537
1545
  o = SubprocessCommand()._execute(i) # noqa
1538
1546
 
1539
- _send_obj(sys.stdout.buffer, o)
1547
+ _send_obj(rt.output, o)
1540
1548
 
1541
1549
 
1542
1550
  def _main() -> None:
@@ -1544,7 +1552,8 @@ def _main() -> None:
1544
1552
 
1545
1553
  parser = argparse.ArgumentParser()
1546
1554
 
1547
- parser.add_argument('--ssh')
1555
+ parser.add_argument('-s', '--shell')
1556
+ parser.add_argument('-q', '--shell-quote', action='store_true')
1548
1557
  parser.add_argument('--python', default='python3')
1549
1558
  parser.add_argument('--_amalg-file')
1550
1559
 
@@ -1582,9 +1591,11 @@ def _main() -> None:
1582
1591
 
1583
1592
  bs_src = pyremote_build_bootstrap_cmd(__package__ or 'manage')
1584
1593
 
1585
- if args.ssh is not None:
1586
- sh_src = ' '.join([args.python, '-c', shlex.quote(bs_src)])
1587
- sh_cmd = f'{args.ssh} {shlex.quote(sh_src)}'
1594
+ if args.shell is not None:
1595
+ sh_src = f'{args.python} -c {shlex.quote(bs_src)}'
1596
+ if args.shell_quote:
1597
+ sh_src = shlex.quote(sh_src)
1598
+ sh_cmd = f'{args.shell} {sh_src}'
1588
1599
  cmd = [sh_cmd]
1589
1600
  shell = True
1590
1601
  else:
@@ -60,7 +60,7 @@ def _remote_main() -> None:
60
60
 
61
61
  o = SubprocessCommand()._execute(i) # noqa
62
62
 
63
- _send_obj(sys.stdout.buffer, o)
63
+ _send_obj(rt.output, o)
64
64
 
65
65
 
66
66
  def _main() -> None:
@@ -68,7 +68,8 @@ def _main() -> None:
68
68
 
69
69
  parser = argparse.ArgumentParser()
70
70
 
71
- parser.add_argument('--ssh')
71
+ parser.add_argument('-s', '--shell')
72
+ parser.add_argument('-q', '--shell-quote', action='store_true')
72
73
  parser.add_argument('--python', default='python3')
73
74
  parser.add_argument('--_amalg-file')
74
75
 
@@ -106,9 +107,11 @@ def _main() -> None:
106
107
 
107
108
  bs_src = pyremote_build_bootstrap_cmd(__package__ or 'manage')
108
109
 
109
- if args.ssh is not None:
110
- sh_src = ' '.join([args.python, '-c', shlex.quote(bs_src)])
111
- sh_cmd = f'{args.ssh} {shlex.quote(sh_src)}'
110
+ if args.shell is not None:
111
+ sh_src = f'{args.python} -c {shlex.quote(bs_src)}'
112
+ if args.shell_quote:
113
+ sh_src = shlex.quote(sh_src)
114
+ sh_cmd = f'{args.shell} {sh_src}'
112
115
  cmd = [sh_cmd]
113
116
  shell = True
114
117
  else:
@@ -21,10 +21,10 @@ import zlib
21
21
  ##
22
22
 
23
23
 
24
- _PYREMOTE_BOOTSTRAP_COMM_FD = 100
24
+ _PYREMOTE_BOOTSTRAP_INPUT_FD = 100
25
25
  _PYREMOTE_BOOTSTRAP_SRC_FD = 101
26
26
 
27
- _PYREMOTE_BOOTSTRAP_CHILD_PID_VAR = '_OPYR_CPID'
27
+ _PYREMOTE_BOOTSTRAP_CHILD_PID_VAR = '_OPYR_CHILD_PID'
28
28
  _PYREMOTE_BOOTSTRAP_ARGV0_VAR = '_OPYR_ARGV0'
29
29
 
30
30
  _PYREMOTE_BOOTSTRAP_ACK0 = b'OPYR000\n'
@@ -55,7 +55,7 @@ def _pyremote_bootstrap_main(context_name: str) -> None:
55
55
  # Parent process
56
56
 
57
57
  # Dup original stdin to comm_fd for use as comm channel
58
- os.dup2(0, _PYREMOTE_BOOTSTRAP_COMM_FD)
58
+ os.dup2(0, _PYREMOTE_BOOTSTRAP_INPUT_FD)
59
59
 
60
60
  # Overwrite stdin (fed to python repl) with first copy of src
61
61
  os.dup2(r0, 0)
@@ -113,7 +113,7 @@ def pyremote_build_bootstrap_cmd(context_name: str) -> str:
113
113
  bs_src = textwrap.dedent(inspect.getsource(_pyremote_bootstrap_main))
114
114
 
115
115
  for gl in [
116
- '_PYREMOTE_BOOTSTRAP_COMM_FD',
116
+ '_PYREMOTE_BOOTSTRAP_INPUT_FD',
117
117
  '_PYREMOTE_BOOTSTRAP_SRC_FD',
118
118
 
119
119
  '_PYREMOTE_BOOTSTRAP_CHILD_PID_VAR',
@@ -358,6 +358,7 @@ class PyremoteBootstrapDriver:
358
358
  @dc.dataclass(frozen=True)
359
359
  class PyremotePayloadRuntime:
360
360
  input: ta.BinaryIO
361
+ output: ta.BinaryIO
361
362
  main_src: str
362
363
  env_info: PyremoteEnvInfo
363
364
 
@@ -384,12 +385,19 @@ def pyremote_bootstrap_finalize() -> PyremotePayloadRuntime:
384
385
  os.write(1, struct.pack('<I', len(env_info_json)))
385
386
  os.write(1, env_info_json.encode('utf-8'))
386
387
 
388
+ # Setup IO
389
+ input = os.fdopen(_PYREMOTE_BOOTSTRAP_INPUT_FD, 'rb', 0) # noqa
390
+ output = os.fdopen(os.dup(1), 'wb', 0) # noqa
391
+ os.dup2(nfd := os.open('/dev/null', os.O_WRONLY), 1)
392
+ os.close(nfd)
393
+
387
394
  # Write fourth ack
388
- os.write(1, _PYREMOTE_BOOTSTRAP_ACK3)
395
+ output.write(_PYREMOTE_BOOTSTRAP_ACK3)
389
396
 
390
397
  # Return
391
398
  return PyremotePayloadRuntime(
392
- input=os.fdopen(_PYREMOTE_BOOTSTRAP_COMM_FD, 'rb', 0),
399
+ input=input,
400
+ output=output,
393
401
  main_src=main_src,
394
402
  env_info=env_info,
395
403
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ominfra
3
- Version: 0.0.0.dev135
3
+ Version: 0.0.0.dev136
4
4
  Summary: ominfra
5
5
  Author: wrmsr
6
6
  License: BSD-3-Clause
@@ -12,8 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Classifier: Operating System :: POSIX
13
13
  Requires-Python: >=3.12
14
14
  License-File: LICENSE
15
- Requires-Dist: omdev==0.0.0.dev135
16
- Requires-Dist: omlish==0.0.0.dev135
15
+ Requires-Dist: omdev==0.0.0.dev136
16
+ Requires-Dist: omlish==0.0.0.dev136
17
17
  Provides-Extra: all
18
18
  Requires-Dist: paramiko~=3.5; extra == "all"
19
19
  Requires-Dist: asyncssh~=2.18; extra == "all"
@@ -1,5 +1,5 @@
1
- omdev==0.0.0.dev135
2
- omlish==0.0.0.dev135
1
+ omdev==0.0.0.dev136
2
+ omlish==0.0.0.dev136
3
3
 
4
4
  [all]
5
5
  paramiko~=3.5
@@ -12,7 +12,7 @@ authors = [
12
12
  urls = {source = 'https://github.com/wrmsr/omlish'}
13
13
  license = {text = 'BSD-3-Clause'}
14
14
  requires-python = '>=3.12'
15
- version = '0.0.0.dev135'
15
+ version = '0.0.0.dev136'
16
16
  classifiers = [
17
17
  'License :: OSI Approved :: BSD License',
18
18
  'Development Status :: 2 - Pre-Alpha',
@@ -22,8 +22,8 @@ classifiers = [
22
22
  ]
23
23
  description = 'ominfra'
24
24
  dependencies = [
25
- 'omdev == 0.0.0.dev135',
26
- 'omlish == 0.0.0.dev135',
25
+ 'omdev == 0.0.0.dev136',
26
+ 'omlish == 0.0.0.dev136',
27
27
  ]
28
28
 
29
29
  [project.optional-dependencies]
File without changes
File without changes