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

Side by Side Diff: infra/bots/gen_tasks.go

Issue 2410843002: Recipe fixes to support try jobs in task scheduler (Closed)
Patch Set: Fix recipe simulation Created 4 years, 2 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 /* 7 /*
8 Generate the tasks.json file. 8 Generate the tasks.json file.
9 */ 9 */
10 10
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 pkgs = append(pkgs, getCipdPackage("win_vulkan_sdk")) 239 pkgs = append(pkgs, getCipdPackage("win_vulkan_sdk"))
240 } 240 }
241 } 241 }
242 242
243 // Add the task. 243 // Add the task.
244 cfg.Tasks[name] = &specs.TaskSpec{ 244 cfg.Tasks[name] = &specs.TaskSpec{
245 CipdPackages: pkgs, 245 CipdPackages: pkgs,
246 Dimensions: swarmDimensions(parts), 246 Dimensions: swarmDimensions(parts),
247 ExtraArgs: []string{ 247 ExtraArgs: []string{
248 "--workdir", "../../..", "swarm_compile", 248 "--workdir", "../../..", "swarm_compile",
249 "repository=skia",
249 fmt.Sprintf("buildername=%s", name), 250 fmt.Sprintf("buildername=%s", name),
250 "mastername=fake-master", 251 "mastername=fake-master",
251 "buildnumber=2", 252 "buildnumber=2",
252 "slavename=fake-buildslave", 253 "slavename=fake-buildslave",
254 "nobuildbot=True",
253 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR), 255 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR),
254 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), 256 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
257 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_ STORAGE),
258 fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp ecs.PLACEHOLDER_CODEREVIEW_SERVER),
259 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE),
260 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET),
255 }, 261 },
256 Isolate: "compile_skia.isolate", 262 Isolate: "compile_skia.isolate",
257 Priority: 0.8, 263 Priority: 0.8,
258 } 264 }
259 return name 265 return name
260 } 266 }
261 267
262 // recreateSKPs generates a RecreateSKPs task. Returns the name of the last 268 // recreateSKPs generates a RecreateSKPs task. Returns the name of the last
263 // task in the generated chain of tasks, which the Job should add as a 269 // task in the generated chain of tasks, which the Job should add as a
264 // dependency. 270 // dependency.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 307
302 // test generates a Test task. Returns the name of the last task in the 308 // test generates a Test task. Returns the name of the last task in the
303 // generated chain of tasks, which the Job should add as a dependency. 309 // generated chain of tasks, which the Job should add as a dependency.
304 func test(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask Name string, pkgs []*specs.CipdPackage) string { 310 func test(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask Name string, pkgs []*specs.CipdPackage) string {
305 cfg.Tasks[name] = &specs.TaskSpec{ 311 cfg.Tasks[name] = &specs.TaskSpec{
306 CipdPackages: pkgs, 312 CipdPackages: pkgs,
307 Dependencies: []string{compileTaskName}, 313 Dependencies: []string{compileTaskName},
308 Dimensions: swarmDimensions(parts), 314 Dimensions: swarmDimensions(parts),
309 ExtraArgs: []string{ 315 ExtraArgs: []string{
310 "--workdir", "../../..", "swarm_test", 316 "--workdir", "../../..", "swarm_test",
317 "repository=skia",
311 fmt.Sprintf("buildername=%s", name), 318 fmt.Sprintf("buildername=%s", name),
312 "mastername=fake-master", 319 "mastername=fake-master",
313 "buildnumber=2", 320 "buildnumber=2",
314 "slavename=fake-buildslave", 321 "slavename=fake-buildslave",
322 "nobuildbot=True",
315 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR), 323 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR),
316 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), 324 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
325 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_ STORAGE),
326 fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp ecs.PLACEHOLDER_CODEREVIEW_SERVER),
327 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE),
328 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET),
317 }, 329 },
318 Isolate: "test_skia.isolate", 330 Isolate: "test_skia.isolate",
319 Priority: 0.8, 331 Priority: 0.8,
320 } 332 }
321 // Upload results if necessary. 333 // Upload results if necessary.
322 if doUpload(name) { 334 if doUpload(name) {
323 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema .Sep, name) 335 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema .Sep, name)
324 cfg.Tasks[uploadName] = &specs.TaskSpec{ 336 cfg.Tasks[uploadName] = &specs.TaskSpec{
325 Dependencies: []string{name}, 337 Dependencies: []string{name},
326 Dimensions: UPLOAD_DIMENSIONS, 338 Dimensions: UPLOAD_DIMENSIONS,
327 ExtraArgs: []string{ 339 ExtraArgs: []string{
328 "--workdir", "../../..", "upload_dm_results", 340 "--workdir", "../../..", "upload_dm_results",
341 "repository=skia",
329 fmt.Sprintf("buildername=%s", name), 342 fmt.Sprintf("buildername=%s", name),
330 "mastername=fake-master", 343 "mastername=fake-master",
331 "buildnumber=2", 344 "buildnumber=2",
332 "slavename=fake-buildslave", 345 "slavename=fake-buildslave",
346 "nobuildbot=True",
333 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE R_ISOLATED_OUTDIR), 347 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE R_ISOLATED_OUTDIR),
334 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV ISION), 348 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV ISION),
349 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE R_PATCH_STORAGE),
350 fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STO RAGE, specs.PLACEHOLDER_CODEREVIEW_SERVER),
351 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE) ,
352 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT CHSET),
335 }, 353 },
336 Isolate: "upload_dm_results.isolate", 354 Isolate: "upload_dm_results.isolate",
337 Priority: 0.8, 355 Priority: 0.8,
338 } 356 }
339 return uploadName 357 return uploadName
340 } 358 }
341 return name 359 return name
342 } 360 }
343 361
344 // perf generates a Perf task. Returns the name of the last task in the 362 // perf generates a Perf task. Returns the name of the last task in the
345 // generated chain of tasks, which the Job should add as a dependency. 363 // generated chain of tasks, which the Job should add as a dependency.
346 func perf(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask Name string, pkgs []*specs.CipdPackage) string { 364 func perf(cfg *specs.TasksCfg, name string, parts map[string]string, compileTask Name string, pkgs []*specs.CipdPackage) string {
347 cfg.Tasks[name] = &specs.TaskSpec{ 365 cfg.Tasks[name] = &specs.TaskSpec{
348 CipdPackages: pkgs, 366 CipdPackages: pkgs,
349 Dependencies: []string{compileTaskName}, 367 Dependencies: []string{compileTaskName},
350 Dimensions: swarmDimensions(parts), 368 Dimensions: swarmDimensions(parts),
351 ExtraArgs: []string{ 369 ExtraArgs: []string{
352 "--workdir", "../../..", "swarm_perf", 370 "--workdir", "../../..", "swarm_perf",
371 "repository=skia",
353 fmt.Sprintf("buildername=%s", name), 372 fmt.Sprintf("buildername=%s", name),
354 "mastername=fake-master", 373 "mastername=fake-master",
355 "buildnumber=2", 374 "buildnumber=2",
356 "slavename=fake-buildslave", 375 "slavename=fake-buildslave",
376 "nobuildbot=True",
357 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR), 377 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDER_ISOLAT ED_OUTDIR),
358 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION), 378 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REVISION),
379 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDER_PATCH_ STORAGE),
380 fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STORAGE, sp ecs.PLACEHOLDER_CODEREVIEW_SERVER),
381 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE),
382 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PATCHSET),
359 }, 383 },
360 Isolate: "perf_skia.isolate", 384 Isolate: "perf_skia.isolate",
361 Priority: 0.8, 385 Priority: 0.8,
362 } 386 }
363 // Upload results if necessary. 387 // Upload results if necessary.
364 if strings.Contains(name, "Release") && doUpload(name) { 388 if strings.Contains(name, "Release") && doUpload(name) {
365 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema .Sep, name) 389 uploadName := fmt.Sprintf("%s%s%s", PREFIX_UPLOAD, jobNameSchema .Sep, name)
366 cfg.Tasks[uploadName] = &specs.TaskSpec{ 390 cfg.Tasks[uploadName] = &specs.TaskSpec{
367 Dependencies: []string{name}, 391 Dependencies: []string{name},
368 Dimensions: UPLOAD_DIMENSIONS, 392 Dimensions: UPLOAD_DIMENSIONS,
369 ExtraArgs: []string{ 393 ExtraArgs: []string{
370 "--workdir", "../../..", "upload_nano_results", 394 "--workdir", "../../..", "upload_nano_results",
395 "repository=skia",
371 fmt.Sprintf("buildername=%s", name), 396 fmt.Sprintf("buildername=%s", name),
372 "mastername=fake-master", 397 "mastername=fake-master",
373 "buildnumber=2", 398 "buildnumber=2",
374 "slavename=fake-buildslave", 399 "slavename=fake-buildslave",
400 "nobuildbot=True",
375 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE R_ISOLATED_OUTDIR), 401 fmt.Sprintf("swarm_out_dir=%s", specs.PLACEHOLDE R_ISOLATED_OUTDIR),
376 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV ISION), 402 fmt.Sprintf("revision=%s", specs.PLACEHOLDER_REV ISION),
403 fmt.Sprintf("patch_storage=%s", specs.PLACEHOLDE R_PATCH_STORAGE),
404 fmt.Sprintf("%s=%s", specs.PLACEHOLDER_PATCH_STO RAGE, specs.PLACEHOLDER_CODEREVIEW_SERVER),
405 fmt.Sprintf("issue=%s", specs.PLACEHOLDER_ISSUE) ,
406 fmt.Sprintf("patchset=%s", specs.PLACEHOLDER_PAT CHSET),
377 }, 407 },
378 Isolate: "upload_nano_results.isolate", 408 Isolate: "upload_nano_results.isolate",
379 Priority: 0.8, 409 Priority: 0.8,
380 } 410 }
381 return uploadName 411 return uploadName
382 } 412 }
383 return name 413 return name
384 } 414 }
385 415
386 // process generates tasks and jobs for the given job name. 416 // process generates tasks and jobs for the given job name.
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 if !ok { 626 if !ok {
597 return "", fmt.Errorf("Invalid job parts; missing %q", k ) 627 return "", fmt.Errorf("Invalid job parts; missing %q", k )
598 } 628 }
599 rvParts = append(rvParts, v) 629 rvParts = append(rvParts, v)
600 } 630 }
601 if _, ok := parts["extra_config"]; ok { 631 if _, ok := parts["extra_config"]; ok {
602 rvParts = append(rvParts, parts["extra_config"]) 632 rvParts = append(rvParts, parts["extra_config"])
603 } 633 }
604 return strings.Join(rvParts, s.Sep), nil 634 return strings.Join(rvParts, s.Sep), nil
605 } 635 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698