|
| 1 | +# Copyright 2023 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 | +# https://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:38 |
| 16 | +ARG NCPU=4 |
| 17 | +ARG ARCH=amd64 |
| 18 | + |
| 19 | +# Install the minimal packages needed to install Bazel, and then compile our |
| 20 | +# code. |
| 21 | +RUN dnf install -y clang diffutils findutils gcc-c++ git lcov libcxx-devel \ |
| 22 | + libcxxabi-devel libasan libubsan libtsan llvm patch python python3 \ |
| 23 | + python-pip tar unzip w3m wget which zip zlib-devel |
| 24 | + |
| 25 | +# Install the Python modules needed to run the storage emulator |
| 26 | +RUN dnf makecache && dnf install -y python3-devel |
| 27 | +RUN pip3 install --upgrade pip |
| 28 | +RUN pip3 install setuptools wheel |
| 29 | + |
| 30 | +# The Cloud Pub/Sub emulator needs Java, and so does `bazel coverage` :shrug: |
| 31 | +# Bazel needs the '-devel' version with javac. |
| 32 | +RUN dnf makecache && dnf install -y java-latest-openjdk-devel |
| 33 | + |
| 34 | +# Sets root's password to the empty string to enable users to get a root shell |
| 35 | +# inside the container with `su -` and no password. Sudo would not work because |
| 36 | +# we run these containers as the invoking user's uid, which does not exist in |
| 37 | +# the container's /etc/passwd file. |
| 38 | +RUN echo 'root:' | chpasswd |
| 39 | + |
| 40 | +WORKDIR /var/tmp/build |
| 41 | + |
| 42 | +# Install the Cloud SDK and some of the emulators. We use the emulators to run |
| 43 | +# integration tests for the client libraries. |
| 44 | +COPY . /var/tmp/ci |
| 45 | +WORKDIR /var/tmp/downloads |
| 46 | +ENV CLOUDSDK_PYTHON=python3 |
| 47 | +RUN /var/tmp/ci/install-cloud-sdk.sh |
| 48 | +ENV CLOUD_SDK_LOCATION=/usr/local/google-cloud-sdk |
| 49 | +ENV PATH=${CLOUD_SDK_LOCATION}/bin:${PATH} |
| 50 | + |
| 51 | +RUN curl -o /usr/bin/bazelisk -sSL "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/bazelisk-linux-${ARCH}" && \ |
| 52 | + chmod +x /usr/bin/bazelisk && \ |
| 53 | + ln -s /usr/bin/bazelisk /usr/bin/bazel |
| 54 | + |
| 55 | +# Download the packages needed to run Bigtable conformance tests. |
| 56 | +WORKDIR /var/tmp/downloads |
| 57 | +RUN wget -O go.tgz https://go.dev/dl/go1.20.5.linux-amd64.tar.gz |
| 58 | +RUN tar -C /usr/local/ -xzf go.tgz |
| 59 | +ENV GO_LOCATION=/usr/local/go |
| 60 | +ENV PATH=${GO_LOCATION}/bin:${PATH} |
| 61 | +RUN go version |
| 62 | +WORKDIR /var/tmp/downloads/cloud-bigtable-clients-test |
| 63 | +RUN curl -fsSL https://github.com/googleapis/cloud-bigtable-clients-test/archive/v0.0.1.tar.gz | \ |
| 64 | + tar -xzf - --strip-components=1 |
0 commit comments