Avalon-Benchmark / avalon

A 3D video game environment and benchmark designed from scratch for reinforcement learning research
https://generallyintelligent.com/avalon/
GNU General Public License v3.0
175 stars 16 forks source link

Dockerfile plus instructions for running container hide install #18

Closed dfm794 closed 1 year ago

dfm794 commented 1 year ago

Apologies if I got the intent wrong...please clarify if so... here's the issue:

The Dockerfile copies the repo for avalon to /opt/projects/

COPY . /opt/projects/avalon
RUN pip install -e /opt/projects/avalon

Then, godot is installed in /opt/projects/avalon as follows:

RUN python -m avalon.install_godot_binary

Then, workspace is set to /opt/projects/avalon and, per instructions from the readme, maps $pwd to /opt/projects/avalon:

WORKDIR /opt/projects/avalon
docker run -it -p 8888:8888 -v $(pwd):/opt/projects/avalon --gpus 'all,"capabilities=compute,utility,graphics"' avalon/dev 

The effect of this is to mount the current working directory as /opt/projects/avalon, thereby hiding the install by overlaying $pwd as /opt/projects/avalon

adelC commented 1 year ago

Hi @dfm794,

I wonder if the problem you mention raises the following error

2023-01-16 18:14:29.592 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:108 - Godot error: returncode=UNKNOWN(126)
Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log
Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz
2023-01-16 18:14:29.592 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:109 - Attempting to dump log file here...
2023-01-16 18:14:29.592 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:110 - /opt/projects/avalon/avalon/bin/godot

/opt/projects/avalon/avalon/datagen/godot/project.godot

stdbuf: failed to run command '/opt/projects/avalon/avalon/bin/godot': Permission denied

2023-01-16 18:14:29.592 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:112 - Attempting to log error to sentry...
2023-01-16 18:14:29.592 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:108 - Godot error: returncode=UNKNOWN(126)
Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log
Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz
2023-01-16 18:14:29.593 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:109 - Attempting to dump log file here...
2023-01-16 18:14:29.593 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:110 - /opt/projects/avalon/avalon/bin/godot

/opt/projects/avalon/avalon/datagen/godot/project.godot

stdbuf: failed to run command '/opt/projects/avalon/avalon/bin/godot': Permission denied

2023-01-16 18:14:29.593 | ERROR    | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:112 - Attempting to log error to sentry...
Traceback (most recent call last):
  File "/opt/projects/avalon/avalon/datagen/godot_env/_bridge.py", line 141, in _kill_on_parsing_errors_to_avoid_zombies
    process.wait_for_log_signal(BRIDGE_LOG_SIGNAL)
  File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 385, in wait_for_log_signal
    wait_until_true(wait_for_ready, sleep_inc=0.0001, max_wait_sec=20)
  File "/opt/projects/avalon/avalon/common/utils.py", line 206, in wait_until_true
    if callback():
  File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 374, in wait_for_ready
    self._raise_error()
  File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 354, in _raise_error
    _raise_godot_error(
  File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 113, in _raise_godot_error
    log_to_sentry(GodotError(error_message))
  File "/opt/projects/avalon/avalon/common/log_utils.py", line 54, in log_to_sentry
    capture_exception(exception, extra=dict(username=user, experiment=experiment, **extra), extra_fingerprint=user)
  File "/opt/projects/avalon/avalon/common/error_utils.py", line 37, in capture_exception
    raise exception
avalon.datagen.errors.GodotError: returncode=UNKNOWN(126)
Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log
Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz
dfm794 commented 1 year ago

Hi @dfm794,

I wonder if the problem you mention raises the following error

`2023-01-16 18:14:29.592 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:108 - Godot error: returncode=UNKNOWN(126) Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz 2023-01-16 18:14:29.592 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:109 - Attempting to dump log file here... 2023-01-16 18:14:29.592 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:110 - /opt/projects/avalon/avalon/bin/godot

/opt/projects/avalon/avalon/datagen/godot/project.godot

stdbuf: failed to run command '/opt/projects/avalon/avalon/bin/godot': Permission denied

2023-01-16 18:14:29.592 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:112 - Attempting to log error to sentry... 2023-01-16 18:14:29.592 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:108 - Godot error: returncode=UNKNOWN(126) Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz 2023-01-16 18:14:29.593 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:109 - Attempting to dump log file here... 2023-01-16 18:14:29.593 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:110 - /opt/projects/avalon/avalon/bin/godot

/opt/projects/avalon/avalon/datagen/godot/project.godot

stdbuf: failed to run command '/opt/projects/avalon/avalon/bin/godot': Permission denied

2023-01-16 18:14:29.593 | ERROR | avalon.datagen.godot_env.interactive_godot_process:_raise_godot_error:112 - Attempting to log error to sentry... Traceback (most recent call last): File "/opt/projects/avalon/avalon/datagen/godot_env/_bridge.py", line 141, in _kill_on_parsing_errors_to_avoid_zombies process.wait_for_log_signal(BRIDGE_LOG_SIGNAL) File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 385, in wait_for_log_signal wait_until_true(wait_for_ready, sleep_inc=0.0001, max_wait_sec=20) File "/opt/projects/avalon/avalon/common/utils.py", line 206, in wait_until_true if callback(): File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 374, in wait_for_ready self._raise_error() File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 354, in _raise_error _raise_godot_error( File "/opt/projects/avalon/avalon/datagen/godot_env/interactive_godot_process.py", line 113, in _raise_godot_error log_to_sentry(GodotError(error_message)) File "/opt/projects/avalon/avalon/common/log_utils.py", line 54, in log_to_sentry capture_exception(exception, extra=dict(username=user, experiment=experiment, **extra), extra_fingerprint=user) File "/opt/projects/avalon/avalon/common/error_utils.py", line 37, in capture_exception raise exception avalon.datagen.errors.GodotError: returncode=UNKNOWN(126) Log: /tmp/science/tmp/612b7767-6866-4ad8-812e-38a53334baf9/godot.log Artifacts: /tmp/science/godot/godot_env_artifacts__026a5cbf-dfdf-4f17-a3a9-cbd4b8447bae.tar.gz`

I didn't see this error myself

micimize commented 1 year ago

@dfm794 yeah that looks like it'd cause an issue to me.

What we probably want to do is globally set the environment variable GODOT_BINARY_PATH to something like /usr/local/bin/godot before install, in such a way that the subsequent docker command picks it up as well. I think ENV GODOT_BINARY_PATH=/usr/local/bin/godot will work but am not sure.

@adelC please open a different issue with details on how you got this error – looks like it is likely related but tough to say for sure. You can also try export GODOT_BINARY_PATH=/usr/local/bin/godot; python -m avalon.install_godot_binary in the container for now , but will have to ensure you use something like run -e GODOT_BINARY_PATH=/usr/local/bin/godot also

dfm794 commented 1 year ago

@dfm794 yeah that looks like it'd cause an issue to me.

What we probably want to do is globally set the environment variable GODOT_BINARY_PATH to something like /usr/local/bin/godot before install, in such a way that the subsequent docker command picks it up as well. I think ENV GODOT_BINARY_PATH=/usr/local/bin/godot will work but am not sure.

@adelC please open a different issue with details on how you got this error – looks like it is likely related but tough to say for sure. You can also try export GODOT_BINARY_PATH=/usr/local/bin/godot; python -m avalon.install_godot_binary in the container for now , but will have to ensure you use something like run -e GODOT_BINARY_PATH=/usr/local/bin/godot also

Right, that would deal with conflicts to the local repository...but that won't remove the overlay issue, right? The copied repo in /opt/projects/avalon is still going to be hidden by the setting of workspace and -v options to docker run?

micimize commented 1 year ago

@dfm794 yes – you don't need to use -v unless you want to make changes to the codebase and have them used/available in the container