MCPcopy
hub / github.com/dgraph-io/dgraph / StartAlphas

Function StartAlphas

testutil/bulk.go:159–183  ·  view source on GitHub ↗
(compose string)

Source from the content-addressed store, hash-verified

157}
158
159func StartAlphas(compose string) error {
160 composeArgs := ComposeArgs(compose)
161 cmd := exec.Command("docker", append([]string{"compose", "--compatibility"},
162 append(composeArgs, "-p", DockerPrefix, "up", "-d", "--force-recreate")...)...)
163 cmd.Env = append(os.Environ(), EnvForCompose()...)
164
165 fmt.Println("Starting alphas with: ", cmd.String())
166
167 if out, err := cmd.CombinedOutput(); err != nil {
168 fmt.Printf("Error while bringing up alpha node. Prefix: %s. Error: %v\n", DockerPrefix, err)
169 fmt.Printf("Output %v\n", string(out))
170 return err
171 }
172
173 for i := 1; i <= 6; i++ {
174 in := GetContainerInstance(DockerPrefix, "alpha"+strconv.Itoa(i))
175 err := in.BestEffortWaitForHealthy(8080)
176 if err != nil {
177 fmt.Printf("Error while checking alpha health %s. Error %v", in.Name, err)
178 return err
179 }
180 }
181
182 return nil
183}
184
185func StopAlphasForCoverage(composeFile string) {
186 composeArgs := ComposeArgs(composeFile)

Callers 4

setupMethod · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92
TestMainFunction · 0.92

Calls 3

GetContainerInstanceFunction · 0.85
StringMethod · 0.45

Tested by 3

TestMainFunction · 0.74
TestMainFunction · 0.74
TestMainFunction · 0.74