Bug 1429954 - Limit docker images retention on try. r?dustin draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 12 Jan 2018 08:06:02 +0900
changeset 719331 55e74b26417f999cee21836e3fa8610d0e7e1c08
parent 718845 4db166f0442dddc5b9011c722d7499501fedf283
child 745768 40a3ed7d65b3c4a91f3524714ed51a4d6e6a3374
push id95227
push userbmo:mh+mozilla@glandium.org
push dateFri, 12 Jan 2018 00:31:14 +0000
reviewersdustin
bugs1429954
milestone59.0a1
Bug 1429954 - Limit docker images retention on try. r?dustin taskcluster/taskgraph/transforms/task.py sets an expiry to 28 days for tasks on try, vs. 1 year on other projects, but only do that when an expiry is not already set, which docker images do. And they do always set to 1 year. But it doesn't make sense to keep large docker images from try for a year. So use the same retention policy as the default one. We /could/ just remove the expiry from docker images and get the task.py default, but it seems like whatever future change might happen to that default shouldn't affect docker images, so it's better to duplicate the setting.
taskcluster/taskgraph/transforms/docker_image.py
--- a/taskcluster/taskgraph/transforms/docker_image.py
+++ b/taskcluster/taskgraph/transforms/docker_image.py
@@ -108,17 +108,17 @@ def fill_template(config, tasks):
         zstd_level = '3' if int(config.params['level']) == 1 else '10'
 
         # include some information that is useful in reconstructing this task
         # from JSON
         taskdesc = {
             'label': 'build-docker-image-' + image_name,
             'description': description,
             'attributes': {'image_name': image_name},
-            'expires-after': '1 year',
+            'expires-after': '28 days' if config.params['project'] == 'try' else '1 year',
             'scopes': ['secrets:get:project/taskcluster/gecko/hgfingerprint'],
             'treeherder': {
                 'symbol': job_symbol,
                 'platform': 'taskcluster-images/opt',
                 'kind': 'other',
                 'tier': 1,
             },
             'run-on-projects': [],