envoyproxy / nighthawk

L7 (HTTP/HTTPS/HTTP2/HTTP3) performance characterization tool
Apache License 2.0
360 stars 81 forks source link

Error building Nighthawk from source #1238

Closed iamredbull closed 1 month ago

iamredbull commented 1 month ago

Hello,

I'm trying to build Nighthawk from source following the guide in the Nighthawk documentation and I'm encountering the following error:

WARNING: Download from https://storage.googleapis.com/quiche-envoy-integration/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException Checksum was fc694942e8a7491dcc1dde1bddf48a31370a1f46fef862bc17acf07c34dc6325 but wanted 59f14d4fb373083b9dc8d389f16bbb817b5f936d1d436aa67e16eb6936028a51
ERROR: An error occurred during the fetch of repository 'com_googlesource_googleurl':
   Traceback (most recent call last):
    File "/home/bazeluser/.cache/bazel/_bazel_bazeluser/0184c79cfad8c1e11881b0d17cbd13ec/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
        download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://storage.googleapis.com/quiche-envoy-integration/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz] to /home/bazeluser/.cache/bazel/_bazel_bazeluser/0184c79cfad8c1e11881b0d17cbd13ec/external/com_googlesource_googleurl/temp14918003576183071673/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz: Checksum was fc694942e8a7491dcc1dde1bddf48a31370a1f46fef862bc17acf07c34dc6325 but wanted 59f14d4fb373083b9dc8d389f16bbb817b5f936d1d436aa67e16eb6936028a51
ERROR: /home/bazeluser/nighthawk/WORKSPACE:26:19: fetching http_archive rule //external:com_googlesource_googleurl: Traceback (most recent call last):
    File "/home/bazeluser/.cache/bazel/_bazel_bazeluser/0184c79cfad8c1e11881b0d17cbd13ec/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
        download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://storage.googleapis.com/quiche-envoy-integration/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz] to /home/bazeluser/.cache/bazel/_bazel_bazeluser/0184c79cfad8c1e11881b0d17cbd13ec/external/com_googlesource_googleurl/temp14918003576183071673/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz: Checksum was fc694942e8a7491dcc1dde1bddf48a31370a1f46fef862bc17acf07c34dc6325 but wanted 59f14d4fb373083b9dc8d389f16bbb817b5f936d1d436aa67e16eb6936028a51
ERROR: @com_googlesource_googleurl//build_config:system_icu :: Error loading option @com_googlesource_googleurl//build_config:system_icu: java.io.IOException: Error downloading [https://storage.googleapis.com/quiche-envoy-integration/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz] to /home/bazeluser/.cache/bazel/_bazel_bazeluser/0184c79cfad8c1e11881b0d17cbd13ec/external/com_googlesource_googleurl/temp14918003576183071673/dd4080fec0b443296c0ed0036e1e776df8813aa7.tar.gz: Checksum was fc694942e8a7491dcc1dde1bddf48a31370a1f46fef862bc17acf07c34dc6325 but wanted 59f14d4fb373083b9dc8d389f16bbb817b5f936d1d436aa67e16eb6936028a51
The command '/bin/sh -c /bin/bash ci/do_ci.sh build' returned a non-zero code: 2

Dockerfile

Here is the Dockerfile I am using to build Nighthawk:

FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin

RUN apt-get update && apt-get install -y \
    software-properties-common \
    autoconf \
    tzdata \
    automake \
    cmake \
    curl \
    libtool \
    make \
    ninja-build \
    patch \
    python3-pip \
    unzip \
    virtualenv \
    lld \
    clang \
    llvm \
    lldb \
    clang-format \
    clang-tidy \
    clang-tools \
    wget \
    git \
    sudo \
    && apt-get clean

RUN useradd -ms /bin/bash bazeluser

RUN echo 'bazeluser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

RUN wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-$([ $(uname -m) = "aarch64" ] && echo "arm64" || echo "amd64") \
    && chmod +x /usr/local/bin/bazel

RUN apt update 
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt install -y python3.12 python3.12-venv python3.12-distutils

WORKDIR /home/bazeluser

USER bazeluser

RUN git clone https://github.com/envoyproxy/nighthawk /home/bazeluser/nighthawk

WORKDIR /home/bazeluser/nighthawk

RUN echo "build --config=clang" >> user.bazelrc

RUN python3.12 -m venv /home/bazeluser/nighthawk_venv && \
    . /home/bazeluser/nighthawk_venv/bin/activate && \
    pip3 install -r tools/base/requirements.txt

ENV PATH="/home/bazeluser/nighthawk_venv/bin:$PATH"

RUN /bin/bash ci/do_ci.sh build

Can someone help me please? What do I need to do to build this from source?

Thank you!

mum4k commented 1 month ago

Looking at java.io.IOException: Error downloading..., this might have been a transient download error. When I tried to docker build your Dockerfile, the build succeeded with no errors:

$ docker build .

...

[7,619 / 7,619] checking cached actions
INFO: Elapsed time: 2458.638s, Critical Path: 284.45s
INFO: 7619 processes: 3189 internal, 4430 processwrapper-sandbox.
INFO: Build completed successfully, 7619 total actions
Successfully built 92ac3d8b1af3

Would you mind retrying?