Skip to content

Commit

Permalink
Run lottie-web Gold collection at ToT
Browse files Browse the repository at this point in the history
Bug: skia:
NOTRY: true
Change-Id: I02d3b8753c0b855b84a20dfbeb68778b1e169fde
Reviewed-on: https://skia-review.googlesource.com/151545
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
  • Loading branch information
kjlubick authored and Skia Commit-Bot committed Sep 5, 2018
1 parent 9478f7a commit d0f0cb8
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@
"cmd": [
"python",
"-u",
"\nimport os\nimport sys\n\nlottie_files_dir = sys.argv[1]\nout_dir = sys.argv[2]\n\n# Make sure all the lottie files are readable by everyone so we can see\n# them in the docker container.\nos.system('chmod 0644 %s/*' % lottie_files_dir)\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\n# This typically means that the non-privileged docker won't be able to write.\nos.chmod(out_dir, 0o777)\n",
"\nimport os\nimport sys\n\nlottie_files_dir = sys.argv[1]\nout_dir = sys.argv[2]\nlottie_build = sys.argv[3]\n\n# Make sure all the lottie files are readable by everyone so we can see\n# them in the docker container.\nos.system('chmod 0644 %s/*' % lottie_files_dir)\nos.system('chmod 0644 %s/*' % lottie_build)\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\n# This typically means that the non-privileged docker won't be able to write.\nos.chmod(out_dir, 0o777)\n",
"/tmp/lottie_files",
"[START_DIR]/[SWARM_OUT_DIR]"
"[START_DIR]/[SWARM_OUT_DIR]",
"[START_DIR]/cache/work/lottie/build/player"
],
"infra_step": true,
"name": "Set up for docker",
Expand All @@ -152,10 +153,12 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@lottie_files_dir = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@out_dir = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@lottie_build = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Make sure all the lottie files are readable by everyone so we can see@@@",
"@@@STEP_LOG_LINE@python.inline@# them in the docker container.@@@",
"@@@STEP_LOG_LINE@python.inline@os.system('chmod 0644 %s/*' % lottie_files_dir)@@@",
"@@@STEP_LOG_LINE@python.inline@os.system('chmod 0644 %s/*' % lottie_build)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Prepare output folder, api.file.ensure_directory doesn't touch@@@",
"@@@STEP_LOG_LINE@python.inline@# the permissions of the out directory if it already exists.@@@",
Expand Down Expand Up @@ -203,8 +206,10 @@
"-v",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"-v",
"[START_DIR]/cache/work/lottie/build/player:/LOTTIE_BUILD",
"-v",
"/tmp/lottie_files:/LOTTIE_FILES",
"gcr.io/skia-public/gold-lottie-web-puppeteer:5.2.1_v1",
"gcr.io/skia-public/gold-lottie-web-puppeteer:v2",
"/SRC/skia/infra/lottiecap/docker/lottiecap_gold.sh",
"--builder",
"Test-Debian9-none-GCE-CPU-AVX2-x86_64-Debug-All-LottieWeb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,10 @@
"cmd": [
"python",
"-u",
"\nimport os\nimport sys\n\nlottie_files_dir = sys.argv[1]\nout_dir = sys.argv[2]\n\n# Make sure all the lottie files are readable by everyone so we can see\n# them in the docker container.\nos.system('chmod 0644 %s/*' % lottie_files_dir)\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\n# This typically means that the non-privileged docker won't be able to write.\nos.chmod(out_dir, 0o777)\n",
"\nimport os\nimport sys\n\nlottie_files_dir = sys.argv[1]\nout_dir = sys.argv[2]\nlottie_build = sys.argv[3]\n\n# Make sure all the lottie files are readable by everyone so we can see\n# them in the docker container.\nos.system('chmod 0644 %s/*' % lottie_files_dir)\nos.system('chmod 0644 %s/*' % lottie_build)\n\n# Prepare output folder, api.file.ensure_directory doesn't touch\n# the permissions of the out directory if it already exists.\n# This typically means that the non-privileged docker won't be able to write.\nos.chmod(out_dir, 0o777)\n",
"/tmp/lottie_files",
"[START_DIR]/[SWARM_OUT_DIR]"
"[START_DIR]/[SWARM_OUT_DIR]",
"[START_DIR]/cache/work/lottie/build/player"
],
"infra_step": true,
"name": "Set up for docker",
Expand All @@ -152,10 +153,12 @@
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@lottie_files_dir = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@out_dir = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@lottie_build = sys.argv[3]@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Make sure all the lottie files are readable by everyone so we can see@@@",
"@@@STEP_LOG_LINE@python.inline@# them in the docker container.@@@",
"@@@STEP_LOG_LINE@python.inline@os.system('chmod 0644 %s/*' % lottie_files_dir)@@@",
"@@@STEP_LOG_LINE@python.inline@os.system('chmod 0644 %s/*' % lottie_build)@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@# Prepare output folder, api.file.ensure_directory doesn't touch@@@",
"@@@STEP_LOG_LINE@python.inline@# the permissions of the out directory if it already exists.@@@",
Expand Down Expand Up @@ -203,8 +206,10 @@
"-v",
"[START_DIR]/[SWARM_OUT_DIR]:/OUT",
"-v",
"[START_DIR]/cache/work/lottie/build/player:/LOTTIE_BUILD",
"-v",
"/tmp/lottie_files:/LOTTIE_FILES",
"gcr.io/skia-public/gold-lottie-web-puppeteer:5.2.1_v1",
"gcr.io/skia-public/gold-lottie-web-puppeteer:v2",
"/SRC/skia/infra/lottiecap/docker/lottiecap_gold.sh",
"--builder",
"Test-Debian9-none-GCE-CPU-AVX2-x86_64-Debug-All-LottieWeb",
Expand Down
12 changes: 10 additions & 2 deletions infra/bots/recipes/test_lottie_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
]


DOCKER_IMAGE = 'gcr.io/skia-public/gold-lottie-web-puppeteer:5.2.1_v1'
DOCKER_IMAGE = 'gcr.io/skia-public/gold-lottie-web-puppeteer:v2'
LOTTIECAP_SCRIPT = '/SRC/skia/infra/lottiecap/docker/lottiecap_gold.sh'


Expand All @@ -27,6 +27,11 @@ def RunSteps(api):
out_dir = api.vars.swarming_out_dir
lottie_files_src = api.vars.slave_dir.join('lottie-samples')
lottie_files_dir = '/tmp/lottie_files'
# 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')

api.checkout.bot_update(checkout_root=checkout_root)

# Make sure this exists, otherwise Docker will make it with root permissions.
Expand All @@ -48,22 +53,25 @@ def RunSteps(api):
lottie_files_dir = sys.argv[1]
out_dir = sys.argv[2]
lottie_build = sys.argv[3]
# Make sure all the lottie files are readable by everyone so we can see
# them in the docker container.
os.system('chmod 0644 %s/*' % lottie_files_dir)
os.system('chmod 0644 %s/*' % lottie_build)
# Prepare output folder, api.file.ensure_directory doesn't touch
# the permissions of the out directory if it already exists.
# This typically means that the non-privileged docker won't be able to write.
os.chmod(out_dir, 0o777)
''',
args=[lottie_files_dir, out_dir],
args=[lottie_files_dir, out_dir, lottie_build],
infra_step=True)

cmd = ['docker', 'run', '--shm-size=2gb', '--rm',
'-v', '%s:/SRC' % checkout_root,
'-v', '%s:/OUT' % out_dir,
'-v', '%s:/LOTTIE_BUILD' % lottie_build,
'-v', '%s:/LOTTIE_FILES' % lottie_files_dir]

cmd.extend([
Expand Down
10 changes: 5 additions & 5 deletions infra/lottiecap/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It gets manually pushed anytime there's an update to the Dockerfile or relevant
installed libraries.

docker build -t lottie-web-puppeteer ./lottie-web-puppeteer/
LOTTIE_VERSION="5.2.1_v1" # use v1, v2, etc for any re-spins of the container.
LOTTIE_VERSION="v2" # use v1, v2, etc for any re-spins of the container.
docker tag lottie-web-puppeteer gcr.io/skia-public/lottie-web-puppeteer:$LOTTIE_VERSION
docker push gcr.io/skia-public/lottie-web-puppeteer:$LOTTIE_VERSION

Expand All @@ -32,10 +32,10 @@ For testing the image locally, the following can be helpful:
docker run -it --shm-size=2gb lottie-web-puppeteer /bin/bash
# Create a screenshot of a single .json file which will be put in
# $SKIA_ROOT/tools/lottiecap/docker_strip.png
docker run -it -v $SKIA_ROOT:/SRC -v ~/lottie-samples:/LOTTIE_FILES -w /SRC/tools/lottiecap lottie-web-puppeteer node /SRC/tools/lottiecap/lottiecap.js --input /LOTTIE_FILES/body_movin.json --lottie_player /usr/local/lib/node_modules/lottie-web/build/player/lottie.min.js --in_docker --output docker_strip.png
docker run -it -v $SKIA_ROOT:/SRC -v ~/lottie-samples:/LOTTIE_FILES -v $LOTTIE_ROOT/build/player:/LOTTIE_BUILD -w /SRC/tools/lottiecap lottie-web-puppeteer node /SRC/tools/lottiecap/lottiecap.js --input /LOTTIE_FILES/body_movin.json --lottie_player /LOTTIE_BUILD/lottie.min.js --in_docker --output docker_strip.png

gold-lottie-web-puppeteer
------------------
-------------------------

This image has Google Chrome, [puppeteer](https://github.com/GoogleChrome/puppeteer),
and a few other tools for automating web-browser tests.
Expand All @@ -48,7 +48,7 @@ installed libraries.

# Run the following from $SKIA_ROOT/infra/pathkit
make gold-docker-image
LOTTIE_VERSION="5.2.1_v1" # use v1, v2, etc for any re-spins of the container.
LOTTIE_VERSION="v2" # use v1, v2, etc for any re-spins of the container.
docker tag gold-lottie-web-puppeteer gcr.io/skia-public/gold-lottie-web-puppeteer:$LOTTIE_VERSION
docker push gcr.io/skia-public/gold-lottie-web-puppeteer:$LOTTIE_VERSION

Expand All @@ -65,4 +65,4 @@ For testing the image locally, the following can be helpful:
# Collect the gold output with the local source repo and *all* of the files
# from lottie-samples
mkdir -p -m 0777 /tmp/dockerout
docker run -v ~/lottie-samples:/LOTTIE_FILES -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gold-lottie-web-puppeteer /SRC/infra/lottiecap/docker/lottiecap_gold.sh
docker run -v ~/lottie-samples:/LOTTIE_FILES -v $SKIA_ROOT:/SRC -v $LOTTIE_ROOT/build/player:/LOTTIE_BUILD -v /tmp/dockerout:/OUT gold-lottie-web-puppeteer /SRC/infra/lottiecap/docker/lottiecap_gold.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
# Tests will be run as non-root (user skia, in fact), so /OUT should have permissions
# 777 so as to be able to create output there.

FROM gcr.io/skia-public/lottie-web-puppeteer:5.2.1_v1
FROM gcr.io/skia-public/lottie-web-puppeteer:v2

COPY /tmp/gold-aggregator /opt/gold-aggregator
1 change: 0 additions & 1 deletion infra/lottiecap/docker/lottie-web-puppeteer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ RUN npm install --global \
command-line-args@5.0.2 \
command-line-usage@5.0.3 \
express@4.16.3 \
lottie-web@5.2.1 \
node-fetch@2.2.0 \
puppeteer@1.6.2

Expand Down
4 changes: 2 additions & 2 deletions infra/lottiecap/docker/lottiecap_gold.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# at /LOTTIE_FILES.

# For example:
# docker run -v ~/lottie-samples:/LOTTIE_FILES -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gcr.io/skia-public/gold-lottie-web-puppeteer:5.2.1_v1 /SRC/infra/lottiecap/docker/lottiecap_gold.sh
# docker run -v ~/lottie-samples:/LOTTIE_FILES -v $LOTTIE_ROOT/build/player:/LOTTIE_BUILD -v $SKIA_ROOT:/SRC -v /tmp/dockerout:/OUT gcr.io/skia-public/gold-lottie-web-puppeteer:v2 /SRC/infra/lottiecap/docker/lottiecap_gold.sh

set -ex

Expand All @@ -27,7 +27,7 @@ cd $LOTTIECAP_DIR
# did not work here.
find /LOTTIE_FILES -not -path /LOTTIE_FILES -exec \
node ./lottiecap.js --port 8082 \
--lottie_player /usr/local/lib/node_modules/lottie-web/build/player/lottie.min.js \
--lottie_player /LOTTIE_BUILD/lottie.min.js \
--in_docker \
--post_to http://localhost:8081/report_gold_data \
--input {} \;
Expand Down

0 comments on commit d0f0cb8

Please sign in to comment.