dm_hard_eight icon indicating copy to clipboard operation
dm_hard_eight copied to clipboard

Non Docker version

Open edbeeching opened this issue 5 years ago • 5 comments

Hello, thank you for creating and releasing this environment and tasks.

Unfortunately our compute cluster does not allow the use of containers such as Docker. Is the source code for this environment available for compilation?

edbeeching avatar Nov 19 '20 10:11 edbeeching

Hello, thanks for getting in touch!

Unfortunately we are not able to open-source the environment code.

Despite that, it may be possible to run dm_hard_eight without Docker, by following these two steps:

  • extracting out the files from the Docker image, with commands such as:
mkdir dm_hard_eight_image
cd dm_hard_eight_image
DOCKER_ID=`docker run -d gcr.io/deepmind-environments/dm_hard_eight:v1.0.1`
sudo docker cp $DOCKER_ID:/ .
docker rm -f $DOCKER_ID
  • loading the environment from the resulting directory with the load_from_disk function (instead of load_from_docker).

Make sure to pull this recent commit which fixed load_from_disk: https://github.com/deepmind/dm_hard_eight/commit/9e58b6f01d14d874bff16e8f9a2bb2b81c0f7b8d

It’s worth noting that without using Docker, it’s hard for us to give support and guarantees that the binaries are compatible with your target OS. If you run into compatibility issues (such as dynamic libraries failing to load), it’s possible that the chroot command or the LD_LIBRARY_PATH environment variable could help fix them.

We may add explicit support for loading without Docker at some point, but we can’t promise if or when this will happen.

rsfbarreira avatar Nov 19 '20 16:11 rsfbarreira

I was able to run the environment without Docker, by using chroot as previously hinted:

  • I extracted the files from the Docker image into a new directory, by running the commands in my previous comment;

  • I mounted the dev, proc, and sys directories into that same directory as explained in this link. These three directories must be created and mounted next to the 'app' directory (at the same level as 'app', not inside it).

  • I applied this patch to the cloned dm_hard_eight git repository on my machine. Note: you'll need to adjust the path passed to load_from_disk to point at the correct directory on your machine.

  • From the cloned dm_hard_eightgit directory, I ran the following commands:

sudo pip3 install ./[examples]
sudo python3 examples/human_agent.py 

One obvious caveat here is that the method above uses sudo privileges. This is a limitation of chroot, but I believe there are alternatives such as "Linux namespaces" that don't have this requirement. As mentioned before, there may be other incompatibilities with your system.

Hopefully this will help!

rsfbarreira avatar Nov 20 '20 01:11 rsfbarreira

Thank you so much for your detailed replies. Unfortunately I do not have sudo privilages on our compute cluster. Is it possible to prepare the environment on my machine with a wheel or something? Or do I need sudo each time I run the environment?

edbeeching avatar Nov 20 '20 08:11 edbeeching

With the method above you'd need root access.

Another working alternative uses the "bwrap" command, which some Linux distributions include out of the box. If running that on your cluster works, I can post details here of how to use it.

rsfbarreira avatar Nov 29 '20 01:11 rsfbarreira

I was wondering if this could work with google colab? Since google colab doesn't connect to docker.

DanielS684 avatar Dec 01 '20 02:12 DanielS684