Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 2.83 KB

README.md

File metadata and controls

91 lines (63 loc) · 2.83 KB

Docker image for MineDojo

A quick reference for using MineDojo in docker container. This may be useful since MineDojo has limited examples and contain some unresolved bugs.

Build the Docker Images

git clone https://github.com/j3soon/docker-minedojo.git
cd docker-minedojo
docker build -t j3soon/minedojo-example .

Run the Docker Container

# stop and remove the container if exists
docker stop minedojo && docker rm minedojo
# launch the container
docker run --name minedojo -it --gpus all -p 8080:8080 -d \
    -v $PWD:/workspace \
    j3soon/minedojo-example tail -f /dev/null
# exec into the container
docker exec -it minedojo /bin/bash

In the container, run the followings to test the installation:

vglrun python /workspace/MineDojo/scripts/validate_install.py
vglrun python /workspace/MineCLIP/main/mineagent/run_single.py
vglrun python /workspace/MineCLIP/main/mineagent/run_env_in_loop.py
vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo/run.py

If you're going to use the host MineDojo and MineCLIP, run the following in the container:

pip uninstall -y minedojo mineclip
rm -r ~/MineDojo ~/MineCLIP
pip install -e /workspace/MineCLIP
pip install -e /workspace/MineDojo

or simply rebuild the image.

Miscellaneous

The following commands should be ran in the container.

Recording Video

vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo_dig_down/run.py

observe the video where the player is digging downwards.

video-dig-down.mp4

Adventure Mode

In the animal zoo example, destroying blocks might disrupt training. To prevent this, we can switch the game mode to Adventure, which disables player from destroying the terrain:

/workspace/scripts/set_adventure_mode.sh

and test it with the script:

vglrun python /workspace/MineCLIP/main/dense_reward/animal_zoo_dig_down/run.py

observe the video where the player is digging downwards but cannot due to Adventure mode.

video-dig-down-adventure.mp4

The script above simply apply a quick hack by changing the line <AgentSection mode="Survival"> to <AgentSection mode="Adventure"> in MineDojo/minedojo/sim/mc_meta/minedojo_mission.xml.j2, which can also be done manually.

You can revert this change by:

/workspace/scripts/set_survival_mode.sh

References