Bug 1430037 - Use the in-tree image builder image to build docker images. r=dustin

The image builder image we use to build docker images is updated
manually, and not necessarily when changes occur in tree that should be
reflected by a new image builder image. For instance, its run-task is
currently outdated. Not enough that it's actually a problem, but it
could rapidly become a problem.

There is also a lot of friction when trying to make changes in how
docker images are built, and while last time I tried, I ended up not
being able to do the changes I wanted to make because the docker version
on the host is too old, but this is already the second time I've been
trying to make things better and hit a wall because the the image
builder is essentially fixed in stone on the docker hub.

So with this change, we make all the docker images use the in-tree image
builder image, except itself, obviously. That one uses the last version
that was uploaded. We may want to update it at some point, but not doing
so will only impact building the image builder image itself, not the
other ones.
This commit is contained in:
Mike Hommey
2018-01-11 17:50:00 +09:00
parent be0d77f146
commit 569b17452a
5 changed files with 45 additions and 28 deletions

View File

@@ -831,17 +831,16 @@ def build_docker_worker_payload(config, task, task_def):
}
payload['artifacts'] = artifacts
run_task = payload.get('command', [''])[0].endswith('run-task')
if isinstance(worker.get('docker-image'), basestring):
out_of_tree_image = worker['docker-image']
run_task = run_task or out_of_tree_image.startswith(
'taskcluster/image_builder')
else:
out_of_tree_image = None
run_task = any([
payload.get('command', [''])[0].endswith('run-task'),
# image_builder is special and doesn't get detected like other tasks.
# It uses run-task so it needs our cache manipulations.
(out_of_tree_image or '').startswith('taskcluster/image_builder'),
])
image = worker.get('docker-image', {}).get('in-tree')
run_task = run_task or image == 'image_builder'
if 'caches' in worker:
caches = {}