Skip to content

Commit

Permalink
add dockerfile, fixes #23 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherhesse authored Jan 10, 2020
1 parent 80ff21d commit 3f38ddc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.9.4

* add random agent script
* add example Dockerfile

## 0.9.3

* changed pyglet dependency to `pyglet~=1.4.8`
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ To install the wheel:
pip install procgen
```

If you get an error like `"Could not find a version that satisfies the requirement procgen"`, please upgrade pip: `pip install --upgrade pip`.

To try an environment out interactively:

```
Expand All @@ -72,6 +74,15 @@ venv = ProcgenEnv(num_envs=1, env_name="coinrun")

The environment uses the [`VecEnv`](https://github.com/openai/baselines/blob/master/baselines/common/vec_env/vec_env.py#L29) interface from [`baselines`](https://github.com/openai/baselines), `baselines` is not a dependency of this library.

### Docker

A [`Dockerfile`](Dockerfile) is included to demonstrate a minimal Docker-based setup that works for running random agent.

```
docker build docker --tag procgen
docker run --rm -it procgen python3 -m procgen.examples.random_agent
```

## Environments

The observation space is a box space with the RGB pixels the agent sees in a numpy array of shape (64, 64, 3). The expected step rate for a human player is 15 Hz.
Expand Down
4 changes: 4 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM ubuntu:bionic-20191202
RUN apt-get update && apt-get install --yes --no-install-recommends python3-pip python3-setuptools libglib2.0-0
RUN pip3 install --upgrade pip
RUN pip3 install procgen
Empty file added procgen/examples/__init__.py
Empty file.
14 changes: 14 additions & 0 deletions procgen/examples/random_agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Example random agent script to demonstrate that procgen works
"""

import gym
env = gym.make('procgen:procgen-coinrun-v0')
obs = env.reset()
step = 0
while True:
obs, rew, done, info = env.step(env.action_space.sample())
print(f"step {step} reward {rew} done {done}")
step += 1
if done:
break
2 changes: 1 addition & 1 deletion procgen/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.3
0.9.4

0 comments on commit 3f38ddc

Please sign in to comment.