Skip to content

Commit 4cb778e

Browse files
jcgregorioSkia Commit-Bot
authored andcommitted
Fix usage of depot_tools in containers.
depot_tools w/vpython now seems to require the depot_tools dir to be on PATH, and also python and curl need to be installed. * Creates a new base image that has all the build tools we need for building Skia: skia-build-tools. * Moves skia-release to use that new base image. * Moves both the skia-release and wasm builds to use fetch and gclient sync. * Changes gcr.io/skia-public/emsdk-base:prod to depend on skia-build-tools. Bug: skia:993053 Change-Id: Ib6218d8c18dd59d43de84dcf063f204cfc8556d0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248556 Commit-Queue: Joe Gregorio <jcgregorio@google.com> Reviewed-by: Eric Boren <borenet@google.com>
1 parent c910602 commit 4cb778e

File tree

7 files changed

+70
-50
lines changed

7 files changed

+70
-50
lines changed

docker/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Build gcr.io/skia-public/skia-build-tools:latest, the image used to compile
2+
# Skia in Google Cloud Build.
3+
push-skia-build-tools:
4+
docker build -t skia-build-tools ./skia-build-tools
5+
docker tag skia-build-tools gcr.io/skia-public/skia-build-tools:latest
6+
docker push gcr.io/skia-public/skia-build-tools:latest

docker/README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
Docker
2-
======
1+
# Docker
32

43
Docker files for building different Skia targets.
54

6-
skia-release
7-
------
5+
## skia-release
86

97
This image is used to build Skia at TOT with SwiftShader.
108

@@ -15,8 +13,7 @@ need to manually push a verison, then run the following commands:
1513
docker tag skia-release gcr.io/skia-public/skia-release:prod
1614
docker push gcr.io/skia-public/skia-release:prod
1715

18-
skia-wasm-release
19-
------
16+
## skia-wasm-release
2017

2118
This image is used to build the Web Assembly (WASM) libraries of Skia
2219
at TOT.
@@ -29,8 +26,7 @@ need to manually push a verison, then run the following commands:
2926
docker push gcr.io/skia-public/skia-wasm-release:prod
3027

3128

32-
skia-with-swift-shader-base
33-
------
29+
## skia-with-swift-shader-base
3430

3531
This image is used to build a local checkout of Skia with SwiftShader and run the built
3632
executables without requiring the SwiftShader be installed on the host.
@@ -49,8 +45,7 @@ following commands:
4945
docker tag skia-with-swift-shader-base gcr.io/skia-public/skia-with-swift-shader-base:prod
5046
docker push gcr.io/skia-public/skia-with-swift-shader-base:prod
5147

52-
cmake-release
53-
------
48+
## cmake-release
5449

5550
This image is used to build Skia using CMake.
5651

@@ -70,8 +65,7 @@ For testing the image locally, the following flow can be helpful:
7065
# Compile Skia in a local checkout with the local image
7166
docker run -v $SKIA_ROOT:/SRC -v /tmp/output:/OUT cmake-release /SRC/infra/docker/cmake/build_skia.sh
7267

73-
binary-size
74-
------
68+
## binary-size
7569

7670
This image is used to build code size tree-maps of Skia
7771

@@ -89,4 +83,12 @@ For testing the image locally, the following flow can be helpful:
8983
# installed and configured.
9084
docker run -it binary-size /bin/sh
9185
# analyze exe "skottie_tool" in build directory out/Release
92-
docker run -v $SKIA_ROOT/out/Release:/IN -v /tmp/output:/OUT binary-size /opt/binary_size/src/run_binary_size_analysis.py --library /IN/skottie_tool --destdir /OUT
86+
docker run -v $SKIA_ROOT/out/Release:/IN -v /tmp/output:/OUT binary-size /opt/binary_size/src/run_binary_size_analysis.py --library /IN/skottie_tool --destdir /OUT
87+
88+
## skia-build-tools
89+
90+
This image contains all the tools needed to build Skia.
91+
92+
To push a new version run:
93+
94+
make push-skia-build-tools

docker/cloudbuild.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,28 @@
22
# Builder: https://cloud.google.com/container-builder/docs/
33
#
44
steps:
5-
# To test locally, first uncomment the last two lines of this comment block, then submit with:
5+
# To test locally, first uncomment the last 8 lines of this comment block,
6+
# update the /refs/changes/... value to reflect the CL you are testing and
7+
# then run:
68
#
79
# gcloud builds submit --config cloudbuild.yaml --no-source --substitutions=COMMIT_SHA=b2acf0a93927a57cc1fa9323839e788379ae3366
810
#
911
# Where COMMIT_SHA is updated to the last commit into Skia.
1012
#
1113
#- name: 'gcr.io/cloud-builders/git'
1214
# args: ['clone', 'https://github.com/google/skia.git', '.']
15+
#
16+
#- name: 'gcr.io/cloud-builders/git'
17+
# args: ['fetch', 'https://skia.googlesource.com/skia','refs/changes/56/248556/18']
18+
#
19+
#- name: 'gcr.io/cloud-builders/git'
20+
# args: ['checkout', 'FETCH_HEAD']
1321

1422
- name: 'debian:testing-slim'
15-
args: ['mkdir', '-p', '--mode=0777', '/workspace/__doxygen_staging']
23+
args: ['mkdir', '-p', '--mode=0777', './__doxygen_staging']
1624

1725
- name: 'debian:testing-slim'
18-
args: ['mkdir', '-p', '--mode=0777', '/workspace/__cache']
26+
args: ['ls', '-al', '/']
1927

2028
- name: 'gcr.io/skia-public/doxygen:testing-slim'
2129
dir: './tools/doxygen'
@@ -142,7 +150,4 @@ images:
142150
- 'gcr.io/$PROJECT_ID/skia-wasm-release:prod'
143151
timeout: 7200s
144152
options:
145-
machineType: 'N1_HIGHCPU_32'
146-
env: # https://bugs.chromium.org/p/chromium/issues/detail?id=993053#c3
147-
- 'VPYTHON_VIRTUALENV_ROOT=/workspace/__cache'
148-
- 'CIPD_CACHE_DIR=/workspace/__cache'
153+
machineType: 'N1_HIGHCPU_32'

docker/skia-build-tools/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dockerfile for building an image with all the tools needed to checkout and build Skia.
2+
FROM launcher.gcr.io/google/clang-debian9 AS build
3+
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
4+
git \
5+
python \
6+
curl \
7+
build-essential \
8+
libfontconfig-dev \
9+
libgl1-mesa-dev \
10+
libglu1-mesa-dev \
11+
&& groupadd -g 2000 skia \
12+
&& useradd -u 2000 -g 2000 skia
13+
14+
RUN cd /tmp \
15+
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git'
16+
17+
ENV PATH=${PATH}:/tmp/depot_tools
18+
19+
ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
20+
ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so

docker/skia-release/Dockerfile

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
# Dockerfile for building Skia in release mode, using 3rd party libs from DEPS, with SwiftShader.
2-
FROM launcher.gcr.io/google/clang-debian9 AS build
3-
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
4-
git \
5-
python \
6-
curl \
7-
build-essential \
8-
libfontconfig-dev \
9-
libgl1-mesa-dev \
10-
libglu1-mesa-dev \
11-
&& groupadd -g 2000 skia \
12-
&& useradd -u 2000 -g 2000 --home-dir /workspace/__cache skia
2+
FROM gcr.io/skia-public/skia-build-tools:latest
133

14-
ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
15-
ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so
164
RUN cd /tmp \
17-
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
18-
&& git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \
19-
&& mkdir -p /tmp/skia \
5+
&& git clone https://swiftshader.googlesource.com/SwiftShader swiftshader
6+
7+
# Checkout Skia.
8+
RUN mkdir -p /tmp/skia \
209
&& cd /tmp/skia \
21-
&& /tmp/depot_tools/fetch skia \
22-
&& cd skia
10+
&& fetch skia \
11+
&& cd skia \
12+
&& gclient sync \
13+
&& ./bin/fetch-gn
2314

15+
# Write args.gn.
2416
RUN mkdir -p /tmp/skia/skia/out/Static
2517
RUN echo ' \n\
2618
cc = "clang" \n\
@@ -39,9 +31,8 @@ extra_ldflags = [ \n\
3931
"-Wl,/usr/local/lib" \n\
4032
] ' > /tmp/skia/skia/out/Static/args.gn
4133

34+
# Build Skia.
4235
RUN cd /tmp/skia/skia \
43-
&& python tools/git-sync-deps \
44-
&& ./bin/fetch-gn \
4536
&& ./bin/gn gen out/Static \
4637
&& git rev-parse HEAD > VERSION \
4738
&& /tmp/depot_tools/ninja -C out/Static \

docker/skia-wasm-release/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Dockerfile for building the WASM libraries used by jsfiddle.skia.org and debugger.skia.org
22
FROM gcr.io/skia-public/emsdk-base:prod as builder
33

4-
RUN cd /tmp \
5-
&& git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
6-
&& mkdir -p /tmp/skia \
4+
# Checkout Skia.
5+
RUN mkdir -p /tmp/skia \
76
&& cd /tmp/skia \
8-
&& /tmp/depot_tools/fetch skia
9-
10-
RUN cd /tmp/skia/skia \
11-
&& python tools/git-sync-deps \
7+
&& fetch skia \
8+
&& cd skia \
9+
&& gclient sync \
1210
&& ./bin/fetch-gn
1311

1412
# PathKit should be in /tmp/skia/skia/out/pathkit/

infra/wasm-common/docker/emsdk-base/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# A Docker image that has the Emscripten SDK installed to /opt/emsdk
22
# Use this image to compile C/C++ code to WASM.
33

4-
FROM launcher.gcr.io/google/clang-debian9
4+
FROM gcr.io/skia-public/skia-build-tools:latest
55
RUN apt-get update && apt-get upgrade -y && apt-get install -y \
6-
git \
7-
python \
86
nodejs \
97
default-jre
108

0 commit comments

Comments
 (0)