Bug 1266039 - Generate release promotion specific docker images as a part of release promotion process r=Callek a=release DONTBUILD
authorRail Aliiev <rail@mozilla.com>
Wed, 20 Apr 2016 17:03:09 -0400
changeset 332073 9e0834bfce332e669f3a82414221c97822773345
parent 332072 279dfae6682ff32bf6dfdc77546702d2999481db
child 332074 5177d7cdb97fb0616b27a877047c4f08a67e5fdc
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCallek, release
bugs1266039
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266039 - Generate release promotion specific docker images as a part of release promotion process r=Callek a=release DONTBUILD MozReview-Commit-ID: 89FYuMZYb6a
release/docker/beet-mover/Dockerfile
release/docker/funsize-update-generator/Dockerfile
release/docker/funsize-update-generator/runme.sh
release/docker/funsize-update-generator/scripts/funsize.py
--- a/release/docker/beet-mover/Dockerfile
+++ b/release/docker/beet-mover/Dockerfile
@@ -13,9 +13,10 @@ RUN apt-get -q update \
     clamav \
     clamav-freshclam \
     curl \
     wget \
     && apt-get clean
 
 COPY requirements.txt /tmp/
 RUN pip install -r /tmp/requirements.txt
-RUN freshclam --verbose
+# Freshclam may be flaky, retry if it fails
+RUN for i in 1 2 3 4 5; do freshclam --verbose && break || sleep 15; done
--- a/release/docker/funsize-update-generator/Dockerfile
+++ b/release/docker/funsize-update-generator/Dockerfile
@@ -19,14 +19,15 @@ RUN pip install -r /tmp/requirements.txt
 
 # scripts
 RUN mkdir /home/worker/bin
 COPY scripts/* /home/worker/bin/
 COPY runme.sh /runme.sh
 RUN chmod 755 /home/worker/bin/* /runme.sh
 RUN mkdir /home/worker/keys
 COPY *.pubkey /home/worker/keys/
-RUN freshclam --verbose
+# Freshclam may be flaky, retry if it fails
+RUN for i in 1 2 3 4 5; do freshclam --verbose && break || sleep 15; done
 
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
 ENV           LOGNAME       worker
--- a/release/docker/funsize-update-generator/runme.sh
+++ b/release/docker/funsize-update-generator/runme.sh
@@ -9,18 +9,17 @@ ARTIFACTS_DIR="/home/worker/artifacts"
 mkdir -p "$ARTIFACTS_DIR"
 
 curl --location --retry 10 --retry-delay 10 -o /home/worker/task.json \
     "https://queue.taskcluster.net/v1/task/$TASK_ID"
 
 # enable locale cache
 export MBSDIFF_HOOK="/home/worker/bin/mbsdiff_hook.sh -c /tmp/fs-cache"
 
-EXTRA_PARAMS=
 if [ ! -z $FILENAME_TEMPLATE ]; then
-    EXTRA_PARAMS="--filename-template $FILENAME_TEMPLATE"
+    EXTRA_PARAMS="--filename-template $FILENAME_TEMPLATE $EXTRA_PARAMS"
 fi
 
 /home/worker/bin/funsize.py \
     --artifacts-dir "$ARTIFACTS_DIR" \
     --task-definition /home/worker/task.json \
     --signing-cert "/home/worker/keys/${SIGNING_CERT}.pubkey" \
     $EXTRA_PARAMS
--- a/release/docker/funsize-update-generator/scripts/funsize.py
+++ b/release/docker/funsize-update-generator/scripts/funsize.py
@@ -165,33 +165,38 @@ def verify_allowed_url(mar):
 def main():
     parser = argparse.ArgumentParser()
     parser.add_argument("--artifacts-dir", required=True)
     parser.add_argument("--signing-cert", required=True)
     parser.add_argument("--task-definition", required=True,
                         type=argparse.FileType('r'))
     parser.add_argument("--filename-template",
                         default=DEFAULT_FILENAME_TEMPLATE)
+    parser.add_argument("--no-freshclam", action="store_true", default=False,
+                        help="Do not refresh ClamAV DB")
     parser.add_argument("-q", "--quiet", dest="log_level",
                         action="store_const", const=logging.WARNING,
                         default=logging.DEBUG)
     args = parser.parse_args()
 
     logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
                         level=args.log_level)
     task = json.load(args.task_definition)
     # TODO: verify task["extra"]["funsize"]["partials"] with jsonschema
 
-    log.info("Refreshing clamav db...")
-    try:
-        redo.retry(lambda:
-                   sh.freshclam("--stdout", "--verbose", _timeout=300, _err_to_out=True))
-        log.info("Done.")
-    except sh.ErrorReturnCode:
-        log.warning("Freshclam failed, skipping DB update")
+    if args.no_freshclam:
+        log.info("Skipping freshclam")
+    else:
+        log.info("Refreshing clamav db...")
+        try:
+            redo.retry(lambda:
+                    sh.freshclam("--stdout", "--verbose", _timeout=300, _err_to_out=True))
+            log.info("Done.")
+        except sh.ErrorReturnCode:
+            log.warning("Freshclam failed, skipping DB update")
     manifest = []
     for e in task["extra"]["funsize"]["partials"]:
         for mar in (e["from_mar"], e["to_mar"]):
             verify_allowed_url(mar)
 
         work_env = WorkEnv()
         # TODO: run setup once
         work_env.setup()