Skip to main content

Remote environment for minerl competition environments

Project description

remote-minerl-env

Remote environment for minerl competition environments


PyPI - Python Version GitHub GitHub Workflow Status


Table of Contents

  1. About
  2. Installation
    1. With pip (recommend)
    2. From source
  3. Usage
  4. Examples
  5. Third party notices
  6. License

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

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

remote_minerl_env-0.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

remote_minerl_env-0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file remote_minerl_env-0.1.tar.gz.

File metadata

  • Download URL: remote_minerl_env-0.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for remote_minerl_env-0.1.tar.gz
Algorithm Hash digest
SHA256 b95fdd9555b4c7367ef7278951bdfa1032c84be70043c0af7eec66b8f4a8c9b3
MD5 068286fb134242fa6e77462048910a62
BLAKE2b-256 f675fab183977ed6b2df0cc1d803c00f3619a5d75d53cfe297eed34174a4b9c7

See more details on using hashes here.

File details

Details for the file remote_minerl_env-0.1-py3-none-any.whl.

File metadata

  • Download URL: remote_minerl_env-0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for remote_minerl_env-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 be4637f3b6fb1099375d5ef37026fd0d17915920a0523b6ed3c9beacf8399e6a
MD5 0c9d809343028654055b8270ba522631
BLAKE2b-256 0426f55b1844c50498f003abdf8bdf0b45dcac9927eb061cf41d19bbb6582725

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page