Skip to content

Commit 5f33e4a

Browse files
authored
ci: generate files in ci/kokoro/install (#3249)
All the files except Dockerfile.ubuntu-trusty are automatically generated. This exception is caused by the complexity of building libcurl and gRPC with the same underlying OpenSSL library on this particular platform.
1 parent 286c91f commit 5f33e4a

17 files changed

+1226
-1102
lines changed

INSTALL.md

Lines changed: 431 additions & 475 deletions
Large diffs are not rendered by default.

ci/etc/kokoro/install/project-config.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ declare -A ORIGINAL_COPYRIGHT_YEAR=(
2626
[ubuntu-bionic]=2018
2727
)
2828

29+
declare -a FROZEN_FILES=(
30+
"ci/kokoro/install/Dockerfile.ubuntu-trusty"
31+
)
32+
2933
BUILD_AND_TEST_PROJECT_FRAGMENT=$(replace_fragments \
3034
"INSTALL_CRC32C_FROM_SOURCE" \
3135
"INSTALL_CPP_CMAKEFILES_FROM_SOURCE" \
@@ -63,7 +67,7 @@ BUILD_AND_TEST_PROJECT_FRAGMENT=$(replace_fragments \
6367
# all the Google Cloud C++ client libraries:
6468
6569
# ```bash
66-
@INSTALL_GOOGLETEST_FROM_SOURCE@
70+
@INSTALL_GOOGLE_CLOUD_CPP_COMMON_FROM_SOURCE@
6771
# ```
6872
6973
FROM devtools AS install
@@ -85,7 +89,7 @@ RUN cmake --build . --target install
8589
8690
## [END INSTALL.md]
8791
88-
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
92+
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
8993
9094
# Verify that the installed files are actually usable
9195
WORKDIR /home/build/test-install-plain-make

ci/kokoro/install/Dockerfile.centos-7

Lines changed: 59 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,21 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
#
16+
# WARNING: This is an automatically generated file. Consider changing the
17+
# sources instead. You can find the source templates and scripts at:
18+
# https://github.com/googleapis/google-cloud-cpp-common/ci/templates
19+
#
20+
1521
ARG DISTRO_VERSION=7
1622
FROM centos:${DISTRO_VERSION} AS devtools
1723
ARG NCPU=4
1824

19-
# Please keep the formatting in these commands, it is optimized to cut & paste
20-
# into the README.md file.
21-
2225
## [START INSTALL.md]
2326

2427
# First install the development tools and OpenSSL. The development tools
25-
# distributed with CentOS (notably CMake) are too old to build
26-
# `google-cloud-cpp`. In these instructions, we use `cmake3` obtained from
28+
# distributed with CentOS 7 (notably CMake) are too old to build
29+
# the project. In these instructions, we use `cmake3` obtained from
2730
# [Software Collections](https://www.softwarecollections.org/).
2831

2932
# ```bash
@@ -48,40 +51,22 @@ ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
4851
ENV PATH=/usr/local/bin:${PATH}
4952
# ```
5053

51-
# #### crc32c
52-
53-
# There is no CentOS package for this library. To install it use:
54-
55-
# ```bash
56-
WORKDIR /var/tmp/build
57-
RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz && \
58-
tar -xf 1.0.6.tar.gz && \
59-
cd crc32c-1.0.6 && \
60-
cmake \
61-
-DCMAKE_BUILD_TYPE=Release \
62-
-DBUILD_SHARED_LIBS=yes \
63-
-DCRC32C_BUILD_TESTS=OFF \
64-
-DCRC32C_BUILD_BENCHMARKS=OFF \
65-
-DCRC32C_USE_GLOG=OFF \
66-
-H. -Bcmake-out/crc32c && \
67-
cmake --build cmake-out/crc32c --target install -- -j ${NCPU:-4} && \
68-
ldconfig
69-
# ```
70-
7154
# #### Protobuf
7255

73-
# Likewise, manually install protobuf:
56+
# We need to install a version of Protobuf that is recent enough to support the
57+
# Google Cloud Platform proto files:
7458

7559
# ```bash
7660
WORKDIR /var/tmp/build
77-
RUN wget -q https://github.com/google/protobuf/archive/v3.6.1.tar.gz && \
78-
tar -xf v3.6.1.tar.gz && \
79-
cd protobuf-3.6.1/cmake && \
61+
RUN wget -q https://github.com/google/protobuf/archive/v3.9.1.tar.gz && \
62+
tar -xf v3.9.1.tar.gz && \
63+
cd protobuf-3.9.1/cmake && \
8064
cmake \
8165
-DCMAKE_BUILD_TYPE=Release \
8266
-DBUILD_SHARED_LIBS=yes \
8367
-Dprotobuf_BUILD_TESTS=OFF \
8468
-H. -Bcmake-out && \
69+
cmake --build cmake-out -- -j ${NCPU:-4} && \
8570
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
8671
ldconfig
8772
# ```
@@ -96,39 +81,58 @@ WORKDIR /var/tmp/build
9681
RUN wget -q https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz && \
9782
tar -xf cares-1_14_0.tar.gz && \
9883
cd c-ares-cares-1_14_0 && \
99-
./buildconf && \
100-
./configure && \
101-
make -j ${NCPU:-4} && \
84+
./buildconf && ./configure && make -j ${NCPU:-4} && \
10285
make install && \
10386
ldconfig
10487
# ```
10588

10689
# #### gRPC
10790

108-
# Can be manually installed using:
91+
# We also need a version of gRPC that is recent enough to support the Google
92+
# Cloud Platform proto files. We manually install it using:
10993

11094
# ```bash
11195
WORKDIR /var/tmp/build
112-
RUN wget -q https://github.com/grpc/grpc/archive/v1.19.1.tar.gz && \
113-
tar -xf v1.19.1.tar.gz && \
114-
cd grpc-1.19.1 && \
96+
RUN wget -q https://github.com/grpc/grpc/archive/v1.23.1.tar.gz && \
97+
tar -xf v1.23.1.tar.gz && \
98+
cd grpc-1.23.1 && \
11599
make -j ${NCPU:-4} && \
116100
make install && \
117101
ldconfig
118102
# ```
119103

104+
# #### crc32c
105+
106+
# The project depends on the Crc32c library, we need to compile this from
107+
# source:
108+
109+
# ```bash
110+
WORKDIR /var/tmp/build
111+
RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz && \
112+
tar -xf 1.0.6.tar.gz && \
113+
cd crc32c-1.0.6 && \
114+
cmake \
115+
-DCMAKE_BUILD_TYPE=Release \
116+
-DBUILD_SHARED_LIBS=yes \
117+
-DCRC32C_BUILD_TESTS=OFF \
118+
-DCRC32C_BUILD_BENCHMARKS=OFF \
119+
-DCRC32C_USE_GLOG=OFF \
120+
-H. -Bcmake-out && \
121+
cmake --build cmake-out -- -j ${NCPU:-4} && \
122+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
123+
ldconfig
124+
# ```
125+
120126
# #### googleapis
121127

122-
# There is no CentOS package for this library. To install it, use:
128+
# We need a recent version of the Google Cloud Platform proto C++ libraries:
123129

124130
# ```bash
125131
WORKDIR /var/tmp/build
126132
RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.1.5.tar.gz && \
127133
tar -xf v0.1.5.tar.gz && \
128134
cd cpp-cmakefiles-0.1.5 && \
129-
cmake \
130-
-DBUILD_SHARED_LIBS=YES \
131-
-H. -Bcmake-out && \
135+
cmake -DBUILD_SHARED_LIBS=YES -H. -Bcmake-out && \
132136
cmake --build cmake-out -- -j ${NCPU:-4} && \
133137
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
134138
ldconfig
@@ -144,54 +148,51 @@ WORKDIR /var/tmp/build
144148
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
145149
tar -xf release-1.10.0.tar.gz && \
146150
cd googletest-release-1.10.0 && \
147-
cmake \
148-
-DCMAKE_BUILD_TYPE="Release" \
149-
-DBUILD_SHARED_LIBS=yes \
150-
-H. -Bcmake-out && \
151+
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
151152
cmake --build cmake-out -- -j ${NCPU:-4} && \
152153
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
153154
ldconfig
154155
# ```
155156

156157
# #### google-cloud-cpp-common
157158

158-
# We need to install the Google Cloud C++ common libraries:
159+
# The project also depends on google-cloud-cpp-common, the libraries shared by
160+
# all the Google Cloud C++ client libraries:
159161

160162
# ```bash
161163
WORKDIR /var/tmp/build
162-
## Compile without the tests because we are testing google-cloud-cpp, not the
163-
## common libraries, but we need the testing_utils because we use it in the
164-
## google-cloud-cpp tests.
165164
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.16.0.tar.gz && \
166165
tar -xf v0.16.0.tar.gz && \
167166
cd google-cloud-cpp-common-0.16.0 && \
168167
cmake -H. -Bcmake-out \
169-
-DBUILD_TESTING=OFF \
170-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
168+
-DBUILD_TESTING=OFF \
169+
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
171170
cmake --build cmake-out -- -j ${NCPU:-4} && \
172-
cmake --build cmake-out --target install && \
171+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
173172
ldconfig
174173
# ```
175174

176175
FROM devtools AS install
177176
ARG NCPU=4
178177

179-
# #### google-cloud-cpp
178+
# #### Compile and install the main project
180179

181-
# Finally we can install `google-cloud-cpp`.
180+
# We can now compile, test, and install `google-cloud-cpp`.
182181

183182
# ```bash
184-
WORKDIR /var/tmp/build/google-cloud-cpp
185-
COPY . /var/tmp/build/google-cloud-cpp
183+
WORKDIR /home/build/project
184+
COPY . /home/build/project
186185
RUN cmake -H. -Bcmake-out
187-
RUN cmake --build cmake-out -- -j ${NCPU:-4}
188-
WORKDIR /var/tmp/build/google-cloud-cpp/cmake-out
189-
RUN ctest --output-on-failure
186+
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
187+
WORKDIR /home/build/project/cmake-out
188+
RUN ctest -LE integration-tests --output-on-failure
190189
RUN cmake --build . --target install
191190
# ```
192191

193192
## [END INSTALL.md]
194193

194+
ENV PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig
195+
195196
# Verify that the installed files are actually usable
196197
WORKDIR /home/build/test-install-plain-make
197198
COPY ci/test-install /home/build/test-install-plain-make

0 commit comments

Comments
 (0)