Debian Codegraph @

infra/wasm-common/docker/README.md

raw
1 Docker
2 ======
3
4 Docker files to ease working with CanvasKit and other WASM artifacts.
5
6 emsdk-base
7 ----------
8
9 This image has an Emscripten SDK environment that can be used for
10 compiling projects (e.g. Skia's CanvasKit) to WASM.
11
12 This image tracks the official emscripten Docker image and installs
13 python 2 (which some of our scripts still use).
14
15 make publish_emsdk_base
16
17 For testing the image locally, the following flow can be helpful:
18
19 docker build -t emsdk-base ./emsdk-base/
20 # Run bash in it to poke around and make sure things are properly installed
21 docker run -it emsdk-base /bin/bash
22 # Compile CanvasKit with the local image
23 docker run -v $SKIA_ROOT:/SRC -v $SKIA_ROOT/out/dockerpathkit:/OUT emsdk-base /SRC/infra/canvaskit/build_canvaskit.sh
24
25 karma-chrome-tests
26 ------------------
27
28 This image has Google Chrome and karma/jasmine installed on it, which can
29 be used to run JS tests.
30
31 This image is standalone and does not have any extra dependencies that make
32 it Skia-exclusive.
33
34 It gets manually pushed anytime there's an update to the Dockerfile or relevant
35 installed libraries.
36
37 make publish_karma_chrome_tests
38
39 Of note, some versions (generally before Chrome 60) run out of space on /dev/shm when
40 using the default Docker settings. To be safe, it is recommended to run the container
41 with the flag --shm-size=2gb.
42
43 For testing the image locally, the following can be helpful:
44
45 docker build -t karma-chrome-tests ./karma-chrome-tests/
46 # Run bash in it to poke around and make sure things are properly installed
47 docker run -it --shm-size=2gb karma-chrome-tests /bin/bash
48 # Run the tests (but not capturing Gold output) with the local source repo
49 docker run --shm-size=2gb -v $SKIA_ROOT:/SRC karma-chrome-tests karma start /SRC/infra/pathkit/karma-docker.conf.js --single-run
50
51 gold-karma-chrome-tests
52 ------------------
53
54 This image has Google Chrome and karma/jasmine installed on it, which can
55 be used to run JS tests.
56
57 This image assumes the runner wants to collect the output images and JSON data
58 specific to Skia Infra's Gold tool (image correctness).
59
60 It gets manually pushed anytime there's an update to the Dockerfile or the parent
61 image (karma-chrome-tests).
62
63 # Run the following from $SKIA_ROOT/infra/pathkit
64 make publish_gold_karma_chrome_tests
65
66 Of note, some versions (generally before Chrome 60) run out of space on /dev/shm when
67 using the default Docker settings. To be safe, it is recommended to run the container
68 with the flag --shm-size=2gb.
69
70 For testing the image locally, the following can be helpful:
71
72 # Run the following from $SKIA_ROOT/infra/pathkit
73 make gold-docker-image
74 # Run bash in it to poke around and make sure things are properly installed
75 docker run -it --shm-size=2gb gold-karma-chrome-tests /bin/bash
76 # Run the tests and collect Gold output with the local source repo
77 mkdir -p -m 0777 /tmp/dockergold
78 docker run --shm-size=2gb -v $SKIA_ROOT:/SRC -v /tmp/dockergold:/OUT gold-karma-chrome-tests /SRC/infra/pathkit/test_pathkit.sh
79
80 perf-karma-chrome-tests
81 ------------------
82
83 This image has Google Chrome and karma/jasmine installed on it, which can
84 be used to run JS tests.
85
86 This image assumes the runner wants to collect the output images and JSON data
87 specific to Skia Infra's Perf tool.
88
89 It gets manually pushed anytime there's an update to the Dockerfile or the parent
90 image (karma-chrome-tests).
91
92 # Run the following from $SKIA_ROOT/infra/pathkit
93 make publish_perf_karma_chrome_tests
94
95 Of note, some versions (generally before Chrome 60) run out of space on /dev/shm when
96 using the default Docker settings. To be safe, it is recommended to run the container
97 with the flag --shm-size=2gb.
98
99 For testing the image locally, the following can be helpful:
100
101 # Run the following from $SKIA_ROOT/infra/pathkit
102 make perf-docker-image
103 # Run bash in it to poke around and make sure things are properly installed
104 docker run -it --shm-size=2gb perf-karma-chrome-tests /bin/bash
105 # Run the tests and collect Perf output with the local source repo
106 mkdir -p -m 0777 /tmp/dockerperf
107 docker run --shm-size=2gb -v $SKIA_ROOT:/SRC -v /tmp/dockerperf:/OUT perf-karma-chrome-tests /SRC/infra/pathkit/perf_pathkit.sh