Utility to run gym environments from a different location than the agent. Useful if environment has been installed:
- in a different conda environment
- in a Docker container
- even a different machine (over ssh)!
On both the remote and local client, install the package:
pip install git+https://github.com/dibyaghosh/remote_gym.git
On the remote client, start the server:
remote_gym_server # starts the server on port 8000 by default
On the local client, you can now connect:
from remote_gym.http_client import RemoteEnv
env = RemoteEnv.make('CartPole-v0', url='0.0.0.0:8000')
Uses HTTP requests to communicate between the client and server (might add rpyc also in the future).
A Dockerfile is provided to help isolate your server in a Docker container.
docker run -p 8000:8000 --gpus all -it dibyaghosh/docker_gym_base
If you want to put your own environment in the container, you can simply start from this base image and install your own environment:
FROM dibyaghosh/docker_gym_base
pip install your_env