Cannot run the docker-compose sample
yasharne opened this issue · 7 comments
Describe the bug
when I run docker compose up -d
I get the below error in python build process:
#0 31.93 Building wheels for collected packages: mprofile, pypprof, zprofile
#0 31.93 Building wheel for mprofile (setup.py): started
#0 32.52 Building wheel for mprofile (setup.py): finished with status 'error'
#0 32.52 error: subprocess-exited-with-error
#0 32.52
#0 32.52 × python setup.py bdist_wheel did not run successfully.
#0 32.52 │ exit code: 1
#0 32.52 ╰─> [23 lines of output]
#0 32.52 running bdist_wheel
#0 32.52 running build
#0 32.52 running build_py
#0 32.52 creating build
#0 32.52 creating build/lib.linux-aarch64-cpython-310
#0 32.52 creating build/lib.linux-aarch64-cpython-310/mprofile
#0 32.52 copying mprofile/__init__.py -> build/lib.linux-aarch64-cpython-310/mprofile
#0 32.52 running build_ext
#0 32.52 building 'mprofile._profiler' extension
#0 32.52 creating build/temp.linux-aarch64-cpython-310
#0 32.52 creating build/temp.linux-aarch64-cpython-310/src
#0 32.52 creating build/temp.linux-aarch64-cpython-310/third_party
#0 32.52 creating build/temp.linux-aarch64-cpython-310/third_party/google
#0 32.52 creating build/temp.linux-aarch64-cpython-310/third_party/google/tcmalloc
#0 32.52 gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPY_SSIZE_T_CLEAN -I/tmp/pip-wheel-uwisz0ni/mprofile_c0181bdbb61b43efbdd70b2a89228437 -Isrc -I/usr/local/include/python3.10 -c src/_profiler.cc -o build/temp.linux-aarch64-cpython-310/src/_profiler.o -std=c++11
#0 32.52 In file included from src/heap.h:12,
#0 32.52 from src/_profiler.cc:7:
#0 32.52 src/spinlock.h: In member function ‘void SpinLock::lock()’:
#0 32.52 src/spinlock.h:30:9: error: ‘__builtin_ia32_pause’ was not declared in this scope; did you mean ‘__builtin_iswspace’?
#0 32.52 30 | __builtin_ia32_pause();
#0 32.52 | ^~~~~~~~~~~~~~~~~~~~
#0 32.52 | __builtin_iswspace
#0 32.52 error: command '/usr/bin/gcc' failed with exit code 1
#0 32.52 [end of output]
#0 32.52
#0 32.52 note: This error originates from a subprocess, and is likely not a problem with pip.
#0 32.52 ERROR: Failed building wheel for mprofile
#0 32.52 Running setup.py clean for mprofile
#0 32.63 Building wheel for pypprof (setup.py): started
#0 32.78 Building wheel for pypprof (setup.py): finished with status 'done'
#0 32.78 Created wheel for pypprof: filename=pypprof-0.0.1-py3-none-any.whl size=13571 sha256=35c0c1bdfa260009b098594386bcbfea34e82d5fb70b1b6ad96369fcd0c6c3e2
#0 32.78 Stored in directory: /root/.cache/pip/wheels/46/8d/d9/d435b71ac5e9df6d2003cb958255d80a25a1a427b2bcafe52e
#0 32.78 Building wheel for zprofile (setup.py): started
#0 34.52 Building wheel for zprofile (setup.py): finished with status 'done'
#0 34.53 Created wheel for zprofile: filename=zprofile-1.0.12-cp310-cp310-linux_aarch64.whl size=727509 sha256=6ec23282209ef23750c166e7b77f1645e733055b34c587a40b6e026425f31f3d
#0 34.53 Stored in directory: /root/.cache/pip/wheels/92/e6/86/5bd1f0d48e0488d5677eb5ce4bc0e7ed8f797d0aeb8d9c77cc
#0 34.53 Successfully built pypprof zprofile
#0 34.53 Failed to build mprofile
#0 34.53 ERROR: Failed to build one or more wheels
#0 35.83
#0 35.83 [notice] A new release of pip available: 22.2.2 -> 22.3.1
#0 35.83 [notice] To update, run: pip install --upgrade pip
------
failed to solve: executor failed running [/bin/sh -c pip3 wheel --wheel-dir=/tmp/wheels -r requirements.txt]: exit code: 1
To Reproduce
Steps to reproduce the behavior:
- git clone git@github.com:grafana/phlare.git
- docker compose up -d
Expected behavior
Environment
- Infrastructure: laptop (MacBook m1)
- Deployment tool: docker compose
Additional Context
Hey @yasharne thanks for your interest and sorry that you are hitting some trouble building the images.
I have just run the particular build locally with success:
$ docker-compose build --pull --no-cache python
Building python
Sending build context to Docker daemon 6.144kB
Step 1/13 : FROM python:3.10 as builder
3.10: Pulling from library/python
a8ca11554fce: Already exists
e4e46864aba2: Already exists
c85a0be79bfb: Already exists
195ea6a58ca8: Already exists
157f16ed0a0c: Pull complete
884b144bec28: Pull complete
b7c6b1ad3022: Pull complete
c5ae41250acf: Pull complete
d1ffbfa02364: Pull complete
Digest: sha256:daed8d46dfc607976178e2f2beb96f03f91240bcb553e0fffd8186b73929db9c
Status: Downloaded newer image for python:3.10
---> 465483cdaa4e
Step 2/13 : RUN apt-get update && apt-get install -y build-essential git
---> Running in 64c4fac1fb9b
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [204 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
Fetched 8610 kB in 2s (3518 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.30.2-1).
The following NEW packages will be installed:
build-essential
0 upgraded, 1 newly installed, 0 to remove and 10 not upgraded.
Need to get 7704 B of archives.
After this operation, 20.5 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bullseye/main amd64 build-essential amd64 12.9 [7704 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 7704 B in 0s (100 kB/s)
Selecting previously unselected package build-essential.
(Reading database ... 23422 files and directories currently installed.)
Preparing to unpack .../build-essential_12.9_amd64.deb ...
Unpacking build-essential (12.9) ...
Setting up build-essential (12.9) ...
Removing intermediate container 64c4fac1fb9b
---> 4bf9cf180773
Step 3/13 : COPY requirements.txt .
---> 4579130ffa4f
Step 4/13 : RUN pip3 wheel --wheel-dir=/tmp/wheels -r requirements.txt
---> Running in 4a42d45947aa
Collecting pypprof
Cloning https://github.com/simonswine/pypprof.git (to revision a5b539b839f9eb91be9277ae22c1698eac9e5ce8) to /tmp/pip-wheel-qlppo1ts/pypprof_8f26c710caaa43bf8024c038f1cdefc0
Running command git clone --filter=blob:none --quiet https://github.com/simonswine/pypprof.git /tmp/pip-wheel-qlppo1ts/pypprof_8f26c710caaa43bf8024c038f1cdefc0
Running command git rev-parse -q --verify 'sha^a5b539b839f9eb91be9277ae22c1698eac9e5ce8'
Running command git fetch -q https://github.com/simonswine/pypprof.git a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Running command git checkout -q a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Resolved https://github.com/simonswine/pypprof.git to commit a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting zprofile
Cloning https://github.com/simonswine/zprofile.git (to revision 100934da015661b3baf7c7c45f68293546ba77f5) to /tmp/pip-wheel-qlppo1ts/zprofile_668692d9747949b19bbe737a06a1412c
Running command git clone --filter=blob:none --quiet https://github.com/simonswine/zprofile.git /tmp/pip-wheel-qlppo1ts/zprofile_668692d9747949b19bbe737a06a1412c
Running command git rev-parse -q --verify 'sha^100934da015661b3baf7c7c45f68293546ba77f5'
Running command git fetch -q https://github.com/simonswine/zprofile.git 100934da015661b3baf7c7c45f68293546ba77f5
Running command git checkout -q 100934da015661b3baf7c7c45f68293546ba77f5
Resolved https://github.com/simonswine/zprofile.git to commit 100934da015661b3baf7c7c45f68293546ba77f5
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting mprofile==0.0.14
Downloading mprofile-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (833 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 834.0/834.0 kB 7.0 MB/s eta 0:00:00
Collecting protobuf==3.20.3
Downloading protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 8.0 MB/s eta 0:00:00
Collecting six==1.16.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Saved /tmp/wheels/mprofile-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Saved /tmp/wheels/protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Saved /tmp/wheels/six-1.16.0-py2.py3-none-any.whl
Building wheels for collected packages: pypprof, zprofile
Building wheel for pypprof (setup.py): started
Building wheel for pypprof (setup.py): finished with status 'done'
Created wheel for pypprof: filename=pypprof-0.0.1-py3-none-any.whl size=13571 sha256=e61b0487450cf58f0471c316d3c30fcc4109d3f18c88e7137108dd5d586640de
Stored in directory: /root/.cache/pip/wheels/46/8d/d9/d435b71ac5e9df6d2003cb958255d80a25a1a427b2bcafe52e
Building wheel for zprofile (setup.py): started
Building wheel for zprofile (setup.py): finished with status 'done'
Created wheel for zprofile: filename=zprofile-1.0.12-cp310-cp310-linux_x86_64.whl size=732585 sha256=76edfe7f07f716d93cc9c87567c418dfe147219ffcd6ace201bdbcd9b41cd22c
Stored in directory: /root/.cache/pip/wheels/92/e6/86/5bd1f0d48e0488d5677eb5ce4bc0e7ed8f797d0aeb8d9c77cc
Successfully built pypprof zprofile
[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: pip install --upgrade pip
Removing intermediate container 4a42d45947aa
---> 21d8839440c8
Step 5/13 : FROM python:3.10
3.10: Pulling from library/python
Digest: sha256:daed8d46dfc607976178e2f2beb96f03f91240bcb553e0fffd8186b73929db9c
Status: Image is up to date for python:3.10
---> 465483cdaa4e
Step 6/13 : COPY --from=builder /tmp/wheels /tmp/wheels
---> a845556719dd
Step 7/13 : RUN ls -al
---> Running in eb22d1af0a41
total 72
drwxr-xr-x 1 root root 4096 Nov 21 15:23 .
drwxr-xr-x 1 root root 4096 Nov 21 15:23 ..
-rwxr-xr-x 1 root root 0 Nov 21 15:23 .dockerenv
drwxr-xr-x 1 root root 4096 Nov 15 10:24 bin
drwxr-xr-x 2 root root 4096 Sep 3 12:10 boot
drwxr-xr-x 5 root root 340 Nov 21 15:23 dev
drwxr-xr-x 1 root root 4096 Nov 21 15:23 etc
drwxr-xr-x 2 root root 4096 Sep 3 12:10 home
drwxr-xr-x 1 root root 4096 Nov 15 10:24 lib
drwxr-xr-x 2 root root 4096 Nov 14 00:00 lib64
drwxr-xr-x 2 root root 4096 Nov 14 00:00 media
drwxr-xr-x 2 root root 4096 Nov 14 00:00 mnt
drwxr-xr-x 2 root root 4096 Nov 14 00:00 opt
dr-xr-xr-x 521 root root 0 Nov 21 15:23 proc
drwx------ 1 root root 4096 Nov 15 20:51 root
drwxr-xr-x 3 root root 4096 Nov 14 00:00 run
drwxr-xr-x 1 root root 4096 Nov 15 10:23 sbin
drwxr-xr-x 2 root root 4096 Nov 14 00:00 srv
dr-xr-xr-x 13 root root 0 Nov 21 15:23 sys
drwxrwxrwt 1 root root 4096 Nov 21 15:23 tmp
drwxr-xr-x 1 root root 4096 Nov 14 00:00 usr
drwxr-xr-x 1 root root 4096 Nov 14 00:00 var
Removing intermediate container eb22d1af0a41
---> e1d7d08c2673
Step 8/13 : RUN apt-get update && apt-get install -y git
---> Running in 074df25f6068
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [204 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
Fetched 8610 kB in 2s (4004 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
git is already the newest version (1:2.30.2-1).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
Removing intermediate container 074df25f6068
---> 8b44d2238590
Step 9/13 : COPY requirements.txt .
---> d2d8c4c91fc2
Step 10/13 : COPY main.py .
---> b9a083374392
Step 11/13 : RUN pip3 install --no-index --find-links=/tmp/wheels -r requirements.txt
---> Running in baedeba3f456
Looking in links: /tmp/wheels
Collecting pypprof
Cloning https://github.com/simonswine/pypprof.git (to revision a5b539b839f9eb91be9277ae22c1698eac9e5ce8) to /tmp/pip-install-shoyugib/pypprof_4235f4a1ce8742b6b0b55be11a1844fa
Running command git clone --filter=blob:none --quiet https://github.com/simonswine/pypprof.git /tmp/pip-install-shoyugib/pypprof_4235f4a1ce8742b6b0b55be11a1844fa
Running command git rev-parse -q --verify 'sha^a5b539b839f9eb91be9277ae22c1698eac9e5ce8'
Running command git fetch -q https://github.com/simonswine/pypprof.git a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Running command git checkout -q a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Resolved https://github.com/simonswine/pypprof.git to commit a5b539b839f9eb91be9277ae22c1698eac9e5ce8
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting zprofile
Cloning https://github.com/simonswine/zprofile.git (to revision 100934da015661b3baf7c7c45f68293546ba77f5) to /tmp/pip-install-shoyugib/zprofile_39bf749d12394b589cf74e63895c63d2
Running command git clone --filter=blob:none --quiet https://github.com/simonswine/zprofile.git /tmp/pip-install-shoyugib/zprofile_39bf749d12394b589cf74e63895c63d2
Running command git rev-parse -q --verify 'sha^100934da015661b3baf7c7c45f68293546ba77f5'
Running command git fetch -q https://github.com/simonswine/zprofile.git 100934da015661b3baf7c7c45f68293546ba77f5
Running command git checkout -q 100934da015661b3baf7c7c45f68293546ba77f5
Resolved https://github.com/simonswine/zprofile.git to commit 100934da015661b3baf7c7c45f68293546ba77f5
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Processing /tmp/wheels/mprofile-0.0.14-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Processing /tmp/wheels/protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Processing /tmp/wheels/six-1.16.0-py2.py3-none-any.whl
Building wheels for collected packages: pypprof, zprofile
Building wheel for pypprof (setup.py): started
Building wheel for pypprof (setup.py): finished with status 'done'
Created wheel for pypprof: filename=pypprof-0.0.1-py3-none-any.whl size=13571 sha256=24440f386c1afc79b30de14685f259044e53aca4ea90b11f50d758bca9a24e5e
Stored in directory: /root/.cache/pip/wheels/46/8d/d9/d435b71ac5e9df6d2003cb958255d80a25a1a427b2bcafe52e
Building wheel for zprofile (setup.py): started
Building wheel for zprofile (setup.py): finished with status 'done'
Created wheel for zprofile: filename=zprofile-1.0.12-cp310-cp310-linux_x86_64.whl size=732522 sha256=ebbf5d7adbc8ea88c087cf1fb4cf698c4fe5e4bf91a3d6b1e3c6a5c7f60ef626
Stored in directory: /root/.cache/pip/wheels/92/e6/86/5bd1f0d48e0488d5677eb5ce4bc0e7ed8f797d0aeb8d9c77cc
Successfully built pypprof zprofile
Installing collected packages: mprofile, six, protobuf, zprofile, pypprof
Successfully installed mprofile-0.0.14 protobuf-3.20.3 pypprof-0.0.1 six-1.16.0 zprofile-1.0.12
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
Removing intermediate container baedeba3f456
---> bf003ce9934f
Step 12/13 : EXPOSE 8080
---> Running in 19b8d742d431
Removing intermediate container 19b8d742d431
---> 67bc7a88d2e8
Step 13/13 : CMD python3 -u main.py
---> Running in 6c60476a05e2
Removing intermediate container 6c60476a05e2
---> f7f41471b0a5
Successfully built f7f41471b0a5
Successfully tagged docker-compose_python:latest
I am by no means a python expert and have little clue what the wheel thing is acutally doing in the background.
But I would like to ask:
- @yasharne to try the command from my previous comment (
docker-compose build --pull --no-cache python
) - someone else with an M1 Mac to try to reproduce the problem using
docker-compose build --pull --no-cache python
(cc @cyriltovena)
Hi @simonswine .
Mac M1 - Same error
Debian 10 - worked.
Hi @simonswine I get the same error with docker-compose build --pull --no-cache python
This seems to be a limitation of mprofile: timpalpant/mprofile#3
So it appears it only works on linux/amd64. I wonder if this workaround fixes it for you: #432
We think #432 fixes this, feel free to reopen, if it does not
@simonswine yes, #432 fixed the issue, thanks