MCPcopy
hub / github.com/ricklamers/gpt-code-ui / start_kernel_manager

Function start_kernel_manager

gpt_code_ui/kernel_program/main.py:50–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48CORS(app)
49
50def start_kernel_manager():
51 global kernel_manager_process
52
53 kernel_manager_script_path = os.path.join(
54 pathlib.Path(__file__).parent.resolve(), "kernel_manager.py"
55 )
56 kernel_manager_process = subprocess.Popen(
57 [sys.executable, kernel_manager_script_path]
58 )
59
60 # Write PID as <pid>.pid to config.KERNEL_PID_DIR
61 os.makedirs(config.KERNEL_PID_DIR, exist_ok=True)
62 with open(os.path.join(config.KERNEL_PID_DIR, "%d.pid" % kernel_manager_process.pid), "w") as p:
63 p.write("kernel_manager")
64
65def cleanup_kernel_program():
66 kernel_manager.cleanup_spawned_processes()

Callers 2

handle_restartFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected