Skip to content

Commit 57109e2

Browse files
amirafzalifacebook-github-bot
authored andcommitted
Back out "monarch_env: use main_function for -allocator target" (#25)
Summary: Original commit changeset: c26e2dc498f5 Original Phabricator Diff: D74718068 Reviewed By: dcci Differential Revision: D75181087
1 parent 2b3f2c6 commit 57109e2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/monarch/bootstrap_main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,16 @@
1414
import sys
1515

1616

17-
def invoke_main():
17+
async def main():
18+
await bootstrap_main()
19+
20+
21+
def invoke_main() -> None:
1822
# if this is invoked with the stdout piped somewhere, then print
1923
# changes its buffering behavior. So we default to the standard
2024
# behavior of std out as if it were a terminal.
2125
sys.stdout.reconfigure(line_buffering=True)
26+
global bootstrap_main
2227
# TODO: figure out what from worker_main.py we should reproduce here.
2328
from monarch._rust_bindings.monarch_hyperactor.bootstrap import bootstrap_main
2429

@@ -30,8 +35,9 @@ def invoke_main():
3035
# fallback to using local py-spy
3136

3237
# Start an event loop for PythonActors to use.
33-
asyncio.run(bootstrap_main())
38+
asyncio.run(main())
3439

3540

3641
if __name__ == "__main__":
42+
# Do not add code here, it won't be run. Add them to the function called below.
3743
invoke_main() # pragma: no cover

0 commit comments

Comments
 (0)