mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-16 00:59:46 +00:00
9be5e4f3bf
The multiline RUN python -c "..." was being parsed as Dockerfile instructions. Use printf to write ~/.libero/config.yaml directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
82 lines
3.3 KiB
Docker
82 lines
3.3 KiB
Docker
# Copyright 2025 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.
|
|
|
|
# Isolated benchmark image for LIBERO integration tests.
|
|
# Installs only lerobot[libero] so its dep tree (hf-libero, dm-control, mujoco)
|
|
# cannot conflict with other benchmarks.
|
|
#
|
|
# Build: docker build -f docker/Dockerfile.benchmark.libero -t lerobot-benchmark-libero .
|
|
# Run: docker run --gpus all --rm lerobot-benchmark-libero lerobot-eval ...
|
|
|
|
ARG CUDA_VERSION=12.4.1
|
|
ARG OS_VERSION=22.04
|
|
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu${OS_VERSION}
|
|
|
|
ARG PYTHON_VERSION=3.12
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \
|
|
MUJOCO_GL=egl \
|
|
PATH=/lerobot/.venv/bin:$PATH \
|
|
CUDA_VISIBLE_DEVICES=0 \
|
|
DEVICE=cuda
|
|
|
|
# System deps — same set as Dockerfile.internal
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common build-essential git curl \
|
|
libglib2.0-0 libgl1-mesa-glx libegl1-mesa ffmpeg \
|
|
libusb-1.0-0-dev speech-dispatcher libgeos-dev portaudio19-dev \
|
|
cmake pkg-config ninja-build \
|
|
&& add-apt-repository -y ppa:deadsnakes/ppa \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends \
|
|
python${PYTHON_VERSION} \
|
|
python${PYTHON_VERSION}-venv \
|
|
python${PYTHON_VERSION}-dev \
|
|
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
|
&& mv /root/.local/bin/uv /usr/local/bin/uv \
|
|
&& useradd --create-home --shell /bin/bash user_lerobot \
|
|
&& usermod -aG sudo user_lerobot \
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /lerobot
|
|
RUN chown -R user_lerobot:user_lerobot /lerobot
|
|
USER user_lerobot
|
|
|
|
ENV HOME=/home/user_lerobot \
|
|
HF_HOME=/home/user_lerobot/.cache/huggingface \
|
|
HF_LEROBOT_HOME=/home/user_lerobot/.cache/huggingface/lerobot \
|
|
TORCH_HOME=/home/user_lerobot/.cache/torch \
|
|
TRITON_CACHE_DIR=/home/user_lerobot/.cache/triton
|
|
|
|
RUN uv venv --python python${PYTHON_VERSION}
|
|
|
|
# Install only lerobot[libero] — completely isolated from metaworld's dep tree
|
|
COPY --chown=user_lerobot:user_lerobot setup.py pyproject.toml uv.lock README.md MANIFEST.in ./
|
|
COPY --chown=user_lerobot:user_lerobot src/ src/
|
|
|
|
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.
|
|
# Any valid YAML satisfies the existence check; actual paths only matter for dataset loading.
|
|
RUN mkdir -p /home/user_lerobot/.libero && \
|
|
printf 'assets: /tmp/libero_assets\nbddl_files: /tmp/libero_bddl\ndatasets: /tmp/libero_datasets\ninit_states: /tmp/libero_init\n' \
|
|
> /home/user_lerobot/.libero/config.yaml
|
|
|
|
RUN chmod +x /lerobot/.venv/lib/python${PYTHON_VERSION}/site-packages/triton/backends/nvidia/bin/ptxas
|
|
|
|
COPY --chown=user_lerobot:user_lerobot . .
|
|
|
|
CMD ["/bin/bash"]
|