2018-08-28 14:52:18 +00:00
|
|
|
# Copyright 2018 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# Recipe which generates the Gold images for lottie-web using docker
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
'checkout',
|
2020-07-01 18:16:44 +00:00
|
|
|
'docker',
|
2019-01-22 23:09:30 +00:00
|
|
|
'env',
|
2018-08-28 14:52:18 +00:00
|
|
|
'infra',
|
|
|
|
'recipe_engine/file',
|
|
|
|
'recipe_engine/path',
|
|
|
|
'recipe_engine/properties',
|
|
|
|
'recipe_engine/step',
|
|
|
|
'run',
|
|
|
|
'vars',
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2018-09-04 21:00:17 +00:00
|
|
|
DOCKER_IMAGE = 'gcr.io/skia-public/gold-lottie-web-puppeteer:v2'
|
2020-07-01 18:16:44 +00:00
|
|
|
LOTTIECAP_SCRIPT = 'skia/infra/lottiecap/docker/lottiecap_gold.sh'
|
2018-08-28 14:52:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
|
|
|
api.vars.setup()
|
2019-11-05 15:08:23 +00:00
|
|
|
checkout_root = api.path['start_dir']
|
2018-08-28 14:52:18 +00:00
|
|
|
out_dir = api.vars.swarming_out_dir
|
2020-07-31 18:50:39 +00:00
|
|
|
lottie_files_src = api.vars.workdir.join('lottie-samples')
|
2018-08-28 14:52:18 +00:00
|
|
|
lottie_files_dir = '/tmp/lottie_files'
|
2018-09-04 21:00:17 +00:00
|
|
|
# The lottie-web repo is DEP'd in. This links to its build directory
|
|
|
|
# to make finding the lottie.min.js easier to reference from inside
|
|
|
|
# the docker image.
|
|
|
|
lottie_build = checkout_root.join('lottie', 'build', 'player')
|
|
|
|
|
2018-08-28 14:52:18 +00:00
|
|
|
# Make sure this exists, otherwise Docker will make it with root permissions.
|
2021-03-25 13:04:43 +00:00
|
|
|
api.file.ensure_directory('mkdirs out_dir', out_dir, mode=0o777)
|
2018-08-28 14:52:18 +00:00
|
|
|
# When lottie files are brought in via isolate or CIPD, they are just
|
|
|
|
# symlinks, which does not work well with Docker because we can't mount
|
|
|
|
# the folder as a volume.
|
|
|
|
# e.g. /LOTTIE_FILES/foo.json -> ../.cipd/alpha/beta/foo.json
|
|
|
|
# To get around this, we just copy the lottie files into a temporary
|
|
|
|
# directory.
|
|
|
|
api.file.rmtree('remove previous lottie files', lottie_files_dir)
|
|
|
|
api.file.copytree('copy lottie files', lottie_files_src, lottie_files_dir)
|
|
|
|
|
2020-07-01 18:16:44 +00:00
|
|
|
recursive_read = [lottie_build, lottie_files_dir]
|
|
|
|
|
|
|
|
docker_args = [
|
|
|
|
'--mount',
|
2020-07-06 18:23:57 +00:00
|
|
|
'type=bind,source=%s,target=/LOTTIE_BUILD' % lottie_build,
|
2020-07-01 18:16:44 +00:00
|
|
|
'--mount',
|
2020-07-06 18:23:57 +00:00
|
|
|
'type=bind,source=%s,target=/LOTTIE_FILES' % lottie_files_dir
|
2020-07-01 18:16:44 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
args = [
|
|
|
|
'--builder', api.vars.builder_name,
|
|
|
|
'--git_hash', api.properties['revision'],
|
|
|
|
'--buildbucket_build_id', api.properties.get('buildbucket_build_id',
|
|
|
|
''),
|
|
|
|
'--bot_id', api.vars.swarming_bot_id,
|
|
|
|
'--task_id', api.vars.swarming_task_id,
|
|
|
|
'--browser', 'Chrome',
|
|
|
|
'--config', api.vars.configuration,
|
|
|
|
]
|
2018-08-28 14:52:18 +00:00
|
|
|
|
|
|
|
if api.vars.is_trybot:
|
2020-07-01 18:16:44 +00:00
|
|
|
args.extend([
|
2018-08-28 14:52:18 +00:00
|
|
|
'--issue', api.vars.issue,
|
|
|
|
'--patchset', api.vars.patchset,
|
|
|
|
'--patch_storage', api.vars.patch_storage,
|
|
|
|
])
|
|
|
|
|
2020-07-01 18:16:44 +00:00
|
|
|
api.docker.run(
|
|
|
|
name='Generate LottieWeb Gold output with Docker',
|
|
|
|
docker_image=DOCKER_IMAGE,
|
|
|
|
src_dir=checkout_root,
|
|
|
|
out_dir=out_dir,
|
|
|
|
script=checkout_root.join(LOTTIECAP_SCRIPT),
|
|
|
|
args=args,
|
|
|
|
docker_args=docker_args,
|
|
|
|
recursive_read=recursive_read,
|
|
|
|
attempts=3,
|
|
|
|
)
|
2018-08-28 14:52:18 +00:00
|
|
|
|
|
|
|
|
|
|
|
def GenTests(api):
|
|
|
|
yield (
|
2020-04-07 01:27:14 +00:00
|
|
|
api.test('Test-Debian10-none-GCE-CPU-AVX2-x86_64-Debug-All-LottieWeb') +
|
|
|
|
api.properties(buildername=('Test-Debian10-none-GCE-CPU-AVX2'
|
2018-08-28 14:52:18 +00:00
|
|
|
'-x86_64-Debug-All-LottieWeb'),
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]')
|
|
|
|
)
|
|
|
|
|
|
|
|
yield (
|
|
|
|
api.test('lottie_web_trybot') +
|
2020-04-07 01:27:14 +00:00
|
|
|
api.properties(buildername=('Test-Debian10-none-GCE-CPU-AVX2'
|
2018-08-28 14:52:18 +00:00
|
|
|
'-x86_64-Debug-All-LottieWeb'),
|
|
|
|
repository='https://skia.googlesource.com/skia.git',
|
|
|
|
revision='abc123',
|
|
|
|
path_config='kitchen',
|
|
|
|
swarm_out_dir='[SWARM_OUT_DIR]',
|
2018-09-12 18:39:34 +00:00
|
|
|
patch_ref='89/456789/12',
|
|
|
|
patch_repo='https://skia.googlesource.com/skia.git',
|
2018-08-28 14:52:18 +00:00
|
|
|
patch_storage='gerrit',
|
|
|
|
patch_set=7,
|
|
|
|
patch_issue=1234,
|
|
|
|
gerrit_project='skia',
|
|
|
|
gerrit_url='https://skia-review.googlesource.com/')
|
|
|
|
)
|