MCPcopy
hub / github.com/NVIDIA/aistore / RestoreNode

Function RestoreNode

devtools/tutils/node.go:377–390  ·  view source on GitHub ↗
(cmd RestoreCmd, asPrimary bool, tag string)

Source from the content-addressed store, hash-verified

375}
376
377func RestoreNode(cmd RestoreCmd, asPrimary bool, tag string) error {
378 if docker.IsRunning() {
379 tlog.Logf("Restarting %s container %s\n", tag, cmd)
380 return docker.Restart(cmd.Node.ID())
381 }
382
383 if !cos.AnyHasPrefixInSlice("-daemon_id", cmd.Args) {
384 cmd.Args = append(cmd.Args, "-daemon_id="+cmd.Node.ID())
385 }
386
387 tlog.Logf("Restoring %s: %s %+v\n", tag, cmd.Cmd, cmd.Args)
388 _, err := startNode(cmd.Cmd, cmd.Args, asPrimary)
389 return err
390}
391
392func startNode(cmd string, args []string, asPrimary bool) (pid int, err error) {
393 ncmd := exec.Command(cmd, args...)

Callers 15

TestConfigSyncToNewNodeFunction · 0.92
killRestorePrimaryFunction · 0.92
killRestoreDiffIPFunction · 0.92
primaryAndTargetCrashFunction · 0.92
proxyCrashFunction · 0.92
primaryAndProxyCrashFunction · 0.92
targetRejoinFunction · 0.92
crashAndFastRestoreFunction · 0.92
primaryAndNextCrashFunction · 0.92
icMemberLeaveAndRejoinFunction · 0.92

Calls 6

IsRunningFunction · 0.92
LogfFunction · 0.92
RestartFunction · 0.92
AnyHasPrefixInSliceFunction · 0.92
startNodeFunction · 0.85
IDMethod · 0.65

Tested by 15

TestConfigSyncToNewNodeFunction · 0.74
killRestorePrimaryFunction · 0.74
killRestoreDiffIPFunction · 0.74
primaryAndTargetCrashFunction · 0.74
proxyCrashFunction · 0.74
primaryAndProxyCrashFunction · 0.74
targetRejoinFunction · 0.74
crashAndFastRestoreFunction · 0.74
primaryAndNextCrashFunction · 0.74
icMemberLeaveAndRejoinFunction · 0.74