Skip to content

Commit

Permalink
Bug 1266039 - Generate release promotion specific docker images as a …
Browse files Browse the repository at this point in the history
…part of release promotion process r=Callek a=release DONTBUILD

MozReview-Commit-ID: 89FYuMZYb6a
  • Loading branch information
Rail Aliiev committed Apr 20, 2016
1 parent b4a3ac5 commit 19b6dfd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion release/docker/beet-mover/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ RUN apt-get -q update \

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
3 changes: 2 additions & 1 deletion release/docker/funsize-update-generator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ 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
Expand Down
3 changes: 1 addition & 2 deletions release/docker/funsize-update-generator/runme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ curl --location --retry 10 --retry-delay 10 -o /home/worker/task.json \
# 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 \
Expand Down
19 changes: 12 additions & 7 deletions release/docker/funsize-update-generator/scripts/funsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ def main():
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)
Expand All @@ -180,13 +182,16 @@ def main():
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"]):
Expand Down

0 comments on commit 19b6dfd

Please sign in to comment.