Skip to content

Commit

Permalink
inferserver| ipc part fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong committed Nov 16, 2019
1 parent bffe02a commit 9ee29f3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions cmd/cortex/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,8 @@ func makeFullNode(ctx *cli.Context) *node.Node {
log.Info("makeFullNode", "storageEnabled", storageEnabled)
utils.RegisterStorageService(stack, &cfg.TorrentFs, gitCommit)
}
var wg sync.WaitGroup
if deviceType := utils.IsCVMIPC(ctx.GlobalString(utils.InferDeviceTypeFlag.Name)); deviceType != "" {
wg.Add(1)
go func() {
defer wg.Done()
cmd := os.Args[0]
log.Info("RegisterCVMService", "cmd", cmd)
args := []string{"cvm",
Expand All @@ -198,30 +195,29 @@ func makeFullNode(ctx *cli.Context) *node.Node {
if err := prg.Start(); err != nil {
panic(err)
}
log.Info("Cvm service register success", "config", cfg)
run_result := prg.Start()
var wg sync.WaitGroup
wg.Add(2)
wg.Add(1)
go func() {
defer wg.Done()
_, _ = io.Copy(stdout, stdoutIn)
}()
wg.Add(1)
go func() {
defer wg.Done()
_, _ = io.Copy(stderr, stderrIn)
}()
//wg.Wait()

wg.Wait()
if err := prg.Wait(); err != nil {
log.Error("RegisterCVMService", "err", err)
}
log.Debug("RegisterCVMService", "deviceType", deviceType, "Exited", run_result)
// outStr, errStr := string(stdoutBuf.Bytes()), string(stderrBuf.Bytes())
// log.Debug("RegisterCVMService", "out", outStr, "err", errStr)
}()
wg.Wait()
//time.Sleep(10000 * time.Millisecond)
}
wg.Wait()

utils.RegisterCortexService(stack, &cfg.Cortex)

// if ctx.GlobalBool(utils.DashboardEnabledFlag.Name) {
Expand Down

0 comments on commit 9ee29f3

Please sign in to comment.