зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1651538 - Relabel docker images with the prefix "docker-image" instead of "build-docker-image". r=tomprince
Differential Revision: https://phabricator.services.mozilla.com/D82807
This commit is contained in:
Родитель
22dbe9a21d
Коммит
93b282a460
|
@ -192,7 +192,7 @@ Tasks of the ``docker-image`` kind build the Docker images in which other
|
|||
Docker tasks run.
|
||||
|
||||
The tasks to generate each docker image have predictable labels:
|
||||
``build-docker-image-<name>``.
|
||||
``docker-image-<name>``.
|
||||
|
||||
Docker images are built from subdirectories of ``taskcluster/docker``, using
|
||||
``docker build``. There is currently no capability for one Docker image to
|
||||
|
|
|
@ -25,7 +25,7 @@ from . import GECKO
|
|||
def load_image_by_name(image_name, tag=None):
|
||||
params = {'level': six.ensure_text(os.environ.get('MOZ_SCM_LEVEL', '3'))}
|
||||
tasks = load_tasks_for_kind(params, 'docker-image')
|
||||
task = tasks['build-docker-image-{}'.format(image_name)]
|
||||
task = tasks['docker-image-{}'.format(image_name)]
|
||||
task_id = IndexSearch().should_replace_task(
|
||||
task, {}, task.optimization.get('index-search', []))
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ def derive_misc_task(
|
|||
|
||||
# this is why all docker image tasks are included in the target task graph: we
|
||||
# need to find them in label_to_taskid, even if nothing else required them
|
||||
image_taskid = label_to_taskid["build-docker-image-" + image]
|
||||
image_taskid = label_to_taskid["docker-image-" + image]
|
||||
|
||||
provisioner_id, worker_type = get_worker_type(
|
||||
graph_config, "misc", parameters["level"], parameters.release_level()
|
||||
|
|
|
@ -18,7 +18,7 @@ class Task(object):
|
|||
- task: the task definition (JSON-able dictionary)
|
||||
- optimization: optimization to apply to the task (see taskgraph.optimize)
|
||||
- dependencies: tasks this one depends on, in the form {name: label}, for example
|
||||
{'build': 'build-linux64/opt', 'docker-image': 'build-docker-image-desktop-test'}
|
||||
{'build': 'build-linux64/opt', 'docker-image': 'docker-image-desktop-test'}
|
||||
- soft_dependencies: tasks this one may depend on if they are available post
|
||||
optimisation. They are set as a list of tasks label.
|
||||
- if_dependencies: only run this task if at least one of these dependencies
|
||||
|
@ -54,8 +54,6 @@ class Task(object):
|
|||
def name(self):
|
||||
if self.label.startswith(self.kind + "-"):
|
||||
return self.label[len(self.kind)+1:]
|
||||
elif self.label.startswith("build-docker-image-"):
|
||||
return self.label[len("build-docker-image-"):]
|
||||
else:
|
||||
raise AttributeError("Task {} does not have a name.".format(self.label))
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ def test_make_index_tasks(make_taskgraph, graph_config):
|
|||
},
|
||||
}
|
||||
task = Task(kind='test', label='a', attributes={}, task=task_def)
|
||||
docker_task = Task(kind='docker-image', label='build-docker-image-index-task',
|
||||
docker_task = Task(kind='docker-image', label='docker-image-index-task',
|
||||
attributes={}, task={})
|
||||
taskgraph, label_to_taskid = make_taskgraph({
|
||||
task.label: task,
|
||||
|
|
|
@ -14,10 +14,7 @@ transforms = TransformSequence()
|
|||
|
||||
def order_tasks(config, tasks):
|
||||
"""Iterate image tasks in an order where parent tasks come first."""
|
||||
if config.kind == 'docker-image':
|
||||
kind_prefix = 'build-docker-image-'
|
||||
else:
|
||||
kind_prefix = config.kind + '-'
|
||||
kind_prefix = config.kind + '-'
|
||||
|
||||
pending = deque(tasks)
|
||||
task_labels = {task['label'] for task in pending}
|
||||
|
|
|
@ -138,7 +138,7 @@ def fill_template(config, tasks):
|
|||
# include some information that is useful in reconstructing this task
|
||||
# from JSON
|
||||
taskdesc = {
|
||||
'label': 'build-docker-image-' + image_name,
|
||||
'label': '{}-{}'.format(config.kind, image_name),
|
||||
'description': description,
|
||||
'attributes': {
|
||||
'image_name': image_name,
|
||||
|
@ -191,7 +191,7 @@ def fill_template(config, tasks):
|
|||
else:
|
||||
worker['docker-image'] = {'in-tree': 'image_builder'}
|
||||
deps = taskdesc.setdefault('dependencies', {})
|
||||
deps['docker-image'] = 'build-docker-image-image_builder'
|
||||
deps['docker-image'] = '{}-image_builder'.format(config.kind)
|
||||
|
||||
if packages:
|
||||
deps = taskdesc.setdefault('dependencies', {})
|
||||
|
@ -200,7 +200,7 @@ def fill_template(config, tasks):
|
|||
|
||||
if parent:
|
||||
deps = taskdesc.setdefault('dependencies', {})
|
||||
deps['parent'] = 'build-docker-image-{}'.format(parent)
|
||||
deps['parent'] = '{}-{}'.format(config.kind, parent)
|
||||
worker['env']['PARENT_TASK_ID'] = {
|
||||
'task-reference': '<parent>',
|
||||
}
|
||||
|
|
|
@ -448,7 +448,7 @@ def build_docker_worker_payload(config, task, task_def):
|
|||
if isinstance(image, dict):
|
||||
if 'in-tree' in image:
|
||||
name = image['in-tree']
|
||||
docker_image_task = 'build-docker-image-' + image['in-tree']
|
||||
docker_image_task = 'docker-image-' + image['in-tree']
|
||||
task.setdefault('dependencies', {})['docker-image'] = docker_image_task
|
||||
|
||||
image = {
|
||||
|
|
Загрузка…
Ссылка в новой задаче