fix(ci): pre-create libero config in Dockerfile to bypass stdin prompt

libero/__init__.py calls input() when ~/.libero/config.yaml is missing.
We write the config at image build time (without importing libero) so
the prompt never fires at runtime. Also trigger CI on pyproject.toml changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Pepijn
2026-04-08 11:34:36 +02:00
parent 42ef36eabd
commit 841cbb0835
2 changed files with 22 additions and 1 deletions
+2 -1
View File
@@ -33,6 +33,7 @@ on:
- "src/lerobot/scripts/lerobot_eval.py" - "src/lerobot/scripts/lerobot_eval.py"
- "docker/Dockerfile.benchmark.*" - "docker/Dockerfile.benchmark.*"
- ".github/workflows/benchmark_tests.yml" - ".github/workflows/benchmark_tests.yml"
- "pyproject.toml"
pull_request: pull_request:
branches: branches:
@@ -42,6 +43,7 @@ on:
- "src/lerobot/scripts/lerobot_eval.py" - "src/lerobot/scripts/lerobot_eval.py"
- "docker/Dockerfile.benchmark.*" - "docker/Dockerfile.benchmark.*"
- ".github/workflows/benchmark_tests.yml" - ".github/workflows/benchmark_tests.yml"
- "pyproject.toml"
permissions: permissions:
contents: read contents: read
@@ -103,7 +105,6 @@ jobs:
--shm-size=4g \ --shm-size=4g \
-e HF_HOME=/tmp/hf \ -e HF_HOME=/tmp/hf \
-e HF_USER_TOKEN="${HF_USER_TOKEN}" \ -e HF_USER_TOKEN="${HF_USER_TOKEN}" \
-e LIBERO_DATA_FOLDER=/tmp/libero_data \
lerobot-benchmark-libero:ci \ lerobot-benchmark-libero:ci \
bash -c " bash -c "
hf auth login --token \"\$HF_USER_TOKEN\" --add-to-git-credential 2>/dev/null || true hf auth login --token \"\$HF_USER_TOKEN\" --add-to-git-credential 2>/dev/null || true
+20
View File
@@ -67,6 +67,26 @@ COPY --chown=user_lerobot:user_lerobot src/ src/
RUN uv sync --locked --extra libero --no-cache RUN uv sync --locked --extra libero --no-cache
# Pre-create libero's config file so it never prompts for a dataset path at runtime.
# libero/libero/__init__.py calls input() when ~/.libero/config.yaml is missing.
# We replicate what get_default_path_dict() would write, without importing libero.
RUN python${PYTHON_VERSION} -c "
import os, yaml, importlib.util
spec = importlib.util.find_spec('libero')
pkg_dir = os.path.dirname(spec.origin)
libero_dir = os.path.join(pkg_dir, 'libero')
paths = {
'bddl_files': os.path.join(libero_dir, 'bddl_files'),
'init_states': os.path.join(libero_dir, 'init_files'),
'datasets': os.path.join(libero_dir, '../datasets'),
'assets': os.path.join(libero_dir, 'assets'),
}
config_dir = os.path.expanduser('~/.libero')
os.makedirs(config_dir, exist_ok=True)
with open(os.path.join(config_dir, 'config.yaml'), 'w') as f:
yaml.dump(paths, f)
"
RUN chmod +x /lerobot/.venv/lib/python${PYTHON_VERSION}/site-packages/triton/backends/nvidia/bin/ptxas RUN chmod +x /lerobot/.venv/lib/python${PYTHON_VERSION}/site-packages/triton/backends/nvidia/bin/ptxas
COPY --chown=user_lerobot:user_lerobot . . COPY --chown=user_lerobot:user_lerobot . .