Upload uncompressed Docker images

Work aronud https://bugzilla.mozilla.org/show_bug.cgi?id=1593543
This commit is contained in:
Simon Sapin 2019-11-03 20:52:44 +01:00
parent 4ad08fff04
commit 5abb013dfd

View file

@ -755,24 +755,24 @@ class DockerWorkerTask(UnixTaskMixin, Task):
.with_index_and_artifacts_expire_in(CONFIG.docker_images_expire_in) .with_index_and_artifacts_expire_in(CONFIG.docker_images_expire_in)
.with_features("dind") .with_features("dind")
.with_env(DOCKERFILE=dockerfile_contents) .with_env(DOCKERFILE=dockerfile_contents)
.with_artifacts("/image.tar.lz4") .with_artifacts("/image.tar")
.with_script(""" .with_script("""
echo "$DOCKERFILE" | docker build -t taskcluster-built - echo "$DOCKERFILE" | docker build -t taskcluster-built -
docker save taskcluster-built | lz4 > /image.tar.lz4 docker save taskcluster-built > /image.tar
""") """)
.with_docker_image( .with_docker_image(
# https://github.com/servo/taskcluster-bootstrap-docker-images#image-builder # https://github.com/servo/taskcluster-bootstrap-docker-images#image-builder
"servobrowser/taskcluster-bootstrap:image-builder@sha256:" \ "servobrowser/taskcluster-bootstrap:image-builder@sha256:" \
"0a7d012ce444d62ffb9e7f06f0c52fedc24b68c2060711b313263367f7272d9d" "0a7d012ce444d62ffb9e7f06f0c52fedc24b68c2060711b313263367f7272d9d"
) )
.find_or_create("docker-image." + digest) .find_or_create("docker-image-uncompressed." + digest)
) )
return self \ return self \
.with_dependencies(image_build_task) \ .with_dependencies(image_build_task) \
.with_docker_image({ .with_docker_image({
"type": "task-image", "type": "task-image",
"path": "public/image.tar.lz4", "path": "public/image.tar",
"taskId": image_build_task, "taskId": image_build_task,
}) })