Skip to content

Commit

Permalink
[infra] gen_tasks: Fix TODOs in usesGit()
Browse files Browse the repository at this point in the history
This removes the "work" cache from tasks which should not need it, and
adds the "git" cache to all tasks which use Git.

Change-Id: Ie3e5e964d77db44db869030ba195a50e27b75e70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275996
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
  • Loading branch information
erock2112 authored and Skia Commit-Bot committed Mar 9, 2020
1 parent e65c5fc commit 23899c6
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 39 deletions.
17 changes: 10 additions & 7 deletions infra/bots/gen_tasks_logic/gen_tasks_logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1012,21 +1012,20 @@ func (b *jobBuilder) compile() string {
recipe := "compile"
isolate := "compile.isolate"
var props map[string]string
needSync := false
if b.extraConfig("NoDEPS", "CMake", "CommandBuffer", "Flutter", "SKQP") {
recipe = "sync_and_compile"
isolate = "swarm_recipe.isolate"
props = EXTRA_PROPS
needSync = true
}
b.kitchenTask(recipe, props, OUTPUT_BUILD)
b.isolate(isolate)
b.serviceAccount(b.cfg.ServiceAccountCompile)
if needSync {
b.usesGit()
if !b.extraConfig("NoDEPS") {
b.cache(CACHES_WORKDIR...)
}
} else {
b.idempotent()
}
b.kitchenTask(recipe, props, OUTPUT_BUILD)
b.isolate(isolate)
b.serviceAccount(b.cfg.ServiceAccountCompile)
b.swarmDimensions()
if b.extraConfig("Docker", "LottieWeb", "SKQP", "CMake") || b.compiler("EMCC") {
b.usesDocker()
Expand Down Expand Up @@ -1110,6 +1109,7 @@ func (b *jobBuilder) recreateSKPs() {
fmt.Sprintf("os:%s", DEFAULT_OS_LINUX_GCE),
)
b.usesGo()
b.cache(CACHES_WORKDIR...)
b.timeout(4 * time.Hour)
})
}
Expand All @@ -1125,6 +1125,7 @@ func (b *jobBuilder) checkGeneratedFiles() {
b.asset("clang_linux")
b.asset("ccache_linux")
b.usesCCache()
b.cache(CACHES_WORKDIR...)
})
}

Expand All @@ -1135,6 +1136,7 @@ func (b *jobBuilder) housekeeper() {
b.serviceAccount(b.cfg.ServiceAccountHousekeeper)
b.linuxGceDimensions(MACHINE_TYPE_SMALL)
b.usesGit()
b.cache(CACHES_WORKDIR...)
})
}

Expand Down Expand Up @@ -1207,6 +1209,7 @@ func (b *jobBuilder) buildstats() {
b.linuxGceDimensions(MACHINE_TYPE_MEDIUM)
b.usesDocker()
b.usesGit()
b.cache(CACHES_WORKDIR...)
})
// Upload release results (for tracking in perf)
// We have some jobs that are FYI (e.g. Debug-CanvasKit, tree-map generator)
Expand Down
9 changes: 1 addition & 8 deletions infra/bots/gen_tasks_logic/task_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,7 @@ func (b *taskBuilder) usesCCache() {

// usesGit adds attributes to tasks which use git.
func (b *taskBuilder) usesGit() {
// TODO(borenet): Why aren't these tasks using the Git cache?
if !b.extraConfig("UpdateGoDeps", "BuildTaskDrivers", "CreateDockerImage", "PushAppsFromSkiaDockerImage", "PushAppsFromSkiaWASMDockerImages", "PushAppsFromWASMDockerImage") {
b.cache(CACHES_GIT...)
// TODO(borenet): Move this conditional into compile().
if !b.extraConfig("NoDEPS") {
b.cache(CACHES_WORKDIR...)
}
}
b.cache(CACHES_GIT...)
b.cipd(specs.CIPD_PKGS_GIT...)
}

Expand Down
80 changes: 56 additions & 24 deletions infra/bots/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3938,10 +3938,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -5262,10 +5258,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -5350,10 +5342,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -14685,6 +14673,14 @@
},
"Housekeeper-Nightly-UpdateGoDeps": {
"caches": [
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
},
{
"name": "go_cache",
"path": "cache/go_cache"
Expand Down Expand Up @@ -14780,10 +14776,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -14947,6 +14939,14 @@
},
"Housekeeper-PerCommit-BuildTaskDrivers": {
"caches": [
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
},
{
"name": "go_cache",
"path": "cache/go_cache"
Expand Down Expand Up @@ -15169,6 +15169,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15246,6 +15254,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15339,10 +15355,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15446,10 +15458,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15686,6 +15694,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15758,6 +15774,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
Expand Down Expand Up @@ -15831,6 +15855,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
Expand Down

0 comments on commit 23899c6

Please sign in to comment.