Skip to content

Commit 0fe70de

Browse files
committed
[mujoco] Offload locomotion data to envpool-assets
1 parent b468195 commit 0fe70de

7 files changed

Lines changed: 44 additions & 9 deletions

File tree

docs/content/build.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Runtime data ships in the three ``envpool-assets*`` packages from the ``0.4.x``
1010
compatibility line, including the updated MyoSuite and Playground models.
1111
The main wheel requires this asset version line; older EnvPool releases remain
1212
on ``0.3.x`` so they do not automatically receive the new models.
13+
The base ``envpool-assets`` package must be at least ``0.4.1`` for the DMC
14+
Composer locomotion and Soccer assets; the other two packages still accept ``0.4.0``.
1315

1416
We use `bazel <https://bazel.build/>`_ to build EnvPool. Comparing with
1517
`pip <https://pip.pypa.io/>`_, using Bazel to build python package with C++ .so

docs/env/dm_control_locomotion.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,12 @@ not guarantee identical mazes across platforms. No maze or task algorithm is
208208
patched, and model geometry is checked before reset-state sync.
209209

210210
Official XML, skins, textures, and LabMaze 1.0.6 sources are fetched at build
211-
time. Only the needed texture styles and model assets are packaged. The CMU
212-
2019 clip used to initialize Soccer and all 36 CMU 2020 ``WALK_TINY`` clips are
211+
time. The needed texture styles, model assets, motion clips, and license
212+
notices ship separately in ``envpool-assets>=0.4.1,<0.5.0``, keeping the main
213+
``envpool`` wheel below the PyPI size limit. Source builds use the generated
214+
Bazel assets directly, and the main wheel retains the native code's license
215+
notices. The CMU 2019 clip used to initialize Soccer and all 36 CMU 2020
216+
``WALK_TINY`` clips are
213217
extracted from the official, SHA-256-pinned datasets into approximately 7 MB
214218
of native data. Runtime installation does not download the full motion capture datasets
215219
or require HDF5, SciPy, LabMaze's Python extension, or ``dm_control``.

envpool/mujoco/locomotion/BUILD

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ copy_to_directory(
3131
strip_prefix = "mujoco_dmc_xml/",
3232
)
3333

34+
copy_to_directory(
35+
name = "licenses",
36+
srcs = ["//third_party/dmc_locomotion:licenses"],
37+
out = "licenses",
38+
flatten = True,
39+
strip_prefix = "",
40+
)
41+
3442
cc_library(
3543
name = "simulation",
3644
srcs = [
@@ -118,6 +126,7 @@ py_library(
118126
data = [
119127
":assets",
120128
":labmaze_assets",
129+
":licenses",
121130
":locomotion_envpool",
122131
],
123132
imports = ["../../.."],

envpool/mujoco/locomotion/registration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
gymnasium_cls="LocomotionGymnasiumEnvPool",
2929
task_name=task,
3030
base_path=asset_base_path(
31-
"envpool", "mujoco/locomotion/assets_dm_control"
31+
"envpool_assets", "mujoco/locomotion/assets_dm_control"
3232
),
3333
)

scripts/release_installed_wheel_smoke.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
"gfootball/assets/data",
1919
"mujoco/assets_dmc/cartpole.xml",
2020
"mujoco/assets_gym/ant.xml",
21+
"mujoco/locomotion/assets_dm_control/mocap_2019.bin",
22+
"mujoco/locomotion/assets_dm_control/mocap_2020.bin",
23+
"mujoco/locomotion/assets_labmaze/style_01/wall_blue_d.png",
2124
"mujoco/metaworld/assets/objects/assets/drawer.xml",
2225
"mujoco/robotics/assets/fetch/reach.xml",
2326
"procgen/assets/platformer/playerBlue_dead.png",
@@ -178,10 +181,22 @@ def main() -> None:
178181
f"{package_base_path}, expected {envpool_package}"
179182
)
180183

184+
bundled_locomotion_assets = list(
185+
(envpool_package / "mujoco/locomotion").glob("assets_*")
186+
)
187+
if bundled_locomotion_assets:
188+
raise RuntimeError(
189+
"locomotion data must ship in envpool-assets, not envpool: "
190+
f"{bundled_locomotion_assets}"
191+
)
192+
181193
for distribution, (module_name, rels) in _ASSET_PACKAGES.items():
182194
_check_asset_package(distribution, module_name, rels)
183195

184196
required_package_files = [
197+
envpool_package / "mujoco/locomotion/licenses/LICENSE",
198+
envpool_package / "mujoco/locomotion/licenses/LICENSE.scipy",
199+
envpool_package / "mujoco/locomotion/licenses/NOTICE",
185200
envpool_package / "vizdoom/bin/vizdoom",
186201
envpool_package / "vizdoom/bin/vizdoom.pk3",
187202
]

setup.cfg

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ packages = find:
2525
python_requires = >=3.12
2626
install_requires =
2727
dm-env>=1.4
28-
envpool-assets>=0.4.0,<0.5.0
28+
envpool-assets>=0.4.1,<0.5.0
2929
envpool-assets-mujoco-large>=0.4.0,<0.5.0
3030
envpool-assets-mujoco-playground-humanoid>=0.4.0,<0.5.0
3131
glfw>=2.10.0
@@ -50,9 +50,7 @@ envpool =
5050
jumanji/_official_render/img/*.png
5151
jumanji/assets/**/*.npy
5252
mujoco/*.so.*
53-
mujoco/locomotion/assets_dm_control/**/*
54-
mujoco/locomotion/assets_dm_control/*
55-
mujoco/locomotion/assets_labmaze/**/*
53+
mujoco/locomotion/licenses/*
5654
vizdoom/bin/vizdoom
5755
vizdoom/bin/vizdoom.pk3
5856

third_party/dmc_locomotion/BUILD

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,21 @@ genrule(
8080
)
8181

8282
filegroup(
83-
name = "mocap_runtime",
83+
name = "licenses",
8484
srcs = [
8585
"LICENSE.scipy",
8686
"NOTICE",
87+
"@labmaze_source//:LICENSE",
88+
],
89+
)
90+
91+
filegroup(
92+
name = "mocap_runtime",
93+
srcs = [
8794
"mocap.json",
8895
"mocap_2019.bin",
8996
"mocap_2020.bin",
90-
"@labmaze_source//:LICENSE",
97+
":licenses",
9198
],
9299
)
93100

0 commit comments

Comments
 (0)