Bug 1334401 - Prefer docker images from higher levels. r=jonasfj

Considering docker images contents depend very much on the moment they
were built, it is possible that two images with the same hash in the
taskcluster index (at different levels) have different contents. When
this happens, the build or test results could be significantly
different between e.g. try and mozilla-central, possibly leading to
misleading results at landing time.

So if for some reason multiple levels have images for the same hash, the
one used at the highest level should be prefered, such that try uses the
same as mozilla-central once mozilla-central generates the image for
that hash, even if there is an image previously generated for try.

--HG--
extra : rebase_source : 57f593a530da02f9f576872404915c26af544688
This commit is contained in:
Mike Hommey 2017-01-27 16:18:02 +09:00
Родитель 6c42afdf6a
Коммит f6f42d4f18
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -87,7 +87,7 @@ class DockerImageTask(base.Task):
# the same image per branch.
index_paths = ['{}.level-{}.{}.hash.{}'.format(
INDEX_PREFIX, level, image_name, context_hash)
for level in range(int(params['level']), 4)]
for level in reversed(range(int(params['level']), 4))]
tasks.append(cls(kind, 'build-docker-image-' + image_name,
task=image_task['task'], attributes=attributes,
@ -128,7 +128,7 @@ class DockerImageTask(base.Task):
context_hash = imgMeta['contextHash']
index_paths = ['{}.level-{}.{}.hash.{}'.format(
INDEX_PREFIX, level, image_name, context_hash)
for level in range(int(imgMeta['level']), 4)]
for level in reversed(range(int(imgMeta['level']), 4))]
docker_image_task = cls(kind='docker-image',
label=task_dict['label'],
attributes=task_dict['attributes'],

Просмотреть файл

@ -28,7 +28,7 @@ class TestTargetTasks(unittest.TestCase):
}
}
index_paths = ["{}.level-{}.<image>.hash.<hash>".format(INDEX_PREFIX, level)
for level in range(1, 4)]
for level in reversed(range(1, 4))]
graph = TaskGraph(tasks={
'a': TransformTask(
kind='fancy',