perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

sandbox docker image error

Open koeichen opened this issue 6 years ago • 6 comments

docker image from

docker pull eu.gcr.io/perfetto-ci/sandbox@sha256:9855b3cad890963ed5a15fa801f83e91158809e429c759ebbd2f89816c73a1f5

fail to run with error

/ci/testrunner.sh: line 37: PERFETTO_TEST_GIT_REF: unbound variable

I look over the dockerfile and python code, and I didn't see any setting of global variable PERFETTO_TEST_GIT_REF

koeichen avatar Jul 28 '20 07:07 koeichen

by default the container will run the CI harness, which assumes a bunch of ENV vars are set. Just override the entry point and run bash -i so you get into interactive mode.

$ docker run -it -u perfetto eu.gcr.io/perfetto-ci/sandbox bash -i

primiano avatar Jul 28 '20 08:07 primiano

After start the images and enter container, how to start the ui part.

koeichen avatar Jul 28 '20 09:07 koeichen

Follow the instruction as usual: https://perfetto.dev/docs/contributing/build-instructions

git clone ... install-build-deps tools/ninja -C out/android ui

When you get to the run-web-server part, you'll need to export port 10000 from the container (so docker run needs an extra -P 10000 or something like that)

primiano avatar Jul 28 '20 10:07 primiano

anyhow, we just up-revved node and npm. Before you jump too deep into this docker thing, can you try syncing @ HEAD and see if the original issue went away? It seems fixed for us.

primiano avatar Jul 28 '20 10:07 primiano

still there are multiple error with npm.

npm ERR! [email protected] install: `node-gyp-build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

koeichen avatar Jul 29 '20 02:07 koeichen

I solve ui deployment by a dockerfile

FROM debian:latest
RUN set -ex; \
    export DEBIAN_FRONTEND=noninteractive; \
    echo deb http://deb.debian.org/debian buster-backports main > \
    /etc/apt/sources.list.d/backports.list; \
    apt-get update; \
    apt-get -y install python git curl sudo lz4 tar ccache tini libpulse0 \
    libgl1 libxml2 libc6-dev-i386 libtinfo5 gnupg2 \
    pkg-config zip g++ zlib1g-dev unzip python3 \
    python-distutils-extra python3-distutils; \
    apt-get -y install gcc-7 g++-7; \
    gcc-7 --version; \
    g++-7 --version; \
    apt-get -y -t buster-backports install clang-8; \
    clang-8 --version; \
    clang++-8 --version; \
    curl https://bootstrap.pypa.io/get-pip.py | python -; \
    pip install --quiet protobuf; \
    curl https://bootstrap.pypa.io/get-pip.py | python3 -; \
    pip3 install --quiet protobuf; \
    curl -LO https://github.com/bazelbuild/bazel/releases/download/0.29.1/bazel-0.29.1-installer-linux-x86_64.sh; \
    chmod +x bazel-*-installer-linux-x86_64.sh; \
    ./bazel-*-installer-linux-x86_64.sh; \
    rm bazel-*-installer-linux-x86_64.sh; \
    bazel version; \
    useradd -d /ci/ramdisk perfetto; \
    apt-get -y autoremove; \
    rm -rf /var/lib/apt/lists/* /usr/share/man/* /usr/share/doc/*;
RUN mkdir workpath
WORKDIR /workpath
COPY perfetto ./perfetto
WORKDIR /workpath/perfetto
RUN tools/install-build-deps --ui
RUN tools/gn gen out/debug --args='is_debug=true'
RUN tools/ninja -C out/debug ui
ENTRYPOINT [ "./ui/run-dev-server", "out/debug" ]

koeichen avatar Jul 29 '20 06:07 koeichen