pinokiod 1.2.21 → 1.2.23
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.
- package/kernel/api/index.js +46 -36
- package/kernel/shell.js +14 -0
- package/package.json +1 -1
- package/server/index.js +6 -0
package/kernel/api/index.js
CHANGED
|
@@ -575,6 +575,50 @@ class Api {
|
|
|
575
575
|
rpc.next = null
|
|
576
576
|
}
|
|
577
577
|
|
|
578
|
+
if (rpc.hasOwnProperty("when")) {
|
|
579
|
+
console.log("rpc.when", { rpc })
|
|
580
|
+
// if rpc.when is false, don't run this and go to the next step
|
|
581
|
+
if (!rpc.when) {
|
|
582
|
+
if (typeof rpc.next === "undefined" || rpc.next === null) {
|
|
583
|
+
// last call
|
|
584
|
+
if (script.daemon) {
|
|
585
|
+
this.ondata({
|
|
586
|
+
id: request.path,
|
|
587
|
+
type: "start",
|
|
588
|
+
data: {
|
|
589
|
+
title: "Started",
|
|
590
|
+
description: "All scripts finished running. Running in daemon mode..."
|
|
591
|
+
}
|
|
592
|
+
})
|
|
593
|
+
} else {
|
|
594
|
+
// no next rpc to execute. Finish
|
|
595
|
+
this.kernel.memory.local[request.path] = {}
|
|
596
|
+
this.ondata({
|
|
597
|
+
id: request.path,
|
|
598
|
+
type: "event",
|
|
599
|
+
data: "stop",
|
|
600
|
+
rpc,
|
|
601
|
+
rawrpc
|
|
602
|
+
})
|
|
603
|
+
await this.stop({
|
|
604
|
+
params: {
|
|
605
|
+
uri: request.path
|
|
606
|
+
}
|
|
607
|
+
})
|
|
608
|
+
}
|
|
609
|
+
return
|
|
610
|
+
} else {
|
|
611
|
+
// still ongoing
|
|
612
|
+
let next_rpc = script.run[rpc.next]
|
|
613
|
+
console.log("NEXT RPC", next_rpc, i, rpc.next)
|
|
614
|
+
if (next_rpc) {
|
|
615
|
+
return { request, rawrpc: next_rpc, input: null, step: rpc.next, total: script.run.length }
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
|
|
578
622
|
try {
|
|
579
623
|
this.ondata({
|
|
580
624
|
id: request.path,
|
|
@@ -724,42 +768,8 @@ class Api {
|
|
|
724
768
|
|
|
725
769
|
} else {
|
|
726
770
|
// still going
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
let next_rpc = script.run[i]
|
|
730
|
-
console.log("NEXT RPC", next_rpc)
|
|
731
|
-
if (next_rpc) {
|
|
732
|
-
return { request, rawrpc: next_rpc, input: result, step: i, total: script.run.length }
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
// if all the steps are null, end.
|
|
737
|
-
if (script.daemon) {
|
|
738
|
-
this.ondata({
|
|
739
|
-
id: request.path,
|
|
740
|
-
type: "start",
|
|
741
|
-
data: {
|
|
742
|
-
title: "Started",
|
|
743
|
-
description: "All scripts finished running. Running in daemon mode..."
|
|
744
|
-
}
|
|
745
|
-
})
|
|
746
|
-
} else {
|
|
747
|
-
// no next rpc to execute. Finish
|
|
748
|
-
this.kernel.memory.local[request.path] = {}
|
|
749
|
-
this.ondata({
|
|
750
|
-
id: request.path,
|
|
751
|
-
type: "event",
|
|
752
|
-
data: "stop",
|
|
753
|
-
rpc,
|
|
754
|
-
rawrpc
|
|
755
|
-
})
|
|
756
|
-
await this.stop({
|
|
757
|
-
params: {
|
|
758
|
-
uri: request.path
|
|
759
|
-
}
|
|
760
|
-
})
|
|
761
|
-
}
|
|
762
|
-
//return { request, rawrpc: next_rpc, input: result, step: rpc.next, total: script.run.length }
|
|
771
|
+
let next_rpc = script.run[rpc.next]
|
|
772
|
+
return { request, rawrpc: next_rpc, input: result, step: rpc.next, total: script.run.length }
|
|
763
773
|
}
|
|
764
774
|
|
|
765
775
|
} catch (e) {
|
package/kernel/shell.js
CHANGED
|
@@ -100,6 +100,13 @@ class Shell {
|
|
|
100
100
|
if (this.env.CMAKE_GENERATOR) {
|
|
101
101
|
delete this.env.CMAKE_GENERATOR
|
|
102
102
|
}
|
|
103
|
+
|
|
104
|
+
if (this.env.CUDA_HOME) {
|
|
105
|
+
delete this.env.CUDA_HOME
|
|
106
|
+
}
|
|
107
|
+
if (this.env.CUDA_PATH) {
|
|
108
|
+
delete this.env.CUDA_PATH
|
|
109
|
+
}
|
|
103
110
|
|
|
104
111
|
this.env.CMAKE_OBJECT_PATH_MAX = 1024
|
|
105
112
|
|
|
@@ -185,6 +192,13 @@ class Shell {
|
|
|
185
192
|
}
|
|
186
193
|
}
|
|
187
194
|
|
|
195
|
+
|
|
196
|
+
if (params["-env"] && Array.isArray(params["-env"])) {
|
|
197
|
+
for(let key of params["-env"]) {
|
|
198
|
+
delete this.env[key]
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
188
202
|
// 3. path => path can be http, relative, absolute
|
|
189
203
|
this.path = params.path
|
|
190
204
|
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -297,6 +297,9 @@ class Server {
|
|
|
297
297
|
args: "-c conda-forge"
|
|
298
298
|
}, {
|
|
299
299
|
name: "py"
|
|
300
|
+
}, {
|
|
301
|
+
gpu: "nvidia",
|
|
302
|
+
name: "cuda"
|
|
300
303
|
}]
|
|
301
304
|
let platform = os.platform()
|
|
302
305
|
if (platform === "win32") {
|
|
@@ -551,6 +554,9 @@ class Server {
|
|
|
551
554
|
args: "-c conda-forge"
|
|
552
555
|
}, {
|
|
553
556
|
name: "py"
|
|
557
|
+
}, {
|
|
558
|
+
gpu: "nvidia",
|
|
559
|
+
name: "cuda"
|
|
554
560
|
}]
|
|
555
561
|
let platform = os.platform()
|
|
556
562
|
if (platform === "win32") {
|