I’m on Windows, I try to run label-studio on a docker-img and enable automatic annotations with a tesseract machine learning model provided from label-studio-ml-backend on another docker-img. (I’m discovering docker these days…)
Set up:
So far I was able to launch a docker with label-studio, and a docker with tesseract:
# Run the label-studio
docker run --name lbl-studio -it -p 8080:8080 -v label-studio-data:/label-studio/data/ heartexlabs/label-studio:latest label-studio
# DL and run tesseract image
git clone https://github.com/heartexlabs/label-studio-ml-backend
cd label-studio-ml-backend/label_studio_ml/examples/tesseract/
docker-compose up
At this point I have 2 images running on docker (or 3/4, I don’t really know how to interpret the ‘tesseract’ image)
Network:
Here are some network info I could gather, I don’t know how bas is the fact that lbl-studio is on 172.17 and the two others on 172.18…
# Get ips of images
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' server # 172.18.0.3
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' redis # 172.18.0.2
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' lbl-studio # 172.17.0.2
# server: 172.18.0.3
# redis: 172.18.0.2
# lbl-studio: 172.17.0.2
so far redis can ping server but can’t ping lbl-studio
Problem:
But, when I go to http://127.0.0.1:8080/, create a project, and try to link the machine learning wizard (http://127.0.0.1:8080/projects/1/settings/ml > add model), I’m not able to connect the tesseract server to the lbl-studio.
The urls I tried to connect are:
Going Further:
I tried to dig deepper and ping the server from lbl-studio, but nothing happened
docker exec -it --user root lbl-studio /bin/bash
apt update
apt install iputils-ping
ping 127.18.0.3 # Nothing happening: 100% packet loss ;)
Question:
How can I connect lbl-studio to the server ?
Thank you for your help 🙂
2
Answers
The answer of @artem is perfect, it adds the lbl-studio machine in the tesseract multi-container architecture defined in tesseract-docker-compose file, and adds the shared volume in the end, Terrific !
Another way to achive similar results, that would keep the original structure of the project, is to put the tesseract-multi-container thingy in the bridge network by adding
network_mode: bridge
in both machines of tesseract in the docker-compose.yml file:Thx for the support
Add
lbl-studio
to tesseract’s docker-compose file as third service. For connect from computer to services use http://127.0.0.1:9090 and http://127.0.0.1:9090. To connect betweentesseract
andlbl-studio
use services name: http://lbl-studio:8080 and http://server:9090. Example: