Skip to content

crowdAI/marlo-single-agent-starter-kit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CrowdAI-Logo

marlo-single-agent-starter-kit

gitter-badge

FindTheGoal

Instructions to participate in the first round of the MarLo challenge.

The task is to submit an agent which can maximise the cumulative reward in the FindTheGoal-v0 environment in MarLo.

Participants will have to submit their code, with packaging specifications, and the evaluator will automatically build a docker image and execute their agent against different instantiations of the FindTheGoal environment.

Setup

  • docker : By following the instructions here
  • nvidia-docker : By following the instructions here
  • repo2docker
pip install crowdai-repo2docker
  • Anaconda (By following instructions here)
  • malmo and marlo
conda create python=3.6 --name marlo
conda config --add channels conda-forge
conda activate marlo # or `source activate marlo` depending on your conda version
conda install -c crowdai malmo
pip install -U marlo

# Test installation by :
python -c "import marlo"
python -c "from marlo import MalmoPython"
  • Your code specific dependencies
# If say you want to install PyTorch
conda install pytorch torchvision -c pytorch

Clone repository

git clone [email protected]:crowdAI/marlo-single-agent-starter-kit.git
cd marlo-single-agent-starter-kit

Build Docker Image locally

cd marlo-single-agent-starter-kit

# The following are the contents of the ./build.sh file
# Hence you can alternatively call ./build.sh for the same effect.

export IMAGE_NAME="marlo_random_agent"

crowdai-repo2docker --no-run \
  --user-id 1001 \
  --user-name crowdai \
  --image-name ${IMAGE_NAME} \
  --debug .

This should take some time, but it will build a docker image out of the this repository

Test Submission Locally

Assuming you have docker and the rest of the dependencies installed..

cd marlo-single-agent-starter-kit
# The following are the contents of the ./test_submission_locally.sh file
# Hence you can alternatively call ./test_submission_locally.sh for the same effect.

export IMAGE_NAME="marlo_random_agent"

# Build Image from the repository
./build.sh

# Ensure you have a Minecraft Client running on port 10000
# by doing : $MALMO_MINECRAFT_ROOT/launchClient.sh -port 10000

docker run --net=host -it $IMAGE_NAME /home/crowdai/run.sh

# Now if everything works out well, then you should see the agent inside
# the docker container interacting with the minecraft client on your host.

Important Concepts

Repository Structure

  • crowdai.json Each repository should have a crowdai.json with the following content :
{
  "challenge_id" : "crowdai-marLo-2018",
  "grader_id" : "crowdai-marLo-2018",
  "authors" : ["your-crowdai-username"],
  "description" : "sample description about your awesome marlo agent",
  "license" : "MIT",
  "gpu":false
}

This is used to map your submission to the said challenge, so please remember to use the correct challenge_id and grader_id as specified above.

Please specify if your code will a GPU or not for the evaluation of your model. If you specify true for the GPU, a NVIDIA Tesla K80 GPU will be provided and used for the evaluation.

Packaging of your software environment

You can specify your software environment by using all the available configuration options of repo2docker. (But please remember to use crowdai-repo2docker to have GPU support)

The recommended way is to use Anaconda configuration files using environment.yml files.

# The included environment.yml is generated by the command below, and you do not need to run it again 
# if you did not add any custom dependencies

conda env export --no-build > environment.yml

# Note the `--no-build` flag, which is important if you want your anaconda env to be replicable across all 

Debugging the packaged software environment

If you have issues with your submission because of your software environment and dependencies, you can debug them, by first building the docker image, and then getting a shell inside the image by :

docker run --net=host -it $IMAGE_NAME /bin/bash 

and then exploring to find the cause of the issue.

Code Entrypoint

The evaluator will use /home/crowdai/run.sh as the entrypoint, so please remember to have a run.sh at the root, which can instantitate any necessary environment variables, and also start executing your actual code. This repository includes a sample run.sh file. If you are using a Dockerfile to specify your software environment, please remember to create a crowdai user, and place the entrypoint code at run.sh.

Submission

To make a submission, you will have to create a private repository on https://gitlab.crowdai.org.

You will have to add your SSH Keys to your GitLab account by following the instructions here. If you do not have SSH Keys, you will first need to generate one.

Then you can create a submission by making a tag push to your repository on https://gitlab.crowdai.org. Any tag push to your private repository is considered as a submission
Then you can add the correct git remote, and finally submit by doing :

cd marlo-single-agent-starter-kit
# Add crowdAI git remote endpoint
git remote add crowdai [email protected]:<YOUR_CROWDAI_USER_NAME>/marlo-single-agent-starter-kit.git
git push crowdai master

# Create a tag for your submission and push
git tag -am "v0.1" v0.1
git push crowdai master
git push crowdai v0.1

# Note : If the contents of your repository (latest commit hash) does not change, 
# then pushing a new tag will not trigger a new evaluation.

You now should be able to see the details of your submission at : gitlab.crowdai.org/<YOUR_CROWDAI_USER_NAME>/marlo-single-agent-starter-kit/issues

NOTE: Remember to update your username in the link above 😉

In the link above, you should start seeing something like this take shape (each of the steps can take a bit of time, so please be patient too 😉 ) :

and if everything works out correctly, then you should be able to see the final scores like this :

Best of Luck 🎉 🎉

Author

Sharada Mohanty https://twitter.com/MeMohanty

Releases

No releases published

Packages

No packages published