Skip to content

Commit d44c541

Browse files
YukunJTrinkle23897Leo Guo
authored
Procgen Integration (#197)
Procgen library change in https://github.com/Trinkle23897/procgen - Fix Qt library include error - Fix globalGameRegistry == nullptr issue by adding another explicit make_* function (thanks to Yukun!) - Disable auto-reset because envpool has already handled this feature Changes: - Add new dependency `qtdeclarative5-dev`, rebuild docker image - Update pypi wheel from manylinux_2_17_x86_64 to manylinux_2_24_x86_64 because of libstdc++.so.6 symbol - Add 42 procgen envs - Refactor `base_path` Co-authored-by: Jiayi Weng <trinkle23897@gmail.com> Co-authored-by: Leo Guo <jiongtig@andrew.cmu.edu>
1 parent 60459ad commit d44c541

34 files changed

+818
-40
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
release:
1111
runs-on: ubuntu-latest
12-
container: trinkle23897/envpool-release:2022-12-29-03c3d95
12+
container: trinkle23897/envpool-release:2023-01-02-5f1a5fd
1313
strategy:
1414
matrix:
1515
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
@@ -27,7 +27,7 @@ jobs:
2727
- name: Build
2828
run: |
2929
make pypi-wheel
30-
pip3 install wheelhouse/*.whl --force-reinstall
30+
pip3 install dist/*.whl --force-reinstall
3131
- name: Test
3232
run: |
3333
make release-test

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ docker-release-launch: docker-release
180180
docker run --network=host -v /:/host --shm-size=4gb -it $(PROJECT_NAME)-release:$(DOCKER_TAG) bash
181181

182182
pypi-wheel: auditwheel-install bazel-release
183-
ls dist/*.whl -Art | tail -n 1 | xargs auditwheel repair --plat manylinux_2_17_x86_64
183+
ls dist/*.whl -Art | tail -n 1 | xargs auditwheel repair --plat manylinux_2_24_x86_64
184184

185185
release-test1:
186186
cd envpool && python3 make_test.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- [x] [ViZDoom single player](https://envpool.readthedocs.io/en/latest/env/vizdoom.html)
1717
- [x] [DeepMind Control Suite](https://envpool.readthedocs.io/en/latest/env/dm_control.html)
1818
- [x] [Box2D](https://envpool.readthedocs.io/en/latest/env/box2d.html)
19-
- [ ] Procgen
19+
- [x] [Procgen](https://envpool.readthedocs.io/en/latest/env/procgen.html)
2020
- [ ] Minigrid
2121

2222
Here are EnvPool's several highlights:

WORKSPACE

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ load("//envpool:workspace1.bzl", workspace1 = "workspace")
88

99
workspace1()
1010

11+
# QT special, cannot move to workspace2.bzl, not sure why
12+
13+
load("@local_config_qt//:local_qt.bzl", "local_qt_path")
14+
15+
new_local_repository(
16+
name = "qt",
17+
build_file = "@com_justbuchanan_rules_qt//:qt.BUILD",
18+
path = local_qt_path(),
19+
)
20+
21+
load("@com_justbuchanan_rules_qt//tools:qt_toolchain.bzl", "register_qt_toolchains")
22+
23+
register_qt_toolchains()
24+
1125
load("//envpool:pip.bzl", pip_workspace = "workspace")
1226

1327
pip_workspace()

docker/dev-cn.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG HOME=/root
77
ARG PATH=$PATH:$HOME/go/bin
88

99
RUN apt-get update \
10-
&& apt-get install -y python3-pip python3-dev golang-1.18 clang-format-11 git wget swig tmux clang-tidy vim \
10+
&& apt-get install -y python3-pip python3-dev golang-1.18 clang-format-11 git wget swig tmux clang-tidy vim qtdeclarative5-dev \
1111
&& rm -rf /var/lib/apt/lists/*
1212
RUN ln -s /usr/bin/python3 /usr/bin/python
1313
RUN ln -sf /usr/lib/go-1.18/bin/go /usr/bin/go

docker/dev.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ARG HOME=/root
77
ARG PATH=$PATH:$HOME/go/bin
88

99
RUN apt-get update \
10-
&& apt-get install -y python3-pip python3-dev golang-1.18 clang-format-11 git wget swig tmux clang-tidy vim \
10+
&& apt-get install -y python3-pip python3-dev golang-1.18 clang-format-11 git wget swig tmux clang-tidy vim qtdeclarative5-dev \
1111
&& rm -rf /var/lib/apt/lists/*
1212
RUN ln -s /usr/bin/python3 /usr/bin/python
1313
RUN ln -sf /usr/lib/go-1.18/bin/go /usr/bin/go

docker/release.dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ RUN apt-get update && apt-get install -y software-properties-common && add-apt-r
1414
RUN apt-get update \
1515
&& apt-get install -y git curl wget gcc-9 g++-9 build-essential swig make \
1616
zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libncursesw5-dev libffi-dev liblzma-dev \
17-
llvm xz-utils tk-dev libxml2-dev libxmlsec1-dev
17+
llvm xz-utils tk-dev libxml2-dev libxmlsec1-dev qtdeclarative5-dev \
18+
&& rm -rf /var/lib/apt/lists/*
1819
# use self-compiled openssl instead of system provided (1.0.2)
1920
RUN apt-get remove -y libssl-dev
2021

docs/env/procgen.rst

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
Procgen
2+
=======
3+
4+
We use ``procgen==0.10.7`` as the codebase.
5+
See https://github.com/openai/procgen/tree/0.10.7
6+
7+
8+
Options
9+
-------
10+
11+
* ``task_id (str)``: see available tasks below;
12+
* ``num_envs (int)``: how many environments you would like to create;
13+
* ``batch_size (int)``: the expected batch size for return result, default to
14+
``num_envs``;
15+
* ``num_threads (int)``: the maximum thread number for executing the actual
16+
``env.step``, default to ``batch_size``;
17+
* ``seed (int)``: the environment seed, default to ``42``;
18+
* ``max_episode_steps (int)``: the maximum number of steps for one episode,
19+
each procgen game has different timeout value;
20+
* ``env_name (str)``: one of 16 procgen env name;
21+
* ``num_levels (int)``: default to ``0``;
22+
* ``start_level (int)``: default to ``0``;
23+
* ``use_sequential_levels (bool)``: default to ``False``;
24+
* ``center_agent (bool)``: default to ``True``;
25+
* ``use_backgrounds (bool)``: default to ``True``;
26+
* ``use_monochrome_assets (bool)``: default to ``False``;
27+
* ``restrict_themes (bool)``: default to ``False``;
28+
* ``use_generated_assets (bool)``: default to ``False``;
29+
* ``paint_vel_info (bool)``: default to ``False``;
30+
* ``use_easy_jump (bool)``: default to ``False``;
31+
* ``distribution_mode (int)``: one of ``(0, 1, 2, 10)``; ``0`` stands for easy
32+
mode, ``1`` stands for hard mode, ``2`` stands for extreme mode, ``10``
33+
stands for memory mode. The default value is determined by ``task_id``.
34+
35+
Note: arguments after ``env_name`` are provided by procgen environment itself.
36+
We keep the default value as-is. We haven't tested the setting of
37+
``use_sequential_levels == True``, and have no promise it is aligned with the
38+
original version of procgen (PRs for fixing this issue are highly welcome).
39+
40+
41+
Observation Space
42+
-----------------
43+
44+
The observation image size is ``(64, 64, 3)``.
45+
46+
47+
Action Space
48+
------------
49+
50+
15 action buttons in total, ranging from 0 to 14.
51+
52+
53+
Available Tasks
54+
---------------
55+
56+
* ``BigfishEasy-v0``
57+
* ``BigfishHard-v0``
58+
* ``BossfightEasy-v0``
59+
* ``BossfightHard-v0``
60+
* ``CaveflyerEasy-v0``
61+
* ``CaveflyerHard-v0``
62+
* ``CaveflyerMemory-v0``
63+
* ``ChaserEasy-v0``
64+
* ``ChaserHard-v0``
65+
* ``ChaserExtreme-v0``
66+
* ``ClimberEasy-v0``
67+
* ``ClimberHard-v0``
68+
* ``CoinrunEasy-v0``
69+
* ``CoinrunHard-v0``
70+
* ``DodgeballEasy-v0``
71+
* ``DodgeballHard-v0``
72+
* ``DodgeballExtreme-v0``
73+
* ``DodgeballMemory-v0``
74+
* ``FruitbotEasy-v0``
75+
* ``FruitbotHard-v0``
76+
* ``HeistEasy-v0``
77+
* ``HeistHard-v0``
78+
* ``HeistMemory-v0``
79+
* ``JumperEasy-v0``
80+
* ``JumperHard-v0``
81+
* ``JumperMemory-v0``
82+
* ``LeaperEasy-v0``
83+
* ``LeaperHard-v0``
84+
* ``LeaperExtreme-v0``
85+
* ``MazeEasy-v0``
86+
* ``MazeHard-v0``
87+
* ``MazeMemory-v0``
88+
* ``MinerEasy-v0``
89+
* ``MinerHard-v0``
90+
* ``MinerMemory-v0``
91+
* ``NinjaEasy-v0``
92+
* ``NinjaHard-v0``
93+
* ``PlunderEasy-v0``
94+
* ``PlunderHard-v0``
95+
* ``StarpilotEasy-v0``
96+
* ``StarpilotHard-v0``
97+
* ``StarpilotExtreme-v0``

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ stable version through `envpool.readthedocs.io/en/stable/
9191
env/classic_control
9292
env/dm_control
9393
env/mujoco_gym
94+
env/procgen
9495
env/toy_text
9596
env/vizdoom
9697

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,4 @@ api
6868
jit
6969
mins
7070
lidar
71+
procgen

0 commit comments

Comments
 (0)