HumanSignal/label-studio-ml-backend

YOLO: docker-compose up fails - cannot get current_repodata.json from repo.anaconda.com

Closed this issue · 13 comments

When running within ../examples/yolo, docker-compose up fails with:

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json

Looks like this URL might be stale:

curl -is http://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json | head -n 1
HTTP/1.1 301 Moved Permanently

Have you tried to build the docker again? Probably, it was a temporary issue, I can't reproduce it on my side.

The problem persists.

sudo docker-compose up
...
=> ERROR [yolo stage-0  3/14] RUN conda update conda -y 
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>

When I check for the existence of current_repodata.json, I get this:

curl -is http://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json | head -n 1
HTTP/1.1 301 Moved Permanently

Are you on windows?

Try solutions from this thread:

https://stackoverflow.com/questions/50125472/issues-with-installing-python-libraries-on-windows-condahttperror-http-000-co

In your Dockerfile before RUN conda update conda -y try adding

RUN conda config --set ssl_verify no

if the line above doesn't work, try this:

RUN conda config --remove-key channels

if the lines above don't work, try this:

RUN conda config --remove-key proxy_servers
RUN conda clean --source-cache

Rebuild docker:

docker-compose build --no-cache
docker-compose up

@makseq , Thanks so much for your help.

I am running Linux (Ubuntu 22.04).

Tried all your suggested modifications to Dockerfile, but still no go.

Hm.. I am on ubuntu 22 as well, just tried to build it with --no-cache option, everything is ok..

My docker version:

makseq@makseq-ubnt:~$ docker version
Client: Docker Engine - Community
 Version:           24.0.2
 API version:       1.43
 Go version:        go1.20.4
 Git commit:        cb74dfc
 Built:             Thu May 25 21:52:13 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          24.0.2
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.4
  Git commit:       659604f
  Built:            Thu May 25 21:52:13 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.21
  GitCommit:        3dce8eb055cbb6872793272b4f20ed16117344f8
 runc:
  Version:          1.1.7
  GitCommit:        v1.1.7-0-g860f061
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

You can try using it without docker. Create a new python virtual env and do these:

cd label_studio_ml/examples/yolo
pip install -r requirements.txt
python ./_wsgi.py

@makseq thanks for your help.

I created a virtual env and saved it in env in the top directory (label-studio-ml-backend).
I then execute these commands:

cd label_studio_ml/examples/yolo
pip install -r requirements.txt
python ./_wsgi.py

Got this result:

(env) aubrey@aubrey-PC5x-7xHP-HR-HS:~/label-studio-ml-backend$ /home/aubrey/label-studio-ml-backend/env/bin/python /home/aubrey/label-studio-ml-backend/label_studio_ml/examples/yolo/_wsgi.py
Traceback (most recent call last):
  File "/home/aubrey/label-studio-ml-backend/label_studio_ml/examples/yolo/_wsgi.py", line 35, in <module>
    from label_studio_ml.api import init_app
ModuleNotFoundError: No module named 'label_studio_ml'

I see that label_studio_ml/api is a couple of levels up the directory structure. After adding label_studio/api to my path,
Python got a little further but stopped when it could not find Flask.

Here's a list of my installed modules.

(env) aubrey@aubrey-PC5x-7xHP-HR-HS:~/label-studio-ml-backend$ pip list
Package                  Version
------------------------ -----------
certifi                  2024.8.30
charset-normalizer       3.3.2
contourpy                1.3.0
cycler                   0.12.1
filelock                 3.16.1
fonttools                4.54.1
fsspec                   2024.9.0
idna                     3.10
Jinja2                   3.1.4
kiwisolver               1.4.7
lightning-utilities      0.11.7
MarkupSafe               2.1.5
matplotlib               3.9.2
mpmath                   1.3.0
networkx                 3.3
numpy                    1.26.4
nvidia-cublas-cu12       12.1.3.1
nvidia-cuda-cupti-cu12   12.1.105
nvidia-cuda-nvrtc-cu12   12.1.105
nvidia-cuda-runtime-cu12 12.1.105
nvidia-cudnn-cu12        9.1.0.70
nvidia-cufft-cu12        11.0.2.54
nvidia-curand-cu12       10.3.2.106
nvidia-cusolver-cu12     11.4.5.107
nvidia-cusparse-cu12     12.1.0.106
nvidia-nccl-cu12         2.20.5
nvidia-nvjitlink-cu12    12.6.77
nvidia-nvtx-cu12         12.1.105
opencv-python            4.10.0.84
packaging                24.1
pandas                   2.2.3
pillow                   10.4.0
pip                      22.0.2
psutil                   6.0.0
py-cpuinfo               9.0.0
pyparsing                3.1.4
python-dateutil          2.9.0.post0
pytz                     2024.2
PyYAML                   6.0.2
requests                 2.32.3
scipy                    1.14.1
seaborn                  0.13.2
setuptools               59.6.0
six                      1.16.0
sympy                    1.13.3
torch                    2.4.1
torchmetrics             1.4.2
torchvision              0.19.1
tqdm                     4.66.5
triton                   3.0.0
typing_extensions        4.12.2
tzdata                   2024.2
ultralytics              8.2.103
ultralytics-thop         2.0.9
urllib3                  2.2.3
wheel                    0.37.1

Not quite sure how to proceed. Should I just continue by adding missing modules as they are detected?

cd label-studio-ml-backend
pip install -e . 

Still struggling to get the yolo example working.

When I run docker-compose in for the yolo example dir, it errors out:

~/label-studio-ml-backend/label_studio_ml/examples/yolo$ docker-compose up
...
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://repo.anaconda.com/pkgs/main/linux-64/current_repodata.json>

However, when I run docker-compose for the easyocr example, everything seems run perfectly. Does this indicate a problem with the yolo docker file?

aubrey@tensorbook2:~/label-studio-ml-backend/label_studio_ml/examples/easyocr$ docker-compose up
WARN[0000] The "TEST_ENV" variable is not set. Defaulting to a blank string. 
[+] Running 14/14
 ✔ easyocr 13 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                         330.2s 
   ✔ 302e3ee49805 Pull complete                                                                                                                                                                       4.8s 
   ✔ 4aeebc636537 Pull complete                                                                                                                                                                       2.5s 
   ✔ 2aee89346c42 Pull complete                                                                                                                                                                       2.3s 
   ✔ 0538735e543f Pull complete                                                                                                                                                                       3.6s 
   ✔ 944b6eec9034 Pull complete                                                                                                                                                                       3.9s 
   ✔ 5f8dc2ca6173 Pull complete                                                                                                                                                                      23.0s 
   ✔ 9914c9719cd7 Pull complete                                                                                                                                                                       5.2s 
   ✔ 35203abae53d Pull complete                                                                                                                                                                      26.4s 
   ✔ c314f41d7225 Pull complete                                                                                                                                                                       7.9s 
   ✔ 5502fbc37251 Pull complete                                                                                                                                                                     292.9s 
   ✔ b5716c300228 Pull complete                                                                                                                                                                      24.3s 
   ✔ 4f4fb700ef54 Pull complete                                                                                                                                                                      25.7s 
   ✔ 3f039ec6f635 Pull complete                                                                                                                                                                      27.0s 
[+] Running 2/2
 ✔ Network easyocr_default  Created                                                                                                                                                                   0.1s 
 ✔ Container easyocr        Created                                                                                                                                                                   1.2s 
Attaching to easyocr
easyocr  | [2024-10-09 03:53:37 +0000] [6] [INFO] Starting gunicorn 22.0.0
easyocr  | [2024-10-09 03:53:37 +0000] [6] [INFO] Listening at: http://0.0.0.0:9090 (6)
easyocr  | [2024-10-09 03:53:37 +0000] [6] [INFO] Using worker: gthread
easyocr  | [2024-10-09 03:53:38 +0000] [29] [INFO] Booting worker with pid: 29

Finally got docker-compose for the yolo example to run to completion on 2 Ubuntu laptops, but only after running docker compose for the easyocr example.

(base) aubrey@tensorbook2:~$ docker ps
CONTAINER ID   IMAGE                 COMMAND           CREATED       STATUS       PORTS                                       NAMES
c3d5f18524d8   humansignal/yolo:v0   "/app/start.sh"   2 hours ago   Up 2 hours   0.0.0.0:9090->9090/tcp, :::9090->9090/tcp   yolo

I think it was related to your local problem with network. I am not sure it was related to easyocr, because easyocr uses completely different codebase and libraries.

Do I understand correctly that yolo docker compose run after you run easyocr?

@makseq Yes, yolo docker compose run only after I ran easyocr. Same result on 2 laptops.