Unity-Technologies / obstacle-tower-challenge

Starter Kit for the Unity Obstacle Tower challenge
Apache License 2.0
119 stars 39 forks source link

The problem with build.sh script #22

Open ismorphism opened 5 years ago

ismorphism commented 5 years ago

Hi guys, does anybody know hot to solve the problem? I'm trying to build Docker image but get the following:

Using PythonBuildPack builder
Step 1/33 : FROM nvidia/cuda:9.0-cudnn7-runtime-ubuntu16.04
---> 17c50af840b7
Step 2/33 : ENV DEBIAN_FRONTEND=noninteractive
---> Using cache
---> 4cc3d68f1cfb
Step 3/33 : RUN apt-get update -qq && apt-get install -qq --yes --no-install-recommends locales wget bzip2 && apt-get purge -qq && apt-get clean -qq && rm -rf /var/lib/apt/lists/*
---> Using cache
---> e02598cfe940
Step 4/33 : RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen
---> Using cache
---> 78779c78f8fe
Step 5/33 : ENV LC_ALL en_US.UTF-8
---> Using cache
---> 3deae9a42bbd
Step 6/33 : ENV LANG en_US.UTF-8
---> Using cache
---> c4e0f5830699
Step 7/33 : ENV LANGUAGE en_US.UTF-8
---> Using cache
---> de53df7bf289
Step 8/33 : ENV SHELL /bin/bash
---> Using cache
---> 92f4d829dfee
Step 9/33 : ARG NB_USER
---> Using cache
---> 29372e79581b
Step 10/33 : ARG NB_UID
---> Using cache
---> fb1d01ee055c
Step 11/33 : ENV USER ${NB_USER}
---> Using cache
---> a21170deec3c
Step 12/33 : ENV HOME /home/${NB_USER}
---> Using cache
---> 7f25f615c066
Step 13/33 : RUN adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}
---> Running in 6d6a7f099ee6
adduser: The UID 0 is already in use.
Removing intermediate container 6d6a7f099ee6
The command '/bin/sh -c adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}' returned a non-zero code: 1

I used sudo rights to run build, in other way I cannot run as non-root user because of the following error


docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))
spMohanty commented 5 years ago

@morphism90 : Can you try to pass --user-id 1001 as a parameter to aicrowd-repo2docker ?

ismorphism commented 5 years ago

Thanks, it helped but now I face the communication problem between terminals. First terminal says:

sudo docker run --env OTC_EVALUATION_ENABLED=true  --network=host  -it obstacle_tower_challenge:latest ./run.sh
root
INFO:mlagents_envs:Start training by pressing the Play button in the Unity Editor.
Traceback (most recent call last):
  File "run.py", line 26, in <module>
    env = ObstacleTowerEnv(args.environment_filename, docker_training=args.docker_training)
  File "/srv/conda/lib/python3.6/site-packages/obstacle_tower_env.py", line 45, in __init__
    timeout_wait=timeout_wait)
  File "/srv/conda/lib/python3.6/site-packages/mlagents_envs/environment.py", line 69, in __init__
    aca_params = self.send_academy_parameters(rl_init_parameters_in)
  File "/srv/conda/lib/python3.6/site-packages/mlagents_envs/environment.py", line 491, in send_academy_parameters
    return self.communicator.initialize(inputs).rl_initialization_output
  File "/srv/conda/lib/python3.6/site-packages/mlagents_envs/rpc_communicator.py", line 80, in initialize
    "The Unity environment took too long to respond. Make sure that :\n"
mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
     The environment does not need user interaction to launch
     The Academy and the External Brain(s) are attached to objects in the Scene
     The environment and the Python interface have compatible versions.

Second one says:

sudo docker run --env OTC_EVALUATION_ENABLED=true --env OTC_DEMO_EVALUATION=true  --network=host  -it obstacle_tower_challenge:latest ./env.sh
+ ENV_PORT=
+ ENV_FILENAME=
+ '[' -z '' ']'
+ ENV_PORT=5005
+ '[' -z '' ']'
+ ENV_FILENAME=/home/otc/ObstacleTower/obstacletower.x86_64
+ touch otc_out.json
+ APP_PID=7
+ xvfb-run --auto-servernum '--server-args=-screen 0 640x480x24' /home/otc/ObstacleTower/obstacletower.x86_64 --port 5005 2
+ TAIL_PID=8
+ wait 7
+ tail -f otc_out.json

Is there a problem with my ports? Or maybe I did smth wrong in commands? My OS is Ubuntu 16.04.5 LTS

awjuliani commented 5 years ago

Hi @morphism90

Can you try changing the timeout_wait parameter of the ObstacleTowerEnv? By default it is 30, but you may want it to be a larger value to give more time for Unity to start up and handshake with the python api. Please let us know if that resolves the issue.

KarolisRam commented 5 years ago

I have the same OS and same issue. I am running it on my local machine with a monitor. I checked the logs that the 2nd command produces and it was complaining about xvfb. I tried setting up xvfb properly, but somehow ended up botching my graphics settings to the point where Ubuntu didn't boot. My question is - do we actually need the xvfb if we run this on a system with a monitor?

ismorphism commented 5 years ago

@awjuliani unfortunately it didn't solve the problem

awjuliani commented 5 years ago

Hi @KarolisRam

If you run it on a system with a monitor/display, then you don't need xvfb or a virtual x-server in order to run the environment. Those are only for headless systems, such as cloud instances.