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