Skip to content

Commit c7a6dd3

Browse files
authored
feat: add native runtime spawner (#501)
1 parent d4e6703 commit c7a6dd3

File tree

16 files changed

+445
-353
lines changed

16 files changed

+445
-353
lines changed

apps/runtime/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "runtime",
2+
"name": "@codepod/runtime",
33
"version": "1.0.0",
4-
"main": "index.js",
4+
"main": "src/index.ts",
55
"license": "MIT",
66
"scripts": {
77
"build": "tsc",
8-
"start": "node build/server.js",
9-
"dev": "ts-node-dev src/server.ts",
8+
"start": "node build/run.js",
9+
"dev": "ts-node-dev src/run.ts",
1010
"test": "jest --config jest.config.js"
1111
},
1212
"dependencies": {

apps/runtime/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./server";

apps/runtime/src/kernel.ts

Lines changed: 0 additions & 292 deletions
This file was deleted.

apps/runtime/src/run.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { KernelSpec, startServer } from "./server";
2+
3+
let host = process.env.ZMQ_HOST;
4+
if (!host) {
5+
throw Error("ZMQ_HOST not set");
6+
}
7+
8+
let spec: KernelSpec = {
9+
shell_port: 55692,
10+
iopub_port: 55693,
11+
stdin_port: 55694,
12+
control_port: 55695,
13+
hb_port: 55696,
14+
// ip: "0.0.0.0",
15+
ip: host,
16+
key: "",
17+
transport: "tcp",
18+
kernel_name: "",
19+
};
20+
21+
startServer({ spec, port: 4020 });

0 commit comments

Comments
 (0)