-
Notifications
You must be signed in to change notification settings - Fork 1
/
FASMLTrainingClientInit.q
43 lines (34 loc) · 1.23 KB
/
FASMLTrainingClientInit.q
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/ select IPC host
hostPort: hsym `renxiang.cloud:5001:foorx:foorxaccess / cloud server
/ hostPort: hsym `localhost:5001:foorx:foorxaccess / local server
/ get directories
qDirectory: get `:qDirectory
dashboardDirectory: get `:dashboardDirectory
flatDir: get `:flatDir
/ start IPC TCP/IP broadcast on port 6001 if not already enabled
\p 6001
/ upgrade HTTP protocol to websocket protocol
.z.ws:{neg[.z.w] -8! @[value;x;{`$ "'",x}]}
system"cd ",qDirectory
/ load embedpy
"Using embedPy release version 1.3.2"
\l p.q
/ load ml toolkit
"Using ML toolkit from commit 51b1995"
/ was using ML toolkit from commit 9f653e8
\l ml/ml.q
.ml.loadfile`:init.q;
"Machine Learning toolkit loaded"
"Q ML Training Client Process running on port 6001 [websocket mode]"
/ switch back to q working folder
system"cd ",dashboardDirectory
/ "Pre-importing Python ML libraries"
\l FASPythonLibraries.q
/ open IPC connection to server
h:hopen hostPort
if[(h>0) and hostPort = hsym `renxiang.cloud:5001; show "Connected to kdb master in cloud!"]
if[(h>0) and hostPort = hsym `localhost:5001; show "Connected to kdb master on localhost!"]
"Enabling immediate mode for Garbage Collection"
\g 1
"Rolling Launch Control Model Trainer Up and Ready"
\ts system"l FASUpdateModels.q"