diff options
Diffstat (limited to 'security/nss/automation/taskcluster/graph/src/queue.js')
-rw-r--r-- | security/nss/automation/taskcluster/graph/src/queue.js | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/security/nss/automation/taskcluster/graph/src/queue.js b/security/nss/automation/taskcluster/graph/src/queue.js index 809a17bf1..fd5be2050 100644 --- a/security/nss/automation/taskcluster/graph/src/queue.js +++ b/security/nss/automation/taskcluster/graph/src/queue.js @@ -12,10 +12,12 @@ let maps = []; let filters = []; let tasks = new Map(); +let tags = new Map(); let image_tasks = new Map(); +let parameters = {}; let queue = new taskcluster.Queue({ - baseUrl: "http://taskcluster/queue/v1" + rootUrl: process.env.TASKCLUSTER_PROXY_URL, }); function fromNow(hours) { @@ -94,13 +96,17 @@ function convertTask(def) { let env = merge({ NSS_HEAD_REPOSITORY: process.env.NSS_HEAD_REPOSITORY, - NSS_HEAD_REVISION: process.env.NSS_HEAD_REVISION + NSS_HEAD_REVISION: process.env.NSS_HEAD_REVISION, + NSS_MAX_MP_PBE_ITERATION_COUNT: "100", }, def.env || {}); if (def.parent) { dependencies.push(def.parent); env.TC_PARENT_TASK_ID = def.parent; } + if (def.parents) { + dependencies = dependencies.concat(def.parents); + } if (def.tests) { env.NSS_TESTS = def.tests; @@ -109,6 +115,14 @@ function convertTask(def) { if (def.cycle) { env.NSS_CYCLES = def.cycle; } + if (def.kind === "build") { + // Disable leak checking during builds (bug 1579290). + if (env.ASAN_OPTIONS) { + env.ASAN_OPTIONS += ":detect_leaks=0"; + } else { + env.ASAN_OPTIONS = "detect_leaks=0"; + } + } let payload = { env, @@ -132,16 +146,27 @@ function convertTask(def) { } } + if (def.scopes) { + // Need to add existing scopes in the task definition + scopes.push.apply(scopes, def.scopes) + } + + let extra = Object.assign({ + treeherder: parseTreeherder(def) + }, parameters); + return { - provisionerId: def.provisioner || "aws-provisioner-v1", - workerType: def.workerType || "hg-worker", - schedulerId: "task-graph-scheduler", + provisionerId: def.provisioner || `nss-${process.env.MOZ_SCM_LEVEL}`, + workerType: def.workerType || "linux", + schedulerId: process.env.TC_SCHEDULER_ID, + taskGroupId: process.env.TASK_ID, scopes, created: fromNow(0), deadline: fromNow(24), dependencies, + requires: def.requires || "all-completed", routes: parseRoutes(def.routes || []), metadata: { @@ -152,10 +177,7 @@ function convertTask(def) { }, payload, - - extra: { - treeherder: parseTreeherder(def) - } + extra, }; } @@ -167,6 +189,18 @@ export function filter(fun) { filters.push(fun); } +export function addParameters(params) { + parameters = Object.assign(parameters, params); +} + +export function clearFilters(fun) { + filters = []; +} + +export function taggedTasks(tag) { + return tags[tag]; +} + export function scheduleTask(def) { let taskId = slugid.v4(); tasks.set(taskId, merge({}, def)); @@ -188,6 +222,16 @@ export async function submit() { let log_id = `${task.name} @ ${task.platform}[${task.collection || "opt"}]`; console.log(`+ Submitting ${log_id}.`); + // Index that task for each tag specified + if(task.tags) { + task.tags.map(tag => { + if(!tags[tag]) { + tags[tag] = []; + } + tags[tag].push(taskId); + }); + } + let parent = task.parent; // Convert the task definition. |