Using Docker

We’ve also provided a docker compose configuration to automatically setup the dependencies and requirements necessary to run the code in this repo.

Note

This is not a full explanation of Docker or Docker Compose. If you are unfamiliar with Docker, we recommend you read the official documentation.

Prerequisites

You need to have Docker installed on your machine. You can download it here. Additionally, your system must have cuda and nvidia-docker.

Installation

To build the docker image, run:

docker compose up -d

The first time this is run, this will build two services: aci and vnc. The vnc service allows you to visualize GUIs from within the aci container using a docker network bridge. It will then initialize the services to run in the background.

Tip

If you change the Dockerfile or docker-compose.yml, you will need to rebuild the image with docker compose build.

You can then attach to the aci container with:

docker compose exec -it aci bash

The working directory within the aci container is /home/aci/aci. You then need to install the aci package in the container. You only need to do this once after building.

pip install -e .

Running

You can then run the code as you would on your local machine. For example, to run the training script:

python cambrian/main.py --eval example=detection_optimal env.renderer.render_modes='[human]' env.renderer.save_mode=NONE trainer.max_episode_steps=10000 eval_env.n_eval_episodes=1

The display window should then be visible from within the vnc container. You can connect to the VNC server in your browser. It’s likely the server will be located at http://localhost:8080.

Note

It’s possible that port 8080 was in use, in which case the VNC server may be located on any port between 8080 and 8099. You can find the port by running docker compose ps.