[infra] gen_tasks: Fix TODOs in usesGit()

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>
This commit is contained in:
Eric Boren 2020-03-09 11:25:43 -04:00 committed by Skia Commit-Bot
parent e65c5fc14c
commit 23899c64e3
3 changed files with 67 additions and 39 deletions

View File

@ -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.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)
if needSync {
b.usesGit()
} else {
b.idempotent()
}
b.swarmDimensions()
if b.extraConfig("Docker", "LottieWeb", "SKQP", "CMake") || b.compiler("EMCC") {
b.usesDocker()
@ -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)
})
}
@ -1125,6 +1125,7 @@ func (b *jobBuilder) checkGeneratedFiles() {
b.asset("clang_linux")
b.asset("ccache_linux")
b.usesCCache()
b.cache(CACHES_WORKDIR...)
})
}
@ -1135,6 +1136,7 @@ func (b *jobBuilder) housekeeper() {
b.serviceAccount(b.cfg.ServiceAccountHousekeeper)
b.linuxGceDimensions(MACHINE_TYPE_SMALL)
b.usesGit()
b.cache(CACHES_WORKDIR...)
})
}
@ -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)

View File

@ -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...)
}

View File

@ -3938,10 +3938,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -5262,10 +5258,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -5350,10 +5342,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -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"
@ -14780,10 +14776,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -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"
@ -15169,6 +15169,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
@ -15246,6 +15254,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
@ -15339,10 +15355,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -15446,10 +15458,6 @@
{
"name": "vpython",
"path": "cache/vpython"
},
{
"name": "work",
"path": "cache/work"
}
],
"cipd_packages": [
@ -15686,6 +15694,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
@ -15758,6 +15774,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [
@ -15831,6 +15855,14 @@
{
"name": "docker",
"path": "cache/docker"
},
{
"name": "git",
"path": "cache/git"
},
{
"name": "git_cache",
"path": "cache/git_cache"
}
],
"cipd_packages": [