From 3b28fc94e6da698416a8d040251737822e7ffe62 Mon Sep 17 00:00:00 2001 From: William Yue Date: Mon, 5 Jan 2026 15:06:21 -0800 Subject: [PATCH] fixed docker ci --- .github/workflows/build-docker-images.yml | 108 ++-------------------- .github/workflows/test-docker-build.yml | 82 ---------------- Dockerfile | 10 +- src/opentau/datasets/lerobot_dataset.py | 4 +- tests/fixtures/constants.py | 2 +- tests/fixtures/hub.py | 4 +- 6 files changed, 15 insertions(+), 195 deletions(-) delete mode 100644 .github/workflows/test-docker-build.yml diff --git a/.github/workflows/build-docker-images.yml b/.github/workflows/build-docker-images.yml index 0cb11d5..5a902c9 100644 --- a/.github/workflows/build-docker-images.yml +++ b/.github/workflows/build-docker-images.yml @@ -1,24 +1,7 @@ -# Copyright 2024 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. - -# Inspired by -# https://github.com/huggingface/peft/blob/main/.github/workflows/build_docker_images.yml -name: Builds +name: Build and Push Docker Image on: workflow_dispatch: - workflow_call: schedule: - cron: "0 1 * * *" @@ -28,86 +11,9 @@ env: PYTHON_VERSION: "3.10" jobs: - latest-cpu: - name: CPU - runs-on: - group: aws-general-8-plus - steps: - - name: Install Git LFS - run: | - sudo apt-get update - sudo apt-get install git-lfs - git lfs install - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - cache-binary: false - - - name: Check out code - uses: actions/checkout@v4 - with: - lfs: true - persist-credentials: false - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build and Push CPU - uses: docker/build-push-action@v5 - with: - context: . - file: ./docker/lerobot-cpu/Dockerfile - push: true - tags: huggingface/lerobot-cpu - build-args: PYTHON_VERSION=${{ env.PYTHON_VERSION }} - - - latest-cuda: - name: GPU - runs-on: - group: aws-general-8-plus - steps: - - name: Install Git LFS - run: | - sudo apt-get update - sudo apt-get install git-lfs - git lfs install - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - cache-binary: false - - - name: Check out code - uses: actions/checkout@v4 - with: - lfs: true - persist-credentials: false - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build and Push GPU - uses: docker/build-push-action@v5 - with: - context: . - file: ./docker/lerobot-gpu/Dockerfile - push: true - tags: huggingface/lerobot-gpu - build-args: PYTHON_VERSION=${{ env.PYTHON_VERSION }} - - - latest-cuda-dev: - name: GPU Dev - runs-on: - group: aws-general-8-plus + build-and-push: + name: Build and Push + runs-on: ubuntu-latest steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -125,11 +31,11 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_PASSWORD }} - - name: Build and Push GPU dev + - name: Build and Push uses: docker/build-push-action@v5 with: context: . - file: ./docker/lerobot-gpu-dev/Dockerfile + file: ./Dockerfile push: true - tags: huggingface/lerobot-gpu:dev + tags: TensorAuto/OpenTau:latest build-args: PYTHON_VERSION=${{ env.PYTHON_VERSION }} diff --git a/.github/workflows/test-docker-build.yml b/.github/workflows/test-docker-build.yml deleted file mode 100644 index c310256..0000000 --- a/.github/workflows/test-docker-build.yml +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 2024 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. - -# Inspired by -# https://github.com/huggingface/peft/blob/main/.github/workflows/test-docker-build.yml -name: Test Dockerfiles - -on: - pull_request: - paths: - # Run only when DockerFile files are modified - - "docker/**" - -permissions: {} - -env: - PYTHON_VERSION: "3.10" - -jobs: - get_changed_files: - name: Detect modified Dockerfiles - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@3f54ebb830831fc121d3263c1857cfbdc310cdb9 #v42 - with: - files: docker/** - json: "true" - - - name: Run step if only the files listed above change # zizmor: ignore[template-injection] - if: steps.changed-files.outputs.any_changed == 'true' - id: set-matrix - run: | - echo "matrix=${{ steps.changed-files.outputs.all_changed_files}}" >> $GITHUB_OUTPUT - - build_modified_dockerfiles: - name: Build modified Docker images - needs: get_changed_files - runs-on: - group: aws-general-8-plus - if: needs.get_changed_files.outputs.matrix != '' - strategy: - fail-fast: false - matrix: - docker-file: ${{ fromJson(needs.get_changed_files.outputs.matrix) }} - steps: - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - cache-binary: false - - - name: Check out code - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Build Docker image - uses: docker/build-push-action@v5 - with: - file: ${{ matrix.docker-file }} - context: . - push: False - build-args: PYTHON_VERSION=${{ env.PYTHON_VERSION }} diff --git a/Dockerfile b/Dockerfile index ec6cb6c..0f13c99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,7 @@ RUN apt-get update && apt-get install -y \ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv # Set working directory -WORKDIR /lerobot +WORKDIR /opentau # Copy project files COPY . . @@ -34,14 +34,10 @@ COPY . . # We explicitly use the system python 3.10 for the venv RUN uv venv .venv --python /usr/bin/python3.10 && \ . .venv/bin/activate && \ - uv sync --extra tau0 --extra test --extra video_benchmark \ - --extra accelerate --extra dev --extra feetech \ - --extra openai --extra onnx --extra smolvla \ - --extra libero --extra metaworld + uv sync --all-extras # Set environment variables -ENV PATH="/lerobot/.venv/bin:$PATH" -ENV LEROBOT_HOME="/lerobot" +ENV PATH=".venv/bin:$PATH" # Default command CMD ["/bin/bash"] diff --git a/src/opentau/datasets/lerobot_dataset.py b/src/opentau/datasets/lerobot_dataset.py index bb58ff8..f6ba1be 100644 --- a/src/opentau/datasets/lerobot_dataset.py +++ b/src/opentau/datasets/lerobot_dataset.py @@ -955,8 +955,8 @@ def __init__( repo_id (str): This is the repo id that will be used to fetch the dataset. Locally, the dataset will be stored under root/repo_id. root (Path | None, optional): Local directory to use for downloading/writing files. You can also - set the LEROBOT_HOME environment variable to point to a different location. Defaults to - '~/.cache/huggingface/lerobot'. + set the HF_OPENTAU_HOME environment variable to point to a different location. Defaults to + '~/.cache/huggingface/opentau'. episodes (list[int] | None, optional): If specified, this will only load episodes specified by their episode_index in this list. Defaults to None. image_transforms (Callable | None, optional): You can pass standard v2 image transforms from diff --git a/tests/fixtures/constants.py b/tests/fixtures/constants.py index 7d77a0d..b777e77 100644 --- a/tests/fixtures/constants.py +++ b/tests/fixtures/constants.py @@ -14,7 +14,7 @@ # limitations under the License. from opentau.constants import HF_OPENTAU_HOME -LEROBOT_TEST_DIR = HF_OPENTAU_HOME / "_testing" +OPENTAU_TEST_DIR = HF_OPENTAU_HOME / "_testing" DUMMY_REPO_ID = "dummy/repo" DUMMY_ROBOT_TYPE = "dummy_robot" DUMMY_MOTOR_FEATURES = { diff --git a/tests/fixtures/hub.py b/tests/fixtures/hub.py index 6fbcb48..d78217c 100644 --- a/tests/fixtures/hub.py +++ b/tests/fixtures/hub.py @@ -25,7 +25,7 @@ STATS_PATH, TASKS_PATH, ) -from tests.fixtures.constants import LEROBOT_TEST_DIR +from tests.fixtures.constants import OPENTAU_TEST_DIR @pytest.fixture(scope="session") @@ -90,7 +90,7 @@ def _mock_snapshot_download( **kwargs, ) -> str: if not local_dir: - local_dir = LEROBOT_TEST_DIR + local_dir = OPENTAU_TEST_DIR # List all possible files all_files = []