HumanSignal / label-studio

Label Studio is a multi-type data labeling and annotation tool with standardized output format
https://labelstud.io
Apache License 2.0
19.28k stars 2.39k forks source link

Docker build failing due to missing `'distlib'` dependency #5391

Open Wuh60359 opened 9 months ago

Wuh60359 commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

jombooth commented 9 months ago

Hi @Wuh60359, could you paste in some more log output from the error that you encountered, and fill in the template with your OS/Label Studio version, etc?

Cheers, Jo

Wuh60359 commented 9 months ago

Thank you for you response, this is output error: \label-studio-develop\label-studio-develop> docker compose build --no-cache [+] Building 680.4s (30/36) docker:default => [app internal] load .dockerignore 0.0s => => transferring context: 307B 0.0s => [app internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 3.51kB 0.0s => [app] resolve image config for docker.io/docker/dockerfile:1.3 3.1s => [app auth] docker/dockerfile:pull token for registry-1.docker.io 0.0s => CACHED [app] docker-image://docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2 0.0s => [app internal] load metadata for docker.io/library/node:18 1.9s => [app internal] load metadata for docker.io/library/ubuntu:22.04 1.9s => [app auth] library/node:pull token for registry-1.docker.io 0.0s => [app auth] library/ubuntu:pull token for registry-1.docker.io 0.0s => [app internal] load build context 0.5s => => transferring context: 274.01kB 0.5s => CACHED [app internal] settings cache mount permissions 0.0s => [app frontend-builder 1/7] FROM docker.io/library/node:18@sha256:995a5f4314885452a4a785abc25a0fec40e26c346559e11e709d58bb7a927cf4 0.0s => [app stage-1 1/18] FROM docker.io/library/ubuntu:22.04@sha256:e6173d4dc55e76b87c4af8db8821b1feae4146dd47341e4d431118c7dd060a74 0.0s => CACHED [app frontend-builder 2/7] WORKDIR /label-studio/web 0.0s => CACHED [app stage-1 2/18] WORKDIR /label-studio 0.0s => [app stage-1 3/18] RUN set -eux && apt-get update && apt-get install --no-install-recommends --no-install-suggests -y build-essential 577.9s => [app frontend-builder 3/7] COPY --chown=1001:0 web . 2.5s => [app frontend-builder 4/7] COPY --chown=1001:0 pyproject.toml /label-studio 0.0s => [app frontend-builder 5/7] RUN yarn config set registry https://registry.npmjs.org/ 1.2s => [app frontend-builder 6/7] RUN yarn config set network-timeout 1200000 # HTTP timeout used when downloading packages, set to 20 minutes 1.0s => [app frontend-builder 7/7] RUN --mount=type=cache,target=/.cache/yarn/v6,uid=1001,gid=0 yarn install --frozen-lockfile && yarn run bu 318.1s => [app stage-1 4/18] RUN --mount=type=cache,target=/.cache,uid=1001,gid=0 pip3 install --upgrade pip setuptools && pip3 install poetry uwsg 34.8s => [app stage-1 5/18] RUN set -eux; curl -sSL https://nginx.org/keys/nginx_signing.key | apt-key add - && echo "deb https://nginx.org/pa 42.4s => [app stage-1 6/18] COPY --chown=1001:0 deploy/default.conf /etc/nginx/nginx.conf 0.1s => [app stage-1 7/18] RUN set -eux; mkdir -p /opt/heartex/instance-data/etc /var/log/nginx /var/cache/nginx /etc/nginx && chown -R 1001:0 0.5s => [app stage-1 8/18] COPY --chown=1001:0 pyproject.toml . 0.1s => [app stage-1 9/18] COPY --chown=1001:0 poetry.lock . 0.1s => [app stage-1 10/18] COPY --chown=1001:0 README.md . 0.1s => [app stage-1 11/18] COPY --chown=1001:0 label_studio/init.py ./label_studio/init.py 0.1s => ERROR [app stage-1 12/18] RUN --mount=type=cache,target=/.poetry-cache poetry check --lock && poetry install 18.9s

[app stage-1 12/18] RUN --mount=type=cache,target=/.poetry-cache poetry check --lock && poetry install: 1.206 All set! 1.878 Skipping virtualenv creation, as specified in config file. 2.091 Installing dependencies from lock file 3.256 3.256 Package operations: 138 installs, 11 updates, 0 removals 3.256 3.257 • Installing pyasn1 (0.5.0) 3.258 • Installing six (1.16.0) 4.157 • Installing cachetools (5.3.2) 4.158 • Downgrading certifi (2023.11.17 -> 2023.7.22) 4.160 • Downgrading idna (3.6 -> 3.4) 4.163 • Installing jmespath (1.0.1) 4.166 • Installing protobuf (4.25.0) 4.168 • Installing pyasn1-modules (0.3.0) 4.174 • Installing python-dateutil (2.8.2) 4.175 • Installing rsa (4.9) 4.177 • Installing typing-extensions (4.8.0) 4.182 • Downgrading urllib3 (2.2.0 -> 1.26.18) 5.635 • Installing asgiref (3.7.2) 5.637 • Installing attrs (23.1.0) 5.641 • Installing botocore (1.31.58) 5.645 • Installing exceptiongroup (1.1.3) 5.645 • Installing google-auth (2.23.4) 5.645 • Downgrading cryptography (42.0.2 -> 41.0.6) 5.646 • Installing iniconfig (2.0.0) 5.649 • Installing mdurl (0.1.2) 5.653 • Installing pluggy (1.3.0) 5.656 • Installing pytz (2022.7.1) 5.659 • Downgrading more-itertools (10.2.0 -> 10.1.0) 5.660 • Installing googleapis-common-protos (1.61.0) 5.814 • Installing ruamel-yaml-clib (0.2.8) 5.831 • Installing sqlparse (0.4.4) 9.062 • Installing appdirs (1.4.4) 9.064 • Installing click (8.1.7) 9.065 • Installing django (3.2.23) 9.069 • Installing docopt (0.6.2) 9.076 • Downgrading distlib (0.3.8 -> 0.3.7) 9.080 • Installing docutils (0.20.1) 9.080 • Installing google-crc32c (1.5.0) 9.082 • Installing google-api-core (2.14.0) 9.085 • Downgrading importlib-metadata (7.0.1 -> 6.8.0) 9.087 • Installing joblib (1.3.2) 9.090 • Installing lxml (4.9.3) 9.092 • Installing markdown-it-py (3.0.0) 9.215 • Installing markupsafe (2.1.3) 9.236 • Installing nh3 (0.2.14) 9.570 • Installing numpy (1.24.3) 9.607 • Installing pbr (6.0.0) 9.782 • Installing py (1.11.0) 10.38 • Installing pygments (2.16.1) 10.79 • Installing pyrsistent (0.20.0) 12.61 12.61 ModuleNotFoundError 12.61 12.61 No module named 'distlib' 12.61 12.61 at /usr/local/lib/python3.10/dist-packages/virtualenv/seed/embed/via_app_data/pip_install/base.py:13 in 12.63 9│ from itertools import chain 12.63 10│ from pathlib import Path 12.63 11│ from tempfile import mkdtemp 12.63 12│ 12.63 → 13│ from distlib.scripts import ScriptMaker, enquote_executable 12.63 14│ 12.63 15│ from virtualenv.util.path import safe_delete 12.64 16│ 12.64 17│ 12.64 12.64 Cannot install docopt. 12.64 12.64 • Installing pytest (7.2.2) 12.65 • Installing redis (3.5.3) 12.65 • Installing regex (2023.10.3) 12.65 • Installing s3transfer (0.7.0) 12.65 • Installing ruamel-yaml (0.18.5) 12.65 • Updating setuptools (59.6.0 -> 68.2.2) 12.66 • Installing tqdm (4.66.1) 12.67 • Installing tzdata (2023.3) 13.39 • Installing ua-parser (0.18.0)

failed to solve: process "/bin/sh -c poetry check --lock && poetry install" did not complete successfully: exit code: 1

jombooth commented 9 months ago

I suspected this was the problem; I've seen it one on of my local builds too. To be honest I don't know what the issue is yet (both distlib and docopt do appear in our Poetry lockfile), but a:

docker compose down
docker system prune
docker compose up --build

did fix it for me, for some reason. Give that a shot and see if it works; unfortunately it can be hard to track down the exact cause of failures like this.

Wuh60359 commented 9 months ago

I want to create my own label studio, able to edit the frontend, but I can't. If I run it with docker compose up the frontend doesn't change, so I tried to use docker compose build—no-cache but got the error above.

bkntr commented 2 months ago

updating distlib version to 0.3.8 in the poetry.lock file fixed this for me