Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit da2c79b

Browse files
authored
doc: simplify install instructions (#1268)
When installing the library, do not run the unit tests or benchmarks. This removes two steps from the installation instructions, even the more difficult platforms have about 10 steps, so 2 steps is a significant change. This test theoretically reduces the testing coverage, as it disables unit tests in a number of platforms. We think the risk is low, as the same unit tests pass in many other builds, and we are running at least one smoke test for the `ci/kokoro/install` builds.
1 parent eb9fa03 commit da2c79b

11 files changed

+64
-735
lines changed

INSTALL.md

Lines changed: 24 additions & 336 deletions
Large diffs are not rendered by default.

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

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

29+
read_into_variable INSTALL_GOOGLE_CLOUD_CPP_COMMON_FROM_SOURCE <<'_EOF_'
30+
WORKDIR /var/tmp/build
31+
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
32+
tar -xf v0.19.0.tar.gz && \
33+
cd google-cloud-cpp-common-0.19.0 && \
34+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
35+
cmake --build cmake-out -- -j ${NCPU:-4} && \
36+
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
37+
ldconfig
38+
_EOF_
39+
2940
BUILD_AND_TEST_PROJECT_FRAGMENT=$(replace_fragments \
3041
"INSTALL_CPP_CMAKEFILES_FROM_SOURCE" \
3142
"INSTALL_GOOGLETEST_FROM_SOURCE" \
@@ -39,23 +50,6 @@ BUILD_AND_TEST_PROJECT_FRAGMENT=$(replace_fragments \
3950
@INSTALL_CPP_CMAKEFILES_FROM_SOURCE@
4051
# ```
4152
42-
# #### googletest
43-
44-
# We need a recent version of GoogleTest to compile the unit and integration
45-
# tests.
46-
47-
# ```bash
48-
@INSTALL_GOOGLETEST_FROM_SOURCE@
49-
# ```
50-
51-
# #### benchmark
52-
53-
# We need a recent version of the Google microbenchmark support library.
54-
55-
# ```bash
56-
@INSTALL_GOOGLE_BENCHMARK_FROM_SOURCE@
57-
# ```
58-
5953
# #### google-cloud-cpp-common
6054
6155
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -74,11 +68,9 @@ FROM devtools AS install
7468
# ```bash
7569
WORKDIR /home/build/project
7670
COPY . /home/build/project
77-
RUN cmake -H. -Bcmake-out
71+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
7872
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
79-
WORKDIR /home/build/project/cmake-out
80-
RUN ctest -LE integration-tests --output-on-failure
81-
RUN cmake --build . --target install
73+
RUN cmake --build cmake-out --target install
8274
# ```
8375
8476
## [END INSTALL.md]

ci/kokoro/install/Dockerfile.centos-7

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -116,41 +116,6 @@ RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.4.1.tar.gz &
116116
ldconfig
117117
# ```
118118

119-
# #### googletest
120-
121-
# We need a recent version of GoogleTest to compile the unit and integration
122-
# tests.
123-
124-
# ```bash
125-
WORKDIR /var/tmp/build
126-
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
127-
tar -xf release-1.10.0.tar.gz && \
128-
cd googletest-release-1.10.0 && \
129-
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
130-
cmake --build cmake-out -- -j ${NCPU:-4} && \
131-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
132-
ldconfig
133-
# ```
134-
135-
# #### benchmark
136-
137-
# We need a recent version of the Google microbenchmark support library.
138-
139-
# ```bash
140-
WORKDIR /var/tmp/build
141-
RUN wget -q https://github.com/google/benchmark/archive/v1.5.0.tar.gz && \
142-
tar -xf v1.5.0.tar.gz && \
143-
cd benchmark-1.5.0 && \
144-
cmake \
145-
-DCMAKE_BUILD_TYPE="Release" \
146-
-DBUILD_SHARED_LIBS=yes \
147-
-DBENCHMARK_ENABLE_TESTING=OFF \
148-
-H. -Bcmake-out && \
149-
cmake --build cmake-out -- -j ${NCPU:-4} && \
150-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
151-
ldconfig
152-
# ```
153-
154119
# #### google-cloud-cpp-common
155120

156121
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -161,9 +126,7 @@ WORKDIR /var/tmp/build
161126
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
162127
tar -xf v0.19.0.tar.gz && \
163128
cd google-cloud-cpp-common-0.19.0 && \
164-
cmake -H. -Bcmake-out \
165-
-DBUILD_TESTING=OFF \
166-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
129+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
167130
cmake --build cmake-out -- -j ${NCPU:-4} && \
168131
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
169132
ldconfig
@@ -178,11 +141,9 @@ FROM devtools AS install
178141
# ```bash
179142
WORKDIR /home/build/project
180143
COPY . /home/build/project
181-
RUN cmake -H. -Bcmake-out
144+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
182145
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
183-
WORKDIR /home/build/project/cmake-out
184-
RUN ctest -LE integration-tests --output-on-failure
185-
RUN cmake --build . --target install
146+
RUN cmake --build cmake-out --target install
186147
# ```
187148

188149
## [END INSTALL.md]

ci/kokoro/install/Dockerfile.centos-8

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -95,41 +95,6 @@ RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.4.1.tar.gz &
9595
ldconfig
9696
# ```
9797

98-
# #### googletest
99-
100-
# We need a recent version of GoogleTest to compile the unit and integration
101-
# tests.
102-
103-
# ```bash
104-
WORKDIR /var/tmp/build
105-
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
106-
tar -xf release-1.10.0.tar.gz && \
107-
cd googletest-release-1.10.0 && \
108-
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
109-
cmake --build cmake-out -- -j ${NCPU:-4} && \
110-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
111-
ldconfig
112-
# ```
113-
114-
# #### benchmark
115-
116-
# We need a recent version of the Google microbenchmark support library.
117-
118-
# ```bash
119-
WORKDIR /var/tmp/build
120-
RUN wget -q https://github.com/google/benchmark/archive/v1.5.0.tar.gz && \
121-
tar -xf v1.5.0.tar.gz && \
122-
cd benchmark-1.5.0 && \
123-
cmake \
124-
-DCMAKE_BUILD_TYPE="Release" \
125-
-DBUILD_SHARED_LIBS=yes \
126-
-DBENCHMARK_ENABLE_TESTING=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-
13398
# #### google-cloud-cpp-common
13499

135100
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -140,9 +105,7 @@ WORKDIR /var/tmp/build
140105
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
141106
tar -xf v0.19.0.tar.gz && \
142107
cd google-cloud-cpp-common-0.19.0 && \
143-
cmake -H. -Bcmake-out \
144-
-DBUILD_TESTING=OFF \
145-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
108+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
146109
cmake --build cmake-out -- -j ${NCPU:-4} && \
147110
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
148111
ldconfig
@@ -157,11 +120,9 @@ FROM devtools AS install
157120
# ```bash
158121
WORKDIR /home/build/project
159122
COPY . /home/build/project
160-
RUN cmake -H. -Bcmake-out
123+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
161124
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
162-
WORKDIR /home/build/project/cmake-out
163-
RUN ctest -LE integration-tests --output-on-failure
164-
RUN cmake --build . --target install
125+
RUN cmake --build cmake-out --target install
165126
# ```
166127

167128
## [END INSTALL.md]

ci/kokoro/install/Dockerfile.debian-buster

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -56,41 +56,6 @@ RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.4.1.tar.gz &
5656
ldconfig
5757
# ```
5858

59-
# #### googletest
60-
61-
# We need a recent version of GoogleTest to compile the unit and integration
62-
# tests.
63-
64-
# ```bash
65-
WORKDIR /var/tmp/build
66-
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
67-
tar -xf release-1.10.0.tar.gz && \
68-
cd googletest-release-1.10.0 && \
69-
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
70-
cmake --build cmake-out -- -j ${NCPU:-4} && \
71-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
72-
ldconfig
73-
# ```
74-
75-
# #### benchmark
76-
77-
# We need a recent version of the Google microbenchmark support library.
78-
79-
# ```bash
80-
WORKDIR /var/tmp/build
81-
RUN wget -q https://github.com/google/benchmark/archive/v1.5.0.tar.gz && \
82-
tar -xf v1.5.0.tar.gz && \
83-
cd benchmark-1.5.0 && \
84-
cmake \
85-
-DCMAKE_BUILD_TYPE="Release" \
86-
-DBUILD_SHARED_LIBS=yes \
87-
-DBENCHMARK_ENABLE_TESTING=OFF \
88-
-H. -Bcmake-out && \
89-
cmake --build cmake-out -- -j ${NCPU:-4} && \
90-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
91-
ldconfig
92-
# ```
93-
9459
# #### google-cloud-cpp-common
9560

9661
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -101,9 +66,7 @@ WORKDIR /var/tmp/build
10166
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
10267
tar -xf v0.19.0.tar.gz && \
10368
cd google-cloud-cpp-common-0.19.0 && \
104-
cmake -H. -Bcmake-out \
105-
-DBUILD_TESTING=OFF \
106-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
69+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
10770
cmake --build cmake-out -- -j ${NCPU:-4} && \
10871
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
10972
ldconfig
@@ -118,11 +81,9 @@ FROM devtools AS install
11881
# ```bash
11982
WORKDIR /home/build/project
12083
COPY . /home/build/project
121-
RUN cmake -H. -Bcmake-out
84+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
12285
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
123-
WORKDIR /home/build/project/cmake-out
124-
RUN ctest -LE integration-tests --output-on-failure
125-
RUN cmake --build . --target install
86+
RUN cmake --build cmake-out --target install
12687
# ```
12788

12889
## [END INSTALL.md]

ci/kokoro/install/Dockerfile.debian-stretch

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -90,41 +90,6 @@ RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.4.1.tar.gz &
9090
ldconfig
9191
# ```
9292

93-
# #### googletest
94-
95-
# We need a recent version of GoogleTest to compile the unit and integration
96-
# tests.
97-
98-
# ```bash
99-
WORKDIR /var/tmp/build
100-
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
101-
tar -xf release-1.10.0.tar.gz && \
102-
cd googletest-release-1.10.0 && \
103-
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -H. -Bcmake-out && \
104-
cmake --build cmake-out -- -j ${NCPU:-4} && \
105-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
106-
ldconfig
107-
# ```
108-
109-
# #### benchmark
110-
111-
# We need a recent version of the Google microbenchmark support library.
112-
113-
# ```bash
114-
WORKDIR /var/tmp/build
115-
RUN wget -q https://github.com/google/benchmark/archive/v1.5.0.tar.gz && \
116-
tar -xf v1.5.0.tar.gz && \
117-
cd benchmark-1.5.0 && \
118-
cmake \
119-
-DCMAKE_BUILD_TYPE="Release" \
120-
-DBUILD_SHARED_LIBS=yes \
121-
-DBENCHMARK_ENABLE_TESTING=OFF \
122-
-H. -Bcmake-out && \
123-
cmake --build cmake-out -- -j ${NCPU:-4} && \
124-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
125-
ldconfig
126-
# ```
127-
12893
# #### google-cloud-cpp-common
12994

13095
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -135,9 +100,7 @@ WORKDIR /var/tmp/build
135100
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
136101
tar -xf v0.19.0.tar.gz && \
137102
cd google-cloud-cpp-common-0.19.0 && \
138-
cmake -H. -Bcmake-out \
139-
-DBUILD_TESTING=OFF \
140-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
103+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
141104
cmake --build cmake-out -- -j ${NCPU:-4} && \
142105
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
143106
ldconfig
@@ -152,11 +115,9 @@ FROM devtools AS install
152115
# ```bash
153116
WORKDIR /home/build/project
154117
COPY . /home/build/project
155-
RUN cmake -H. -Bcmake-out
118+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
156119
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
157-
WORKDIR /home/build/project/cmake-out
158-
RUN ctest -LE integration-tests --output-on-failure
159-
RUN cmake --build . --target install
120+
RUN cmake --build cmake-out --target install
160121
# ```
161122

162123
## [END INSTALL.md]

ci/kokoro/install/Dockerfile.fedora

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -64,41 +64,6 @@ RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.4.1.tar.gz &
6464
ldconfig
6565
# ```
6666

67-
# #### googletest
68-
69-
# We need a recent version of GoogleTest to compile the unit and integration
70-
# tests.
71-
72-
# ```bash
73-
WORKDIR /var/tmp/build
74-
RUN wget -q https://github.com/google/googletest/archive/release-1.10.0.tar.gz && \
75-
tar -xf release-1.10.0.tar.gz && \
76-
cd googletest-release-1.10.0 && \
77-
cmake -DCMAKE_BUILD_TYPE="Release" -DBUILD_SHARED_LIBS=yes -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-
# #### benchmark
84-
85-
# We need a recent version of the Google microbenchmark support library.
86-
87-
# ```bash
88-
WORKDIR /var/tmp/build
89-
RUN wget -q https://github.com/google/benchmark/archive/v1.5.0.tar.gz && \
90-
tar -xf v1.5.0.tar.gz && \
91-
cd benchmark-1.5.0 && \
92-
cmake \
93-
-DCMAKE_BUILD_TYPE="Release" \
94-
-DBUILD_SHARED_LIBS=yes \
95-
-DBENCHMARK_ENABLE_TESTING=OFF \
96-
-H. -Bcmake-out && \
97-
cmake --build cmake-out -- -j ${NCPU:-4} && \
98-
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
99-
ldconfig
100-
# ```
101-
10267
# #### google-cloud-cpp-common
10368

10469
# The project also depends on google-cloud-cpp-common, the libraries shared by
@@ -109,9 +74,7 @@ WORKDIR /var/tmp/build
10974
RUN wget -q https://github.com/googleapis/google-cloud-cpp-common/archive/v0.19.0.tar.gz && \
11075
tar -xf v0.19.0.tar.gz && \
11176
cd google-cloud-cpp-common-0.19.0 && \
112-
cmake -H. -Bcmake-out \
113-
-DBUILD_TESTING=OFF \
114-
-DGOOGLE_CLOUD_CPP_TESTING_UTIL_ENABLE_INSTALL=ON && \
77+
cmake -H. -Bcmake-out -DBUILD_TESTING=OFF && \
11578
cmake --build cmake-out -- -j ${NCPU:-4} && \
11679
cmake --build cmake-out --target install -- -j ${NCPU:-4} && \
11780
ldconfig
@@ -126,11 +89,9 @@ FROM devtools AS install
12689
# ```bash
12790
WORKDIR /home/build/project
12891
COPY . /home/build/project
129-
RUN cmake -H. -Bcmake-out
92+
RUN cmake -H. -Bcmake-out -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
13093
RUN cmake --build cmake-out -- -j "${NCPU:-4}"
131-
WORKDIR /home/build/project/cmake-out
132-
RUN ctest -LE integration-tests --output-on-failure
133-
RUN cmake --build . --target install
94+
RUN cmake --build cmake-out --target install
13495
# ```
13596

13697
## [END INSTALL.md]

0 commit comments

Comments
 (0)