Installing Docker on Windows 10 for Education
What we did before
We installed our gym retro and got our sonic game running with simple algorithm.
PS: It’s actually computer playing sonic by running this script:
import gym_remote.exceptions as gre import gym_remote.client as grc from retro import make def main(): print('connecting to remote environment') env = make(game='SonicTheHedgehog-Genesis', state='GreenHillZone.Act1') print('starting episode') env.reset() while True: env.render() action = env.action_space.sample() action = 1 ob, reward, done, _ = env.step(action) if done: print('episode complete') env.reset() if __name__ == '__main__': try: main() except gre.GymRemoteError as e: print('exception', e)
We want now to upload our agent to the server and we can do it through Docker.
PS2: The above example wont work on server because we use local enviroment!
from retro import make and env = make(game=’SonicTheHedgehog-Genesis’, state=’GreenHillZone.Act1′)
Follow the instructions on page:
Because of Personal Settings i would suggest to register account and log in first.
This way you get auto-fill of this form:
export DOCKER_REGISTRY=<docker registry url> docker login >$DOCKER_REGISTRY \ --username <docker registry username> \ --password <docker registry password>
For test purposes i would first curl the files:
mkdir simple-agent cd simple-agent curl -O https://contest.openai.com/static/simple-agent.py curl -O https://contest.openai.com/static/simple-agent.docker docker build -f simple-agent.docker -t $DOCKER_REGISTRY/simple-agent:v1 .
docker push $DOCKER_REGISTRY/simple-agent:v1
The next thing are local evaluations.
docker pull openai/retro-env docker tag openai/retro-env remote-env
and running the agent:
retro-contest run --agent $DOCKER_REGISTRY/simple-agent:v1 \ --results-dir results --no-nv --use-host-data \ SonicTheHedgehog-Genesis GreenHillZone.Act1
If you run all this in git-bash, there is a possibility that you can’t close the agent.
I would than open new terminal and wrote:
docker ps # get the id of the running container docker stop <container> # kill it (gracefully)
This way if you did something wrong you get an error message saying what went wrong.
You can see the scores and logs of the local evaluation if you open results folder and look at the log.csv and monitor.csv
If the local evaluation went good, we can upload the same agent on the page.
Go to “Jobs” on page and submit your agent:
If you want to upload your scenario.json with your jerk agent and include it in your agent i was told it is not possible. With the jerk agent from retro/baselines we can only edit the script. We can’t modify the scenario.json file.
To run the docker you need to have docker app installed.
Before configuration docker for windows i would suggest to create an account password. Account password is needed to configure docker app.
Other Blog posts on the same topic:
Tensorflow PPO2 Algorithm
Configuring on Mac:
Building your own Images: