Skip to content

Commit 3b0f533

Browse files
authored
ci: automatically generate ci/kokoro/readme (#3241)
1 parent 7f07420 commit 3b0f533

18 files changed

+225
-164
lines changed

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -144,39 +144,34 @@ against the latest version of the SDK on each commit and PR.
144144

145145
### CentOS (7)
146146

147-
[![Kokoro install centos status][kokoro-install-centos-shield]][kokoro-install-centos-link]
147+
[![Kokoro install centos-7 status][kokoro-install-centos-7-shield]][kokoro-install-centos-7-link]
148148

149-
[kokoro-install-centos-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-centos.svg
150-
[kokoro-install-centos-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-centos-link.html
149+
[kokoro-install-centos-7-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-centos-7.svg
150+
[kokoro-install-centos-7-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-centos-7-link.html
151151

152-
The development tools distributed with CentOS (notably CMake) are too old to
153-
build `google-cloud-cpp`. In these instructions, we use `cmake3` obtained from
152+
Install the development tools and OpenSSL. The development tools distributed
153+
with CentOS (notably CMake) are too old to build the
154+
`google-cloud-cpp` project. We recommend you install cmake3 from
154155
[Software Collections](https://www.softwarecollections.org/).
155156

156157
```bash
157-
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
158+
sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
158159
sudo yum install -y centos-release-scl
159160
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms
160161
sudo yum makecache && \
161162
sudo yum install -y automake cmake3 curl-devel gcc gcc-c++ git libtool \
162163
make openssl-devel pkgconfig tar wget which zlib-devel
163-
ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest
164+
sudo ln -sf /usr/bin/cmake3 /usr/bin/cmake && sudo ln -sf /usr/bin/ctest3 /usr/bin/ctest
164165
```
165166

166167
### Debian (Stretch)
167168

168-
[![Kokoro install debian status][kokoro-install-debian-shield]][kokoro-install-debian-link]
169+
[![Kokoro install debian-stretch status][kokoro-install-debian-stretch-shield]][kokoro-install-debian-stretch-link]
169170

170-
[kokoro-install-debian-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-debian.svg
171-
[kokoro-install-debian-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-debian-link.html
171+
[kokoro-install-debian-stretch-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-debian-stretch.svg
172+
[kokoro-install-debian-stretch-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-debian-stretch-link.html
172173

173-
On Debian Stretch, libcurl links against openssl-1.0.2, and one must link
174-
against the same version or risk an inconsistent configuration of the library.
175-
This is especially important for multi-threaded applications, as openssl-1.0.2
176-
requires explicitly setting locking callbacks. Therefore, to use libcurl one
177-
must link against openssl-1.0.2. To do so, we need to install libssl1.0-dev.
178-
Note that this removes libssl-dev if you have it installed already, and would
179-
prevent you from compiling against openssl-1.1.0.
174+
First install the development tools.
180175

181176
```bash
182177
sudo apt update && \
@@ -192,6 +187,8 @@ sudo apt install -y build-essential cmake git gcc g++ cmake \
192187
[kokoro-install-fedora-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-fedora.svg
193188
[kokoro-install-fedora-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-fedora-link.html
194189

190+
Install the minimal development tools:
191+
195192
```bash
196193
sudo dnf makecache && \
197194
sudo dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
@@ -200,10 +197,12 @@ sudo dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
200197

201198
### openSUSE (Tumbleweed)
202199

203-
[![Kokoro install opensuse status][kokoro-install-opensuse-shield]][kokoro-install-opensuse-link]
200+
[![Kokoro install opensuse-tumbleweed status][kokoro-install-opensuse-tumbleweed-shield]][kokoro-install-opensuse-tumbleweed-link]
201+
202+
[kokoro-install-opensuse-tumbleweed-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse-tumbleweed.svg
203+
[kokoro-install-opensuse-tumbleweed-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse-tumbleweed-link.html
204204

205-
[kokoro-install-opensuse-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse.svg
206-
[kokoro-install-opensuse-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse-link.html
205+
Install the minimal development tools:
207206

208207
```bash
209208
sudo zypper refresh && \
@@ -218,6 +217,8 @@ sudo zypper install --allow-downgrade -y cmake gcc gcc-c++ git gzip \
218217
[kokoro-install-opensuse-leap-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse-leap.svg
219218
[kokoro-install-opensuse-leap-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-opensuse-leap-link.html
220219

220+
Install the minimal development tools:
221+
221222
```bash
222223
sudo zypper refresh && \
223224
sudo zypper install --allow-downgrade -y cmake gcc gcc-c++ git gzip \
@@ -226,10 +227,12 @@ sudo zypper install --allow-downgrade -y cmake gcc gcc-c++ git gzip \
226227

227228
### Ubuntu (18.04 - Bionic Beaver)
228229

229-
[![Kokoro install ubuntu status][kokoro-install-ubuntu-shield]][kokoro-install-ubuntu-link]
230+
[![Kokoro install ubuntu-bionic status][kokoro-install-ubuntu-bionic-shield]][kokoro-install-ubuntu-bionic-link]
231+
232+
[kokoro-install-ubuntu-bionic-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-bionic.svg
233+
[kokoro-install-ubuntu-bionic-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-bionic-link.html
230234

231-
[kokoro-install-ubuntu-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu.svg
232-
[kokoro-install-ubuntu-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-link.html
235+
Install the minimal development tools:
233236

234237
```bash
235238
sudo apt update && \
@@ -245,6 +248,8 @@ sudo apt install -y build-essential cmake git gcc g++ cmake \
245248
[kokoro-install-ubuntu-xenial-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-xenial.svg
246249
[kokoro-install-ubuntu-xenial-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-xenial-link.html
247250

251+
Install the minimal development tools:
252+
248253
```bash
249254
sudo apt update && \
250255
sudo apt install -y build-essential cmake git gcc g++ cmake \
@@ -259,6 +264,8 @@ sudo apt install -y build-essential cmake git gcc g++ cmake \
259264
[kokoro-install-ubuntu-trusty-shield]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-trusty.svg
260265
[kokoro-install-ubuntu-trusty-link]: https://storage.googleapis.com/cloud-cpp-kokoro-status/kokoro-install-ubuntu-trusty-link.html
261266

267+
Install the minimal development tools.
268+
262269
We use the `ubuntu-toolchain-r` PPA to get a modern version of CMake:
263270

264271
```bash

ci/kokoro/readme/Dockerfile.centos-7

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,20 @@
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
17-
ARG NCPU=4
18-
19-
# Please keep the formatting in these commands, it is optimized to cut & paste
20-
# into the README.md file.
21-
22-
## [START INSTALL.md]
23-
24-
# First install the development tools and OpenSSL.
2523

2624
## [START README.md]
2725

28-
# The development tools distributed with CentOS (notably CMake) are too old to
29-
# build `google-cloud-cpp`. In these instructions, we use `cmake3` obtained from
26+
# Install the development tools and OpenSSL. The development tools distributed
27+
# with CentOS (notably CMake) are too old to build the
28+
# `google-cloud-cpp` project. We recommend you install cmake3 from
3029
# [Software Collections](https://www.softwarecollections.org/).
3130

3231
# ```bash
@@ -39,18 +38,13 @@ RUN yum makecache && \
3938
RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest
4039
# ```
4140

41+
## [END README.md]
42+
4243
FROM devtools AS readme
4344
ARG NCPU=4
4445

45-
## [START IGNORED]
46-
# Verify that the tools above are enough to compile google-cloud-cpp when using
47-
# the super build.
4846
WORKDIR /home/build/super
4947
COPY . /home/build/super
5048
RUN cmake -Hsuper -Bcmake-out \
5149
-DGOOGLE_CLOUD_CPP_EXTERNAL_PREFIX=$HOME/local
52-
RUN cmake --build cmake-out -- -j ${NCPU}
53-
# The tests will already be run as part of the build, no need to run it again.
54-
## [END IGNORED]
55-
56-
## [END README.md]
50+
RUN cmake --build cmake-out -- -j ${NCPU:-4}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Copyright 2019 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+
#
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+
21+
ARG DISTRO_VERSION=8
22+
FROM centos:${DISTRO_VERSION} AS devtools
23+
24+
## [START README.md]
25+
26+
# Install the development tools needed to compile the project:
27+
28+
# ```bash
29+
RUN dnf makecache && \
30+
dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
31+
zlib-devel
32+
# ```
33+
34+
## [END README.md]
35+
36+
FROM devtools AS readme
37+
ARG NCPU=4
38+
39+
WORKDIR /home/build/super
40+
COPY . /home/build/super
41+
RUN cmake -Hsuper -Bcmake-out \
42+
-DGOOGLE_CLOUD_CPP_EXTERNAL_PREFIX=$HOME/local
43+
RUN cmake --build cmake-out -- -j ${NCPU:-4}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright 2019 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+
#
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+
21+
ARG DISTRO_VERSION=buster
22+
FROM debian:${DISTRO_VERSION} AS devtools
23+
24+
## [START README.md]
25+
26+
# First install the development tools.
27+
28+
# ```bash
29+
RUN apt update && \
30+
apt install -y build-essential cmake git gcc g++ cmake \
31+
libc-ares-dev libc-ares2 libcurl4-openssl-dev libssl-dev make \
32+
pkg-config tar wget zlib1g-dev
33+
# ```
34+
35+
## [END README.md]
36+
37+
FROM devtools AS readme
38+
ARG NCPU=4
39+
40+
WORKDIR /home/build/super
41+
COPY . /home/build/super
42+
RUN cmake -Hsuper -Bcmake-out \
43+
-DGOOGLE_CLOUD_CPP_EXTERNAL_PREFIX=$HOME/local
44+
RUN cmake --build cmake-out -- -j ${NCPU:-4}

ci/kokoro/readme/Dockerfile.debian-stretch

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

15-
ARG DISTRO_VERSION=9
16-
FROM debian:${DISTRO_VERSION} AS devtools
17-
ARG NCPU=4
18-
19-
# Please keep the formatting in these commands, it is optimized to cut & paste
20-
# into the README.md file.
21-
22-
## [START INSTALL.md]
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+
#
2320

24-
# First install the development tools and libcurl.
21+
ARG DISTRO_VERSION=stretch
22+
FROM debian:${DISTRO_VERSION} AS devtools
2523

2624
## [START README.md]
2725

28-
# On Debian Stretch, libcurl links against openssl-1.0.2, and one must link
29-
# against the same version or risk an inconsistent configuration of the library.
30-
# This is especially important for multi-threaded applications, as openssl-1.0.2
31-
# requires explicitly setting locking callbacks. Therefore, to use libcurl one
32-
# must link against openssl-1.0.2. To do so, we need to install libssl1.0-dev.
33-
# Note that this removes libssl-dev if you have it installed already, and would
34-
# prevent you from compiling against openssl-1.1.0.
26+
# First install the development tools.
3527

3628
# ```bash
3729
RUN apt update && \
@@ -40,18 +32,13 @@ RUN apt update && \
4032
pkg-config tar wget zlib1g-dev
4133
# ```
4234

35+
## [END README.md]
36+
4337
FROM devtools AS readme
4438
ARG NCPU=4
4539

46-
## [START IGNORED]
47-
# Verify that the tools above are enough to compile google-cloud-cpp when using
48-
# the super build.
4940
WORKDIR /home/build/super
5041
COPY . /home/build/super
5142
RUN cmake -Hsuper -Bcmake-out \
5243
-DGOOGLE_CLOUD_CPP_EXTERNAL_PREFIX=$HOME/local
53-
RUN cmake --build cmake-out -- -j ${NCPU}
54-
# The tests will already be run as part of the build, no need to run it again.
55-
## [END IGNORED]
56-
57-
## [END README.md]
44+
RUN cmake --build cmake-out -- -j ${NCPU:-4}

ci/kokoro/readme/Dockerfile.fedora

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,38 +12,32 @@
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=30
1622
FROM fedora:${DISTRO_VERSION} AS devtools
17-
ARG NCPU=4
18-
19-
# Please keep the formatting below, it is used by `extract-readme.sh` and
20-
# `extract-install.md` to generate the contents of the top-level README.md and
21-
# INSTALL.md files.
2223

23-
## [START INSTALL.md]
24+
## [START README.md]
2425

2526
# Install the minimal development tools:
2627

27-
## [START README.md]
28-
2928
# ```bash
3029
RUN dnf makecache && \
3130
dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
3231
zlib-devel
3332
# ```
3433

34+
## [END README.md]
35+
3536
FROM devtools AS readme
3637
ARG NCPU=4
3738

38-
## [START IGNORED]
39-
# Verify that the tools above are enough to compile google-cloud-cpp when using
40-
# the super build.
4139
WORKDIR /home/build/super
4240
COPY . /home/build/super
4341
RUN cmake -Hsuper -Bcmake-out \
4442
-DGOOGLE_CLOUD_CPP_EXTERNAL_PREFIX=$HOME/local
45-
RUN cmake --build cmake-out -- -j ${NCPU}
46-
# The tests will already be run as part of the build, no need to run it again.
47-
## [END IGNORED]
48-
49-
## [END README.md]
43+
RUN cmake --build cmake-out -- -j ${NCPU:-4}

0 commit comments

Comments
 (0)