Files
lerobot/docker/Dockerfile.eval-libero-plus
T
Pepijn Kooijmans aae68e3448 fix(docker): use recursive glob for deeply nested asset zip structure
The LIBERO-plus assets.zip has a deeply nested path
(inspire/hdd/project/.../assets) that didn't match the shallow glob.
Use recursive glob to find assets/scenes regardless of nesting depth.

Made-with: Cursor
2026-03-23 18:57:44 +01:00

61 lines
2.9 KiB
Docker

# Copyright 2026 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM lerobot-eval-base:latest
# Install libero_plus deps explicitly rather than via ".[libero_plus]" extras chain.
# uv has a bug where it considers packages "already resolved" when coming through
# a nested lerobot[libero] → lerobot[libero_plus] extras chain, silently skipping them.
RUN uv pip install --no-cache \
"hf-libero>=0.1.3,<0.2.0" \
"hf-egl-probe>=1.0.1" \
"transformers>=5.3.0,<6.0.0" \
"scipy>=1.14.0,<2.0.0" \
"bddl>=1.0.1,<2.0.0" \
"future" \
"easydict>=1.9" \
"wand" \
"scikit-image>=0.20.0" \
"gym>=0.25.0,<0.27.0"
# Clone LIBERO-plus; install with --no-deps (runtime deps declared above via hf-libero).
# Add .pth so the libero module can locate its data files at runtime.
RUN git clone --depth 1 https://github.com/sylvestf/LIBERO-plus.git /tmp/LIBERO-plus \
&& uv pip install --no-cache --no-deps /tmp/LIBERO-plus \
&& python -c "import pathlib, site; pathlib.Path(site.getsitepackages()[0], 'libero_plus_repo.pth').write_text('/tmp/LIBERO-plus\n')" \
&& python -c "\
import os, yaml, importlib.util; \
root = os.path.dirname(importlib.util.find_spec('libero.libero').origin); \
d = dict(benchmark_root=root, bddl_files=os.path.join(root,'bddl_files'), \
init_states=os.path.join(root,'init_files'), datasets=os.path.join(root,'..','datasets'), \
assets=os.path.join(root,'assets')); \
cfg_dir = os.path.expanduser('~/.libero'); os.makedirs(cfg_dir, exist_ok=True); \
yaml.dump(d, open(os.path.join(cfg_dir,'config.yaml'),'w')); print('libero config created')" \
&& python -c "from libero.libero import benchmark, get_libero_path; print('libero OK')" \
&& python -c "\
from huggingface_hub import hf_hub_download; \
import zipfile, shutil, glob, os; \
from libero.libero import get_libero_path; \
assets_dst = os.path.join(get_libero_path('benchmark_root'), 'assets'); \
print(f'Downloading LIBERO-plus assets to {assets_dst}...'); \
zp = hf_hub_download('Sylvest/LIBERO-plus', 'assets.zip', repo_type='dataset', local_dir='/tmp/lp-dl'); \
zipfile.ZipFile(zp).extractall('/tmp/lp-unzip'); \
hits = glob.glob('/tmp/lp-unzip/**/assets/scenes', recursive=True); \
src = os.path.dirname(hits[0]); \
shutil.move(src, assets_dst); \
shutil.rmtree('/tmp/lp-dl', True); shutil.rmtree('/tmp/lp-unzip', True); \
print(f'Assets installed: {os.listdir(assets_dst)[:5]}...')"
CMD ["/bin/bash"]