1cb93a386Sopenharmony_ciDocker 2cb93a386Sopenharmony_ci====== 3cb93a386Sopenharmony_ci 4cb93a386Sopenharmony_ciDocker files to handle Gold + lottie-web integration 5cb93a386Sopenharmony_ci 6cb93a386Sopenharmony_ci 7cb93a386Sopenharmony_cilottie-web-puppeteer 8cb93a386Sopenharmony_ci-------------------- 9cb93a386Sopenharmony_ci 10cb93a386Sopenharmony_ciThis image has Google Chrome, [puppeteer](https://github.com/GoogleChrome/puppeteer), 11cb93a386Sopenharmony_ciand a few other tools for automating web-browser tests. 12cb93a386Sopenharmony_ci 13cb93a386Sopenharmony_ciThis image is standalone and does not have any extra dependencies that make 14cb93a386Sopenharmony_ciit Skia-exclusive. 15cb93a386Sopenharmony_ci 16cb93a386Sopenharmony_ciIt gets manually pushed anytime there's an update to the Dockerfile or relevant 17cb93a386Sopenharmony_ciinstalled libraries. 18cb93a386Sopenharmony_ci 19cb93a386Sopenharmony_ci docker build -t lottie-web-puppeteer ./lottie-web-puppeteer/ 20cb93a386Sopenharmony_ci LOTTIE_VERSION="v2" # use v1, v2, etc for any re-spins of the container. 21cb93a386Sopenharmony_ci docker tag lottie-web-puppeteer gcr.io/skia-public/lottie-web-puppeteer:$LOTTIE_VERSION 22cb93a386Sopenharmony_ci docker push gcr.io/skia-public/lottie-web-puppeteer:$LOTTIE_VERSION 23cb93a386Sopenharmony_ci 24cb93a386Sopenharmony_ciOf note, some versions (generally before Chrome 60) run out of space on /dev/shm when 25cb93a386Sopenharmony_ciusing the default Docker settings. To be safe, it is recommended to run the container 26cb93a386Sopenharmony_ciwith the flag --shm-size=2gb. 27cb93a386Sopenharmony_ci 28cb93a386Sopenharmony_ciFor testing the image locally, the following can be helpful: 29cb93a386Sopenharmony_ci 30cb93a386Sopenharmony_ci docker build -t lottie-web-puppeteer ./lottie-web-puppeteer/ 31cb93a386Sopenharmony_ci # Run bash in it to poke around and make sure things are properly installed 32cb93a386Sopenharmony_ci docker run -it --shm-size=2gb lottie-web-puppeteer /bin/bash 33cb93a386Sopenharmony_ci # Create a screenshot of a single .json file which will be put in 34cb93a386Sopenharmony_ci # $SKIA_ROOT/tools/lottiecap/docker_strip.png 35cb93a386Sopenharmony_ci 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 36cb93a386Sopenharmony_ci 37cb93a386Sopenharmony_cigold-lottie-web-puppeteer 38cb93a386Sopenharmony_ci------------------------- 39cb93a386Sopenharmony_ci 40cb93a386Sopenharmony_ciThis image has Google Chrome, [puppeteer](https://github.com/GoogleChrome/puppeteer), 41cb93a386Sopenharmony_ciand a few other tools for automating web-browser tests. 42cb93a386Sopenharmony_ci 43cb93a386Sopenharmony_ciThis image assumes the runner wants to collect the output images and JSON data 44cb93a386Sopenharmony_cispecific to Skia Infra's Gold tool (image correctness). 45cb93a386Sopenharmony_ci 46cb93a386Sopenharmony_ciIt gets manually pushed anytime there's an update to the Dockerfile or relevant 47cb93a386Sopenharmony_ciinstalled libraries. 48cb93a386Sopenharmony_ci 49cb93a386Sopenharmony_ci # Run the following from $SKIA_ROOT/infra/pathkit 50cb93a386Sopenharmony_ci make gold-docker-image 51cb93a386Sopenharmony_ci LOTTIE_VERSION="v2" # use v1, v2, etc for any re-spins of the container. 52cb93a386Sopenharmony_ci docker tag gold-lottie-web-puppeteer gcr.io/skia-public/gold-lottie-web-puppeteer:$LOTTIE_VERSION 53cb93a386Sopenharmony_ci docker push gcr.io/skia-public/gold-lottie-web-puppeteer:$LOTTIE_VERSION 54cb93a386Sopenharmony_ci 55cb93a386Sopenharmony_ci 56cb93a386Sopenharmony_ciOf note, some versions (generally before Chrome 60) run out of space on /dev/shm when 57cb93a386Sopenharmony_ciusing the default Docker settings. To be safe, it is recommended to run the container 58cb93a386Sopenharmony_ciwith the flag --shm-size=2gb. 59cb93a386Sopenharmony_ci 60cb93a386Sopenharmony_ciFor testing the image locally, the following can be helpful: 61cb93a386Sopenharmony_ci 62cb93a386Sopenharmony_ci # Run the following from $SKIA_ROOT/infra/pathkit 63cb93a386Sopenharmony_ci make gold-docker-image 64cb93a386Sopenharmony_ci docker run -it --shm-size=2gb gold-lottie-web-puppeteer /bin/bash 65cb93a386Sopenharmony_ci # Collect the gold output with the local source repo and *all* of the files 66cb93a386Sopenharmony_ci # from lottie-samples 67cb93a386Sopenharmony_ci mkdir -p -m 0777 /tmp/dockerout 68cb93a386Sopenharmony_ci 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