<commit_before># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:bionic AS google-cloud-cpp-dependencies

RUN apt update && \
    apt install -y build-essential cmake git gcc g++ cmake \
        libc-ares-dev libc-ares2 libcurl4-openssl-dev libssl-dev make \
        pkg-config tar wget zlib1g-dev

# #### crc32c

WORKDIR /var/tmp/build
RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz
RUN tar -xf 1.0.6.tar.gz
WORKDIR /var/tmp/build/crc32c-1.0.6
RUN cmake \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=yes \
      -DCRC32C_BUILD_TESTS=OFF \
      -DCRC32C_BUILD_BENCHMARKS=OFF \
      -DCRC32C_USE_GLOG=OFF \
      -H. -Bcmake-out/crc32c
RUN cmake --build cmake-out/crc32c --target install -- -j $(nproc)
RUN ldconfig

# #### Protobuf

WORKDIR /var/tmp/build
RUN wget -q https://github.com/google/protobuf/archive/v3.7.1.tar.gz
RUN tar -xf v3.7.1.tar.gz
WORKDIR /var/tmp/build/protobuf-3.7.1/cmake
RUN cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=yes \
        -Dprotobuf_BUILD_TESTS=OFF \
        -H. -Bcmake-out
RUN cmake --build cmake-out --target install -- -j $(nproc)
RUN ldconfig

# #### gRPC

WORKDIR /var/tmp/build
RUN wget -q https://github.com/grpc/grpc/archive/v1.21.0.tar.gz
RUN tar -xf v1.21.0.tar.gz
WORKDIR /var/tmp/build/grpc-1.21.0
RUN make -j $(nproc)
RUN make install
RUN ldconfig

# Get the source code

FROM google-cloud-cpp-dependencies AS google-cloud-cpp-build

WORKDIR /w
COPY . /w

# #### google-cloud-cpp

ARG CMAKE_BUILD_TYPE=Release
ARG SHORT_SHA=""

RUN cmake -H. -Bcmake-out \
    -DBUILD_TESTING=OFF \
    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
    -DGOOGLE_CLOUD_CPP_BUILD_METADATA=${SHORT_SHA}
RUN cmake --build cmake-out -- -j $(nproc)
WORKDIR /w/cmake-out
RUN cmake --build . --target install

# ================================================================
<commit_msg>bug: Fix build for continuous benchmark tests. (#2987)<commit_after># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:bionic AS google-cloud-cpp-dependencies

RUN apt update && \
    apt install -y build-essential cmake git gcc g++ cmake \
        libc-ares-dev libc-ares2 libcurl4-openssl-dev libssl-dev make \
        pkg-config tar wget zlib1g-dev

# #### crc32c

WORKDIR /var/tmp/build
RUN wget -q https://github.com/google/crc32c/archive/1.0.6.tar.gz
RUN tar -xf 1.0.6.tar.gz
WORKDIR /var/tmp/build/crc32c-1.0.6
RUN cmake \
      -DCMAKE_BUILD_TYPE=Release \
      -DBUILD_SHARED_LIBS=yes \
      -DCRC32C_BUILD_TESTS=OFF \
      -DCRC32C_BUILD_BENCHMARKS=OFF \
      -DCRC32C_USE_GLOG=OFF \
      -H. -Bcmake-out/crc32c
RUN cmake --build cmake-out/crc32c --target install -- -j $(nproc)
RUN ldconfig

# #### Protobuf

WORKDIR /var/tmp/build
RUN wget -q https://github.com/google/protobuf/archive/v3.7.1.tar.gz
RUN tar -xf v3.7.1.tar.gz
WORKDIR /var/tmp/build/protobuf-3.7.1/cmake
RUN cmake \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=yes \
        -Dprotobuf_BUILD_TESTS=OFF \
        -H. -Bcmake-out
RUN cmake --build cmake-out --target install -- -j $(nproc)
RUN ldconfig

# #### gRPC

WORKDIR /var/tmp/build
RUN wget -q https://github.com/grpc/grpc/archive/v1.21.0.tar.gz
RUN tar -xf v1.21.0.tar.gz
WORKDIR /var/tmp/build/grpc-1.21.0
RUN make -j $(nproc)
RUN make install
RUN ldconfig

# #### googleapis

WORKDIR /var/tmp/build
RUN wget -q https://github.com/googleapis/cpp-cmakefiles/archive/v0.1.3.tar.gz
RUN tar -xf v0.1.3.tar.gz
WORKDIR /var/tmp/build/cpp-cmakefiles-0.1.3
RUN cmake \
    -DBUILD_SHARED_LIBS=YES \
    -H. -Bcmake-out
RUN cmake --build cmake-out --target install -- -j ${NCPU:-4}
RUN ldconfig

# Get the source code

FROM google-cloud-cpp-dependencies AS google-cloud-cpp-build

WORKDIR /w
COPY . /w

# #### google-cloud-cpp

ARG CMAKE_BUILD_TYPE=Release
ARG SHORT_SHA=""

RUN cmake -H. -Bcmake-out \
    -DBUILD_TESTING=OFF \
    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
    -DGOOGLE_CLOUD_CPP_BUILD_METADATA=${SHORT_SHA}
RUN cmake --build cmake-out -- -j $(nproc)
WORKDIR /w/cmake-out
RUN cmake --build . --target install

# ================================================================

{'fraction_non_alphanumeric': 0.14458991143627262, 'fraction_numerical': 0.02464381979206777, 'mean_word_length': 3.1132224861441014, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1517186', 'n_tokens_mistral': 1965, 'n_tokens_neox': 1871, 'n_words': 493}