bug 1389260 - split by max # of locales per chunk. fix nightly l10n. r=bustage a=merge

MozReview-Commit-ID: Z4fW5rugEP

--HG--
extra : source : d60f3724f1a79d903f888d5053dcecef8a16e5ba
This commit is contained in:
Aki Sasaki 2017-08-10 17:25:46 -07:00
parent 1dfa5bfe06
commit 6a2f68f35c
2 changed files with 10 additions and 12 deletions

View File

@ -29,11 +29,9 @@ job-template:
by-build-platform:
default: browser/locales/all-locales
android-api-15-nightly: mobile/locales/l10n-changesets.json
chunks:
locales-per-chunk:
by-build-platform:
macosx64-nightly: 8
win.*: 10
default: 6
default: 5
run-on-projects: ['release']
ignore-locales:
by-build-platform:

View File

@ -112,8 +112,8 @@ l10n_description_schema = Schema({
# Extra environment values to pass to the worker
Optional('env'): _by_platform({basestring: taskref_or_string}),
# Number of chunks to split the locale repacks up into
Optional('chunks'): _by_platform(int),
# Max number locales per chunk
Optional('locales-per-chunk'): _by_platform(int),
# Task deps to chain this task with, added in transforms from dependent-task
# if this is a nightly
@ -229,7 +229,7 @@ def handle_keyed_by(config, jobs):
"""Resolve fields that can be keyed by platform, etc."""
fields = [
"locales-file",
"chunks",
"locales-per-chunk",
"worker-type",
"description",
"run-time",
@ -271,12 +271,12 @@ def all_locales_attribute(config, jobs):
def chunk_locales(config, jobs):
""" Utilizes chunking for l10n stuff """
for job in jobs:
chunks = job.get('chunks')
locales_per_chunk = job.get('locales-per-chunk')
locales_with_changesets = job['attributes']['all_locales_with_changesets']
if chunks:
if chunks > len(locales_with_changesets):
# Reduce chunks down to the number of locales
chunks = len(locales_with_changesets)
if locales_per_chunk:
chunks, remainder = divmod(len(locales_with_changesets), locales_per_chunk)
if remainder:
chunks = int(chunks + 1)
for this_chunk in range(1, chunks + 1):
chunked = copy.deepcopy(job)
chunked['name'] = chunked['name'].replace(