Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(224)

Side by Side Diff: ct/go/worker_scripts/worker_common/worker_common.go

Issue 1988133002: Use swarming in capture_archives CT task and capture archives in parallel (Closed) Base URL: https://skia.googlesource.com/buildbot@ct-4-create_pagesets
Patch Set: Try 10 per machine and no parallelism Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 Common initialization for worker scripts. 2 Common initialization for worker scripts.
3 */ 3 */
4 4
5 package worker_common 5 package worker_common
6 6
7 import ( 7 import (
8 "flag" 8 "flag"
9 "os"
10
11 "github.com/skia-dev/glog"
9 12
10 "go.skia.org/infra/ct/go/util" 13 "go.skia.org/infra/ct/go/util"
11 "go.skia.org/infra/go/common" 14 "go.skia.org/infra/go/common"
15 "go.skia.org/infra/go/exec"
12 ) 16 )
13 17
14 var ( 18 var (
15 Local = flag.Bool("local", false, "Running locally if true. As opposed t o in production.") 19 Local = flag.Bool("local", false, "Running locally if true. As opposed t o in production.")
16 ) 20 )
17 21
18 func Init() { 22 func Init() {
19 common.Init() 23 common.Init()
20 if *Local { 24 if *Local {
21 util.SetVarsForLocal() 25 util.SetVarsForLocal()
26 } else {
27 // Add depot_tools to the PATH.
28 os.Setenv("PATH", os.Getenv("PATH")+":"+util.DepotToolsDir)
29 // Bring up Xvfb on workers (for GCE instances).
30 if _, _, err := exec.RunIndefinitely(&exec.Command{
31 Name: "sudo",
32 Args: []string{"Xvfb", ":0", "-screen", "0", "128 0x1024x24"},
33 Env: []string{},
34 InheritPath: true,
35 Timeout: util.XVFB_TIMEOUT,
36 LogStdout: true,
37 Stdout: nil,
38 LogStderr: true,
39 Stderr: nil,
40 }); err != nil {
41 // CT's baremetal machines will already have an active d isplay 0.
42 glog.Infof("Could not run Xvfb on Display 0: %s", err)
43 }
22 } 44 }
23 } 45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698