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

Commit 08ce6e0

Browse files
author
Takashi Matsuo
authored
Add install test (#8)
* Add first install test * Fix style * Split the test into spanner and bigtable * Correct indentation * Add other distros, shared lib test, and kokoro configs * Fix style
1 parent 015e0a3 commit 08ce6e0

28 files changed

+832
-0
lines changed
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
FROM centos:7 AS devtools
16+
17+
# Please keep the formatting in these commands, it is optimized to cut & paste
18+
# into the INSTALL.md file.
19+
20+
## [START INSTALL.md]
21+
22+
# First install the development tools and OpenSSL. The development tools
23+
# distributed with CentOS (notably CMake) are too old to build
24+
# `cpp-cmakefiles`. In these instructions, we use `cmake3` obtained from
25+
# [Software Collections](https://www.softwarecollections.org/).
26+
27+
# ```bash
28+
RUN rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
29+
RUN yum install -y centos-release-scl
30+
RUN yum-config-manager --enable rhel-server-rhscl-7-rpms
31+
RUN yum makecache && \
32+
yum install -y automake cmake3 curl-devel gcc gcc-c++ git libtool \
33+
make openssl-devel pkgconfig tar wget which zlib-devel
34+
RUN ln -sf /usr/bin/cmake3 /usr/bin/cmake && ln -sf /usr/bin/ctest3 /usr/bin/ctest
35+
# ```
36+
37+
# #### Protobuf
38+
39+
# Likewise, manually install protobuf:
40+
41+
# ```bash
42+
WORKDIR /var/tmp/build
43+
RUN wget -q https://github.com/google/protobuf/archive/v3.9.0.tar.gz
44+
RUN tar -xf v3.9.0.tar.gz
45+
WORKDIR /var/tmp/build/protobuf-3.9.0/cmake
46+
RUN cmake \
47+
-DCMAKE_BUILD_TYPE=Release \
48+
-DBUILD_SHARED_LIBS=yes \
49+
-Dprotobuf_BUILD_TESTS=OFF \
50+
-H. -Bcmake-out
51+
RUN cmake --build cmake-out --target install -- -j $(nproc)
52+
RUN ldconfig
53+
# ```
54+
55+
# #### c-ares
56+
57+
# Recent versions of gRPC require c-ares >= 1.11, while CentOS-7
58+
# distributes c-ares-1.10. Manually install a newer version:
59+
60+
# ```bash
61+
WORKDIR /var/tmp/build
62+
RUN wget -q https://github.com/c-ares/c-ares/archive/cares-1_15_0.tar.gz
63+
RUN tar -xf cares-1_15_0.tar.gz
64+
WORKDIR /var/tmp/build/c-ares-cares-1_15_0
65+
RUN ./buildconf && ./configure && make -j $(nproc)
66+
RUN make install
67+
RUN ldconfig
68+
# ```
69+
70+
# #### gRPC
71+
72+
# Can be manually installed using:
73+
74+
# ```bash
75+
WORKDIR /var/tmp/build
76+
RUN wget -q https://github.com/grpc/grpc/archive/v1.22.0.tar.gz
77+
RUN tar -xf v1.22.0.tar.gz
78+
WORKDIR /var/tmp/build/grpc-1.22.0
79+
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
80+
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
81+
ENV PATH=/usr/local/bin:${PATH}
82+
RUN make -j $(nproc)
83+
RUN make install
84+
RUN ldconfig
85+
# ```
86+
87+
FROM devtools AS install
88+
89+
# #### googleapis
90+
91+
# Finally we can install `googleapis`.
92+
93+
# ```bash
94+
WORKDIR /home/build/cpp-cmakefiles
95+
COPY . /home/build/cpp-cmakefiles
96+
RUN cmake -H. -Bcmake-out
97+
RUN cmake --build cmake-out -- -j $(nproc)
98+
WORKDIR /home/build/cpp-cmakefiles/cmake-out
99+
RUN cmake --build . --target install
100+
# ```
101+
102+
## [END INSTALL.md]
103+
104+
# Verify that the installed files are actually usable
105+
RUN /home/build/cpp-cmakefiles/ci/test-install/compile-test-projects.sh
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
FROM fedora:30 AS devtools
16+
17+
# Please keep the formatting below, it is used by `extract-install.md`
18+
# to generate the contents of the top-level INSTALL.md.
19+
20+
## [START INSTALL.md]
21+
22+
# Install the minimal development tools:
23+
24+
# ```bash
25+
RUN dnf makecache && \
26+
dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
27+
zlib-devel
28+
# ```
29+
30+
# Fedora includes packages for gRPC, libcurl, and OpenSSL that are recent enough
31+
# for `cpp-cmakefiles`. Install these packages and additional development
32+
# tools to compile the dependencies:
33+
34+
# ```bash
35+
RUN dnf makecache && \
36+
dnf install -y grpc-devel grpc-plugins \
37+
libcurl-devel protobuf-compiler tar wget zlib-devel
38+
# ```
39+
40+
FROM devtools AS install
41+
42+
# #### googleapis
43+
44+
# We can now compile and install `googleapis`.
45+
46+
# ```bash
47+
WORKDIR /home/build/cpp-cmakefiles
48+
COPY . /home/build/cpp-cmakefiles
49+
RUN cmake -H. -Bcmake-out
50+
RUN cmake --build cmake-out -- -j $(nproc)
51+
WORKDIR /home/build/cpp-cmakefiles/cmake-out
52+
RUN cmake --build . --target install
53+
# ```
54+
55+
## [END INSTALL.md]
56+
57+
# Verify that the installed files are actually usable
58+
RUN /home/build/cpp-cmakefiles/ci/test-install/compile-test-projects.sh
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
FROM fedora:30 AS devtools
16+
17+
# Please keep the formatting below, it is used by `extract-install.md`
18+
# to generate the contents of the top-level INSTALL.md.
19+
20+
## [START INSTALL.md]
21+
22+
# Install the minimal development tools:
23+
24+
# ```bash
25+
RUN dnf makecache && \
26+
dnf install -y cmake gcc-c++ git make openssl-devel pkgconfig \
27+
zlib-devel
28+
# ```
29+
30+
# Fedora includes packages for gRPC, libcurl, and OpenSSL that are recent enough
31+
# for `cpp-cmakefiles`. Install these packages and additional development
32+
# tools to compile the dependencies:
33+
34+
# ```bash
35+
RUN dnf makecache && \
36+
dnf install -y grpc-devel grpc-plugins \
37+
libcurl-devel protobuf-compiler tar wget zlib-devel
38+
# ```
39+
40+
FROM devtools AS install
41+
42+
# #### googleapis
43+
44+
# We can now compile and install `googleapis` as shared library.
45+
46+
# ```bash
47+
WORKDIR /home/build/cpp-cmakefiles
48+
COPY . /home/build/cpp-cmakefiles
49+
RUN cmake -H. -Bcmake-out -DBUILD_SHARED_LIBS=yes
50+
RUN cmake --build cmake-out -- -j $(nproc)
51+
WORKDIR /home/build/cpp-cmakefiles/cmake-out
52+
RUN cmake --build . --target install
53+
# ```
54+
55+
## [END INSTALL.md]
56+
57+
# Verify that the installed files are actually usable
58+
RUN /home/build/cpp-cmakefiles/ci/test-install/compile-test-projects.sh
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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+
FROM opensuse/leap:latest AS devtools
16+
17+
## [START INSTALL.md]
18+
19+
# Install the minimal development tools:
20+
21+
# ```bash
22+
RUN zypper refresh && \
23+
zypper install --allow-downgrade -y cmake gcc gcc-c++ git gzip \
24+
libcurl-devel libopenssl-devel make tar wget
25+
# ```
26+
27+
# #### Protobuf
28+
29+
# OpenSUSE Leap includes a package for protobuf-2.6, but this is too old to
30+
# support the Google Cloud Platform proto files, or to support gRPC for that
31+
# matter. Manually install protobuf:
32+
33+
# ```bash
34+
WORKDIR /var/tmp/build
35+
RUN wget -q https://github.com/google/protobuf/archive/v3.9.0.tar.gz
36+
RUN tar -xf v3.9.0.tar.gz
37+
WORKDIR /var/tmp/build/protobuf-3.9.0/cmake
38+
RUN cmake \
39+
-DCMAKE_BUILD_TYPE=Release \
40+
-DBUILD_SHARED_LIBS=yes \
41+
-Dprotobuf_BUILD_TESTS=OFF \
42+
-H. -Bcmake-out
43+
RUN cmake --build cmake-out --target install -- -j $(nproc)
44+
RUN ldconfig
45+
# ```
46+
47+
# #### c-ares
48+
49+
# Recent versions of gRPC require c-ares >= 1.11, while OpenSUSE Leap
50+
# distributes c-ares-1.9. We need some additional development tools to compile
51+
# this library:
52+
53+
# ```bash
54+
RUN zypper refresh && \
55+
zypper install -y automake libtool
56+
# ```
57+
58+
# Manually install a newer version:
59+
60+
# ```bash
61+
WORKDIR /var/tmp/build
62+
RUN wget -q https://github.com/c-ares/c-ares/archive/cares-1_15_0.tar.gz
63+
RUN tar -xf cares-1_15_0.tar.gz
64+
WORKDIR /var/tmp/build/c-ares-cares-1_15_0
65+
RUN ./buildconf && ./configure && make -j $(nproc)
66+
RUN make install
67+
RUN ldconfig
68+
# ```
69+
70+
# #### gRPC
71+
72+
# The gRPC Makefile uses `which` to determine whether the compiler is available.
73+
# Install this command for the extremely rare case where it may be missing from
74+
# your workstation or build server:
75+
76+
# ```bash
77+
RUN zypper refresh && \
78+
zypper install -y which
79+
# ```
80+
81+
# Then gRPC can be manually installed using:
82+
83+
# ```bash
84+
WORKDIR /var/tmp/build
85+
RUN wget -q https://github.com/grpc/grpc/archive/v1.22.0.tar.gz
86+
RUN tar -xf v1.22.0.tar.gz
87+
WORKDIR /var/tmp/build/grpc-1.22.0
88+
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig
89+
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib64
90+
ENV PATH=/usr/local/bin:${PATH}
91+
RUN make -j $(nproc)
92+
RUN make install
93+
RUN ldconfig
94+
# ```
95+
96+
FROM devtools AS install
97+
98+
# #### googleapis
99+
100+
# We can now compile and install `googleapis`.
101+
102+
# ```bash
103+
WORKDIR /home/build/cpp-cmakefiles
104+
COPY . /home/build/cpp-cmakefiles
105+
RUN cmake -H. -Bcmake-out
106+
RUN cmake --build cmake-out -- -j $(nproc)
107+
WORKDIR /home/build/cpp-cmakefiles/cmake-out
108+
RUN cmake --build . --target install
109+
# ```
110+
111+
## [END INSTALL.md]
112+
113+
# Verify that the installed files are actually usable
114+
RUN /home/build/cpp-cmakefiles/ci/test-install/compile-test-projects.sh
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Copyright 2018 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+
FROM opensuse/tumbleweed:latest AS devtools
16+
17+
## [START INSTALL.md]
18+
19+
# Install the minimal development tools:
20+
21+
# ```bash
22+
RUN zypper refresh && \
23+
zypper install --allow-downgrade -y cmake gcc gcc-c++ git gzip \
24+
libcurl-devel libopenssl-devel make tar wget zlib-devel
25+
# ```
26+
27+
# OpenSUSE:tumbleweed provides packages for gRPC, libcurl, and protobuf, and the
28+
# versions of these packages are recent enough to support the Google Cloud
29+
# Platform proto files.
30+
31+
# ```bash
32+
RUN zypper refresh && \
33+
zypper install -y grpc-devel gzip libcurl-devel pkg-config tar wget
34+
# ```
35+
36+
FROM devtools AS install
37+
38+
# #### googleapis
39+
40+
# We can now compile and install `googleapis`.
41+
42+
# ```bash
43+
WORKDIR /home/build/cpp-cmakefiles
44+
COPY . /home/build/cpp-cmakefiles
45+
RUN cmake -H. -Bcmake-out
46+
RUN cmake --build cmake-out -- -j $(nproc)
47+
WORKDIR /home/build/cpp-cmakefiles/cmake-out
48+
RUN cmake --build . --target install
49+
# ```
50+
51+
## [END INSTALL.md]
52+
53+
# Verify that the installed files are actually usable
54+
RUN /home/build/cpp-cmakefiles/ci/test-install/compile-test-projects.sh

0 commit comments

Comments
 (0)