fix(docker): download LIBERO-plus assets (~6 GB) at image build time

The benchmark containers were missing the scene/texture/object assets
required by LIBERO-plus. Download them from HuggingFace Hub during the
Docker build so containers are self-contained and ready to run.

Made-with: Cursor
This commit is contained in:
Pepijn Kooijmans
2026-03-23 18:48:25 +01:00
parent 6057638fc1
commit 4b9f6c4aed
2 changed files with 26 additions and 2 deletions
+13 -1
View File
@@ -124,7 +124,19 @@ init_states=os.path.join(root,'init_files'), datasets=os.path.join(root,'..','da
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')" \
&& /lerobot/.venv/bin/python -c "from libero.libero import benchmark, get_libero_path; print('libero OK')" ;; \
&& /lerobot/.venv/bin/python -c "from libero.libero import benchmark, get_libero_path; print('libero OK')" \
&& /lerobot/.venv/bin/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'); \
src = glob.glob('/tmp/lp-unzip/inspire/*/assets')[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]}...')" ;; \
*) \
uv pip install --no-cache ".[${BENCHMARK}]" ;; \
esac