From 6057638fc16dd349ad662c800a3475807b7d4921 Mon Sep 17 00:00:00 2001 From: Pepijn Kooijmans Date: Mon, 23 Mar 2026 18:44:14 +0100 Subject: [PATCH] fix(docker): pre-create libero config.yaml to avoid interactive input() prompt The upstream libero __init__.py calls input() when ~/.libero/config.yaml is missing, which crashes in non-interactive Docker containers with EOFError. Pre-create the config with default paths at build time using importlib.util.find_spec to locate the module without triggering the problematic import. Made-with: Cursor --- docker/Dockerfile.benchmark | 10 +++++++++- docker/Dockerfile.eval-libero-plus | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile.benchmark b/docker/Dockerfile.benchmark index d1feb356d..20139d4fd 100644 --- a/docker/Dockerfile.benchmark +++ b/docker/Dockerfile.benchmark @@ -116,7 +116,15 @@ RUN case "${BENCHMARK}" in \ && PATH=/usr/bin:/bin:/lerobot/.venv/bin:$PATH /lerobot/.venv/bin/python -m pip install --no-cache-dir --no-deps /tmp/LIBERO-plus \ && /lerobot/.venv/bin/python -c "import pathlib, site; pathlib.Path(site.getsitepackages()[0], 'libero_plus_repo.pth').write_text('/tmp/LIBERO-plus\n')" \ && /lerobot/.venv/bin/python -m pip install --no-cache-dir . \ - && /lerobot/.venv/bin/python -c "import libero, robosuite, bddl" ;; \ + && /lerobot/.venv/bin/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')" \ + && /lerobot/.venv/bin/python -c "from libero.libero import benchmark, get_libero_path; print('libero OK')" ;; \ *) \ uv pip install --no-cache ".[${BENCHMARK}]" ;; \ esac diff --git a/docker/Dockerfile.eval-libero-plus b/docker/Dockerfile.eval-libero-plus index c6d6953af..a59ff8818 100644 --- a/docker/Dockerfile.eval-libero-plus +++ b/docker/Dockerfile.eval-libero-plus @@ -34,6 +34,14 @@ RUN uv pip install --no-cache \ 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 libero, robosuite, bddl" + && 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')" CMD ["/bin/bash"]