Dockerfile works fine at home, yet fails at vast.ai

Hello,

I’ve got a simple Dockerfile. I’ve uploaded it docker-hub. Now when I do a docker pull etc of it on my at home or at the office, all is fine: lots of chess-data is produced. But if I instantiate it at https://vast.ai (a platform where you can rent cpu), nothing happens: no data is produced or received at the server. As I cannot login to the container and no output is logged anywhere, I’ve got a hard time resolving this :slight_smile: I tried adding “| /usr/bin/nc myloghost mylogport” (and of course added “netcat-openbsd” to the apt-get) but even that was not executed.
Does anyone see any obvious mistake that may cause this problem?

FROM python:trixie

RUN apt update && apt install -y build-essential cmake

RUN git clone --recursive --branch TRAINER https://github.com/folkertvanheusden/Dog

RUN pip3 install python-chess

RUN cd Dog/app/src/linux-windows/build && \
    rm -rf ../build/* && \
    cmake .. && \
    make -j4 Dog

WORKDIR Dog/app/src

CMD ./gen-train-data.py -e ./linux-windows/build/Dog

I will have a guess because it is not perfectly clear what you are doing exactly. You say you have a Dockerfile and you upload it to Docker Hub. You probably mean you build an image from the Dockerfile and push the image to Docker Hub.

You also say you do a “docker pull” on your (machine?) at home but don’t meniton thaty ou start a container from it. I assume you do, because you write “instantiate” it at vast.ai

You say you “cannot login” to the container. I assume you mean you cannot start a shell in the container when it runs on vast.ai. There is no login process..

If I understand you correctly, the only problem is that you get no output when you run the container on vast.ai. I see your image is based on Python. So don’t forget to add

ENV PYTHONUNBUFFERED=1

to the Dockerfile or start the container with

-e PYTHONUNBUFFERED=1

Otherwise the output might get buffered depending on how you generate the output, with which Python library. I remember a “logging” library maybe or “logger”. That sends the output immediately, but not “print

How the output is buffered depends on whether you have an interactive shell or not, so that could be a difference.

1 Like