Remote environment for minerl competition environments
Project description
remote-minerl-env
Remote environment for minerl competition environments
Table of Contents
About
This package allows to run the Minecraft Malmo instance for the minerl contest on any host and allows to access it from another host. The Minecraft instance on the selected host system is not closed to ensure the fastest possible availability. This allows to test the agent code much faster and in case of an error in the agent code you don't have to restart the Minecraft instance again. The host on which the Minecraft instance runs can also be identical to that of the agent.
In addition, the host on which the Malmo instance is running can be on a completely different network and can be accessed without port forwarding. For this purpose a reverse proxy is used, which forwards the requests to this host via an external and publicly accessible server.
Installation
remote-minerl-env requires Python 3.6+ to be installed.
With pip (recommend)
Use the following command to install remote-minerl-env with pip:
pip install remote-minerl-env
You can also very easily update to a newer version:
pip install remote-minerl-env -U
From source
git clone https://github.com/infinityofspace/remote_minerl_env.git
cd remote_minerl_env
pip install .
Usage
After the installation, you can start the remote environment with the following command on the desired host on which you want to run the Minecraft Malmo instance.
remote-minerl-env
All available arguments:
usage: remote-minerl-env [-e ENV_NAME] [-h HOST] [-p PORT] [--help]
optional arguments:
-e ENV_NAME, --env-name ENV_NAME
ID of the minerl environment.
-h HOST, --host HOST Host address to bind to.
-p PORT, --port PORT Port to bind to.
--ngrok NGROK_CONFIG_PATH TUNNEL_NAME
Use ngrok reverse proxy to expose the environment publicly
--help Show the help of the program.
After you have started the remote instance you only need to make minimal adjustments to your existing agent code and then you are done.
You have to use
from remote_minerl_env.environments.client import RemoteClientEnv
env = RemoteClientEnv("<name of the env>")
instead of
env = gym.make("<name of the env>")
That was all. The RemoteEnv also supports the functions step
, reset
and provides access to the
attribute action_space
of the original gym environment as class attribute.
Without any additional arguments the instance is only accessible from localhost on port 42424
To expose the Minecraft instance publicly you can use the --ngrok
parameter. This uses ngrok to
make your local instance accessible from outside your local network:
remote-minerl-env --ngrok /path/to/your/ngrok/config.yml <name-of-the-tunnel-to-use>
The tunnel must be a tcp tunnel and the local mapped port should match the port from the instance, which can be
customized with the --port
parameter (default port is 42424
).
Third party notices
All modules used by this project are listed below:
Name | License |
---|---|
minerl | LICENSE |
setuptools | MIT |
pyngrok | MIT |
Furthermore, this readme file contains embeddings of Shields.io badges.
License
MIT - Copyright (c) 2021 Marvin Heptner
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for remote_minerl_env-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be4637f3b6fb1099375d5ef37026fd0d17915920a0523b6ed3c9beacf8399e6a |
|
MD5 | 0c9d809343028654055b8270ba522631 |
|
BLAKE2b-256 | 0426f55b1844c50498f003abdf8bdf0b45dcac9927eb061cf41d19bbb6582725 |