[infra] Use Swarming task ID for logdog URL
... as opposed to Skia Task Scheduler ID. The latter causes the command to be different at every task invocation, which prevents deduplication. Use the Swarming task ID from the environment instead. Change-Id: Ied59bb0a0f45570f425cccd5ed707bfdd550893c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/223976 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
This commit is contained in:
parent
838c8f65ca
commit
080fbade12
@ -249,7 +249,7 @@ func project() string {
|
||||
|
||||
// Build the LogDog annotation URL.
|
||||
func logdogAnnotationUrl() string {
|
||||
return fmt.Sprintf("logdog://logs.chromium.org/%s/%s/+/annotations", project(), specs.PLACEHOLDER_TASK_ID)
|
||||
return fmt.Sprintf("logdog://logs.chromium.org/%s/${SWARMING_TASK_ID}/+/annotations", project())
|
||||
}
|
||||
|
||||
// Create a properties JSON string.
|
||||
@ -296,6 +296,7 @@ func kitchenTask(name, recipe, isolate, serviceAccount string, dimensions []stri
|
||||
if outputDir != OUTPUT_NONE {
|
||||
outputs = []string{outputDir}
|
||||
}
|
||||
python := "cipd_bin_packages/vpython${EXECUTABLE_SUFFIX}"
|
||||
task := &specs.TaskSpec{
|
||||
Caches: []*specs.Cache{
|
||||
&specs.Cache{
|
||||
@ -304,28 +305,7 @@ func kitchenTask(name, recipe, isolate, serviceAccount string, dimensions []stri
|
||||
},
|
||||
},
|
||||
CipdPackages: cipd,
|
||||
Command: []string{
|
||||
"./kitchen${EXECUTABLE_SUFFIX}", "cook",
|
||||
"-checkout-dir", "recipe_bundle",
|
||||
"-mode", "swarming",
|
||||
"-luci-system-account", "system",
|
||||
"-cache-dir", "cache",
|
||||
"-temp-dir", "tmp",
|
||||
"-known-gerrit-host", "android.googlesource.com",
|
||||
"-known-gerrit-host", "boringssl.googlesource.com",
|
||||
"-known-gerrit-host", "chromium.googlesource.com",
|
||||
"-known-gerrit-host", "dart.googlesource.com",
|
||||
"-known-gerrit-host", "fuchsia.googlesource.com",
|
||||
"-known-gerrit-host", "go.googlesource.com",
|
||||
"-known-gerrit-host", "llvm.googlesource.com",
|
||||
"-known-gerrit-host", "skia.googlesource.com",
|
||||
"-known-gerrit-host", "webrtc.googlesource.com",
|
||||
"-output-result-json", "${ISOLATED_OUTDIR}/build_result_filename",
|
||||
"-workdir", ".",
|
||||
"-recipe", recipe,
|
||||
"-properties", props(properties),
|
||||
"-logdog-annotation-url", logdogAnnotationUrl(),
|
||||
},
|
||||
Command: []string{python, "skia/infra/bots/run_recipe.py", "${ISOLATED_OUTDIR}", recipe, props(properties), project()},
|
||||
Dependencies: []string{BUNDLE_RECIPES_NAME},
|
||||
Dimensions: dimensions,
|
||||
EnvPrefixes: map[string][]string{
|
||||
@ -1342,7 +1322,7 @@ func presubmit(b *specs.TasksCfgBuilder, name string) string {
|
||||
}
|
||||
// Use MACHINE_TYPE_LARGE because it seems to save time versus MEDIUM and we want presubmit to be
|
||||
// fast.
|
||||
task := kitchenTask(name, "run_presubmit", "empty.isolate", SERVICE_ACCOUNT_COMPILE, linuxGceDimensions(MACHINE_TYPE_LARGE), extraProps, OUTPUT_NONE)
|
||||
task := kitchenTask(name, "run_presubmit", "run_recipe.isolate", SERVICE_ACCOUNT_COMPILE, linuxGceDimensions(MACHINE_TYPE_LARGE), extraProps, OUTPUT_NONE)
|
||||
usesGit(task, name)
|
||||
task.CipdPackages = append(task.CipdPackages, &specs.CipdPackage{
|
||||
Name: "infra/recipe_bundles/chromium.googlesource.com/chromium/tools/build",
|
||||
|
8
infra/bots/run_recipe.isolate
Normal file
8
infra/bots/run_recipe.isolate
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
'variables': {
|
||||
'files': [
|
||||
'../../../.gclient',
|
||||
'run_recipe.py',
|
||||
],
|
||||
},
|
||||
}
|
41
infra/bots/run_recipe.py
Executable file
41
infra/bots/run_recipe.py
Executable file
@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# Copyright 2018 Google LLC
|
||||
#
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
kitchen = os.path.join(os.getcwd(), 'kitchen')
|
||||
logdog_url = 'logdog://logs.chromium.org/%s/%s/+/annotations' % (
|
||||
sys.argv[4], os.environ['SWARMING_TASK_ID'])
|
||||
|
||||
cmd = [
|
||||
kitchen, 'cook',
|
||||
'-checkout-dir', 'recipe_bundle',
|
||||
'-mode', 'swarming',
|
||||
'-luci-system-account', 'system',
|
||||
'-cache-dir', 'cache',
|
||||
'-temp-dir', 'tmp',
|
||||
'-known-gerrit-host', 'android.googlesource.com',
|
||||
'-known-gerrit-host', 'boringssl.googlesource.com',
|
||||
'-known-gerrit-host', 'chromium.googlesource.com',
|
||||
'-known-gerrit-host', 'dart.googlesource.com',
|
||||
'-known-gerrit-host', 'fuchsia.googlesource.com',
|
||||
'-known-gerrit-host', 'go.googlesource.com',
|
||||
'-known-gerrit-host', 'llvm.googlesource.com',
|
||||
'-known-gerrit-host', 'skia.googlesource.com',
|
||||
'-known-gerrit-host', 'webrtc.googlesource.com',
|
||||
'-output-result-json', os.path.join(sys.argv[1], 'build_result_filename'),
|
||||
'-workdir', '.',
|
||||
'-recipe', sys.argv[2],
|
||||
'-properties', sys.argv[3],
|
||||
'-logdog-annotation-url', logdog_url,
|
||||
]
|
||||
print 'running command: %s' % ' '.join(cmd)
|
||||
subprocess.check_call(cmd)
|
@ -6,6 +6,7 @@
|
||||
'files': [
|
||||
'../../../.gclient',
|
||||
'../config/recipes.cfg',
|
||||
'run_recipe.py',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
47346
infra/bots/tasks.json
47346
infra/bots/tasks.json
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user