3

I've registered a GitLab Runner with shell executor installed on Ubuntu 18.04, and also set up a docker container with the command below

docker run -it --gpus '"device=0"' --net=host -v /home/autotest/Desktop/ai_platform:/app --name=ai_platform_system nvcr.io/nvidia/pytorch:20.10-py3 "bash"

Then I tried to execute the following command from the gitlab-ci.yml in Gitlab CI, but I got an error "The input device is not a TTY".

docker attach ai_platform_system

Any clues for this issue except using docker exec? I know docker exec works in Gitlab CI environment but it will create a new session in the container which is not desirable for me. Thanks!

Anin Huang
  • 51
  • 2
  • 7

1 Answers1

3

According to this answer (for Jenkins but the same problem) you need to remove the -it flag and the tty.

docker run -T --gpus '"device=0"' --net=host -v /home/autotest/Desktop/ai_platform:/app --name=ai_platform_system nvcr.io/nvidia/pytorch:20.10-py3 "bash"
danielnelz
  • 3,794
  • 4
  • 25
  • 35