Skip to content

Commit 3e990b5

Browse files
authored
ci(gcb): add all remaining demo builds (#6245)
Fixes: #6163 This PR adds "demo" builds (new parlance) for all the old "install" builds (old parlance). This looks like a big PR, but it's pretty mechanical. Mostly copying the old "install" Dockerfiles, and generating new trigger yaml files.
1 parent a663f96 commit 3e990b5

25 files changed

+1418
-1
lines changed

ci/cloudbuild/builds/demo-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ cmake --build cmake-out --target install
3939
## [END packaging.md]
4040

4141
# Tells pkg-config where the artifacts are, so the Makefile builds work.
42-
export PKG_CONFIG_PATH="${PREFIX}/lib64/pkgconfig:${PKG_CONFIG_PATH:-}"
42+
export PKG_CONFIG_PATH="${PREFIX}/lib64/pkgconfig:${PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
4343

4444
# Verify that the installed artifacts are usable by running the quickstarts.
4545
for lib in $(quickstart::libraries); do
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG DISTRO_VERSION=8
16+
FROM centos:${DISTRO_VERSION} AS devtools
17+
ARG NCPU=4
18+
19+
## [START packaging.md]
20+
21+
# Install the minimal development tools, libcurl, OpenSSL, and the c-ares
22+
# library (required by gRPC):
23+
24+
# ```bash
25+
RUN dnf makecache && \
26+
dnf install -y epel-release && \
27+
dnf makecache && \
28+
dnf install -y ccache cmake gcc-c++ git make openssl-devel pkgconfig \
29+
re2-devel zlib-devel libcurl-devel c-ares-devel tar wget which
30+
# ```
31+
32+
# The following steps will install libraries and tools in `/usr/local`. By
33+
# default CentOS-8 does not search for shared libraries in these directories,
34+
# there are multiple ways to solve this problem, the following steps are one
35+
# solution:
36+
37+
# ```bash
38+
RUN (echo "/usr/local/lib" ; echo "/usr/local/lib64") | \
39+
tee /etc/ld.so.conf.d/usrlocal.conf
40+
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
41+
ENV PATH=/usr/local/bin:${PATH}
42+
# ```
43+
44+
# #### Abseil
45+
46+
# We need a recent version of Abseil.
47+
48+
# ```bash
49+
WORKDIR /var/tmp/build
50+
RUN wget -q https://github.com/abseil/abseil-cpp/archive/20200923.3.tar.gz && \
51+
tar -xf 20200923.3.tar.gz && \
52+
cd abseil-cpp-20200923.3 && \
53+
sed -i 's/^#define ABSL_OPTION_USE_\(.*\) 2/#define ABSL_OPTION_USE_\1 0/' "absl/base/options.h" && \
54+
cmake \
55+
-DCMAKE_BUILD_TYPE=Release \
56+
-DBUILD_TESTING=OFF \
57+
-DBUILD_SHARED_LIBS=yes \
58+
-DCMAKE_CXX_STANDARD=11 \
59+
-H. -Bcmake-out && \
60+
cmake --build cmake-out -- -j ${NCPU:-4} && \
61+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
62+
ldconfig
63+
# ```
64+
65+
# #### Protobuf
66+
67+
# We need to install a version of Protobuf that is recent enough to support the
68+
# Google Cloud Platform proto files:
69+
70+
# ```bash
71+
WORKDIR /var/tmp/build
72+
RUN wget -q https://github.com/google/protobuf/archive/v3.14.0.tar.gz && \
73+
tar -xf v3.14.0.tar.gz && \
74+
cd protobuf-3.14.0/cmake && \
75+
cmake \
76+
-DCMAKE_BUILD_TYPE=Release \
77+
-DBUILD_SHARED_LIBS=yes \
78+
-Dprotobuf_BUILD_TESTS=OFF \
79+
-H. -Bcmake-out && \
80+
cmake --build cmake-out -- -j ${NCPU:-4} && \
81+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
82+
ldconfig
83+
# ```
84+
85+
# #### gRPC
86+
87+
# We also need a version of gRPC that is recent enough to support the Google
88+
# Cloud Platform proto files. We manually install it using:
89+
90+
# ```bash
91+
WORKDIR /var/tmp/build
92+
RUN wget -q https://github.com/grpc/grpc/archive/v1.35.0.tar.gz && \
93+
tar -xf v1.35.0.tar.gz && \
94+
cd grpc-1.35.0 && \
95+
cmake \
96+
-DCMAKE_BUILD_TYPE=Release \
97+
-DgRPC_INSTALL=ON \
98+
-DgRPC_BUILD_TESTS=OFF \
99+
-DgRPC_ABSL_PROVIDER=package \
100+
-DgRPC_CARES_PROVIDER=package \
101+
-DgRPC_PROTOBUF_PROVIDER=package \
102+
-DgRPC_RE2_PROVIDER=package \
103+
-DgRPC_SSL_PROVIDER=package \
104+
-DgRPC_ZLIB_PROVIDER=package \
105+
-H. -Bcmake-out && \
106+
cmake --build cmake-out -- -j ${NCPU:-4} && \
107+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
108+
ldconfig
109+
# ```
110+
111+
# #### crc32c
112+
113+
# The project depends on the Crc32c library, we need to compile this from
114+
# source:
115+
116+
# ```bash
117+
WORKDIR /var/tmp/build
118+
RUN wget -q https://github.com/google/crc32c/archive/1.1.0.tar.gz && \
119+
tar -xf 1.1.0.tar.gz && \
120+
cd crc32c-1.1.0 && \
121+
cmake \
122+
-DCMAKE_BUILD_TYPE=Release \
123+
-DBUILD_SHARED_LIBS=yes \
124+
-DCRC32C_BUILD_TESTS=OFF \
125+
-DCRC32C_BUILD_BENCHMARKS=OFF \
126+
-DCRC32C_USE_GLOG=OFF \
127+
-H. -Bcmake-out && \
128+
cmake --build cmake-out -- -j ${NCPU:-4} && \
129+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
130+
ldconfig
131+
# ```
132+
133+
# #### nlohmann_json library
134+
135+
# The project depends on the nlohmann_json library. We use CMake to
136+
# install it as this installs the necessary CMake configuration files.
137+
# Note that this is a header-only library, and often installed manually.
138+
# This leaves your environment without support for CMake pkg-config.
139+
140+
# ```bash
141+
WORKDIR /var/tmp/build
142+
RUN wget -q https://github.com/nlohmann/json/archive/v3.9.0.tar.gz && \
143+
tar -xzf v3.9.0.tar.gz && \
144+
cd json-3.9.0 && \
145+
cmake \
146+
-DCMAKE_BUILD_TYPE=Release \
147+
-DBUILD_SHARED_LIBS=yes \
148+
-DBUILD_TESTING=OFF \
149+
-H. -Bcmake-out/nlohmann/json && \
150+
cmake --build cmake-out/nlohmann/json --target install -- -j ${NCPU} && \
151+
ldconfig
152+
# ```
153+
154+
## [END packaging.md]
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Copyright 2021 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
ARG DISTRO_VERSION=buster
16+
FROM debian:${DISTRO_VERSION} AS devtools
17+
ARG NCPU=4
18+
19+
## [START packaging.md]
20+
21+
# Install the minimal development tools, libcurl, and OpenSSL:
22+
23+
# ```bash
24+
RUN apt-get update && \
25+
apt-get --no-install-recommends install -y apt-transport-https apt-utils \
26+
automake build-essential ca-certificates ccache cmake git gcc g++ \
27+
libc-ares-dev libc-ares2 libcurl4-openssl-dev libssl-dev m4 make \
28+
pkg-config tar wget zlib1g-dev
29+
# ```
30+
31+
# Debian 10 includes versions of gRPC and Protobuf that support the
32+
# Google Cloud Platform proto files. We simply install these pre-built versions:
33+
34+
# ```bash
35+
RUN apt-get update && \
36+
apt-get --no-install-recommends install -y libgrpc++-dev libprotobuf-dev \
37+
libprotoc-dev libc-ares-dev protobuf-compiler protobuf-compiler-grpc
38+
# ```
39+
40+
# #### Abseil
41+
42+
# We need a recent version of Abseil.
43+
44+
# ```bash
45+
WORKDIR /var/tmp/build
46+
RUN wget -q https://github.com/abseil/abseil-cpp/archive/20200923.3.tar.gz && \
47+
tar -xf 20200923.3.tar.gz && \
48+
cd abseil-cpp-20200923.3 && \
49+
sed -i 's/^#define ABSL_OPTION_USE_\(.*\) 2/#define ABSL_OPTION_USE_\1 0/' "absl/base/options.h" && \
50+
cmake \
51+
-DCMAKE_BUILD_TYPE=Release \
52+
-DBUILD_TESTING=OFF \
53+
-DBUILD_SHARED_LIBS=yes \
54+
-DCMAKE_CXX_STANDARD=11 \
55+
-H. -Bcmake-out && \
56+
cmake --build cmake-out -- -j ${NCPU:-4} && \
57+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
58+
ldconfig
59+
# ```
60+
61+
# #### crc32c
62+
63+
# The project depends on the Crc32c library, we need to compile this from
64+
# source:
65+
66+
# ```bash
67+
WORKDIR /var/tmp/build
68+
RUN wget -q https://github.com/google/crc32c/archive/1.1.0.tar.gz && \
69+
tar -xf 1.1.0.tar.gz && \
70+
cd crc32c-1.1.0 && \
71+
cmake \
72+
-DCMAKE_BUILD_TYPE=Release \
73+
-DBUILD_SHARED_LIBS=yes \
74+
-DCRC32C_BUILD_TESTS=OFF \
75+
-DCRC32C_BUILD_BENCHMARKS=OFF \
76+
-DCRC32C_USE_GLOG=OFF \
77+
-H. -Bcmake-out && \
78+
cmake --build cmake-out -- -j ${NCPU:-4} && \
79+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
80+
ldconfig
81+
# ```
82+
83+
# #### nlohmann_json library
84+
85+
# The project depends on the nlohmann_json library. We use CMake to
86+
# install it as this installs the necessary CMake configuration files.
87+
# Note that this is a header-only library, and often installed manually.
88+
# This leaves your environment without support for CMake pkg-config.
89+
90+
# ```bash
91+
WORKDIR /var/tmp/build
92+
RUN wget -q https://github.com/nlohmann/json/archive/v3.9.0.tar.gz && \
93+
tar -xzf v3.9.0.tar.gz && \
94+
cd json-3.9.0 && \
95+
cmake \
96+
-DCMAKE_BUILD_TYPE=Release \
97+
-DBUILD_SHARED_LIBS=yes \
98+
-DBUILD_TESTING=OFF \
99+
-H. -Bcmake-out/nlohmann/json && \
100+
cmake --build cmake-out/nlohmann/json --target install -- -j ${NCPU} && \
101+
ldconfig
102+
# ```
103+
104+
## [END packaging.md]

0 commit comments

Comments
 (0)