diff --git a/.github/actions/docker-build/action.yml b/.github/actions/docker-build/action.yml index f13e3d8c75c4..7f88241cfb8c 100644 --- a/.github/actions/docker-build/action.yml +++ b/.github/actions/docker-build/action.yml @@ -64,7 +64,6 @@ runs: # Build Docker image docker buildx build --progress=plain --platform linux/amd64 \ - -t isaac-lab-dev \ -t $image_tag \ --build-arg ISAACSIM_BASE_IMAGE_ARG="$isaacsim_base_image" \ --build-arg ISAACSIM_VERSION_ARG="$isaacsim_version" \ @@ -77,7 +76,8 @@ runs: --load $context_path echo "✅ Docker image built successfully: $image_tag" - docker images | grep isaac-lab-dev + echo "Current local Docker images:" + docker images } # Call the function with provided parameters diff --git a/.github/actions/ecr-build-push-pull/README.md b/.github/actions/ecr-build-push-pull/README.md new file mode 100644 index 000000000000..e615109f061d --- /dev/null +++ b/.github/actions/ecr-build-push-pull/README.md @@ -0,0 +1,42 @@ +# ecr-build-push-pull + +Action that ether builds Docker image and pushes it to ECR or pulls it from there. + +ECR is also used as the BuildKit layer cache, so even first builds benefit from cached layers. + +Drop-in replacement for `docker-build/action.yml` with ECR-backed caching. + +## Prerequisites + +The runner must be authenticated to AWS; the action calls +`aws sts get-caller-identity` and `aws ecr get-login-password` using whatever credentials +are available in the environment. + +The IAM role must have at minimum: +- `ecr:GetAuthorizationToken` (on `*`) +- `ecr:BatchCheckLayerAvailability`, `ecr:GetDownloadUrlForLayer`, `ecr:BatchGetImage` (pull) +- `ecr:InitiateLayerUpload`, `ecr:UploadLayerPart`, `ecr:CompleteLayerUpload`, `ecr:PutImage` (push) + +## Inputs + +| Input | Required | Default | Description | +|-------|----------|---------|-------------| +| `image-tag` | yes | — | Local Docker tag (e.g. `isaac-lab-dev:pr-1-abc`) | +| `isaacsim-base-image` | yes | — | IsaacSim base image (`ISAACSIM_BASE_IMAGE_ARG` build-arg) | +| `isaacsim-version` | yes | — | IsaacSim version (`ISAACSIM_VERSION_ARG` build-arg) | +| `dockerfile-path` | no | `docker/Dockerfile.base` | Path to Dockerfile | +| `ecr-repository` | no | `""` | ECR repo name. If omitted, ECR push/pull/cache is skipped. | +| `aws-region` | no | `us-west-2` | ECR region. Should match the runner's EC2 region for best performance. | + +## Usage + +```yaml +- uses: ./.github/actions/ecr-build-push-pull + with: + image-tag: ${{ env.DOCKER_IMAGE_TAG }} + isaacsim-base-image: nvcr.io/nvidia/isaac-sim + isaacsim-version: 6.0.0 + dockerfile-path: docker/Dockerfile.base + ecr-repository: isaaclab-ci + aws-region: us-west-2 +``` diff --git a/.github/actions/ecr-build-push-pull/action.yml b/.github/actions/ecr-build-push-pull/action.yml new file mode 100644 index 000000000000..b3d99d42a3a9 --- /dev/null +++ b/.github/actions/ecr-build-push-pull/action.yml @@ -0,0 +1,151 @@ +# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md). +# All rights reserved. +# +# SPDX-License-Identifier: BSD-3-Clause + +name: 'ECR Build-Push-Pull' +description: > + Builds a Docker image and pushes it to ECR, using ECR as the layer cache. + If the image already exists in ECR (same tag), pulls it instead of building. + Drop-in replacement for docker-build/action.yml with ECR-backed caching. + +inputs: + image-tag: + description: 'Tag for the Docker image (e.g. my-image:latest).' + required: true + isaacsim-base-image: + description: 'IsaacSim base image (passed as ISAACSIM_BASE_IMAGE_ARG build-arg).' + required: true + isaacsim-version: + description: 'IsaacSim version (passed as ISAACSIM_VERSION_ARG build-arg).' + required: true + dockerfile-path: + description: 'Path to Dockerfile, relative to the repository root' + default: 'docker/Dockerfile.base' + required: false + ecr-repository: + description: 'ECR repository name. If omitted, ECR push/pull/cache is skipped and the image is always built.' + required: false + default: '' + cache-tag: + description: > + Tag used for the ECR layer cache image (e.g. "cache-base", "cache-curobo"). + required: false + default: 'cache' + aws-region: + description: > + AWS region (e.g. us-west-2, etc). + For best performance, should match the runner EC2 region. + required: false + default: 'us-west-2' + +runs: + using: composite + steps: + - name: ECR Build, Push, Pull + shell: bash + run: | + IMAGE_TAG="${{ inputs.image-tag }}" + ECR_REPOSITORY="${{ inputs.ecr-repository }}" + AWS_REGION="${{ inputs.aws-region }}" + + if [ -z "${ECR_REPOSITORY}" ]; then + echo "🟠 ecr-repository not set, skipping ECR login/push/pull. Building locally only." + else + # Get AWS account ID from the runner's IAM instance profile + AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) + REGISTRY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com" + + # Derive ECR image tag by slugifying the local image-tag + # (colons/slashes not valid in ECR tags) + ECR_TAG=$(echo "${IMAGE_TAG}" | tr ':/' '--') + ECR_IMAGE="${REGISTRY}/${ECR_REPOSITORY}:${ECR_TAG}" + CACHE_IMAGE="${REGISTRY}/${ECR_REPOSITORY}:${{ inputs.cache-tag }}" + + # The runner's credential store is broken ("not implemented"), so use a temp config dir + # with credsStore disabled. Copy existing ~/.docker/config.json first to preserve other + # registry auths (e.g. nvcr.io), then strip credsStore/credHelpers. + # + DOCKER_CONFIG_DIR=$(mktemp -d) + trap 'rm -rf "${DOCKER_CONFIG_DIR}"' EXIT + if [ -f "${HOME}/.docker/config.json" ]; then + python3 -c "import json; cfg=json.load(open('${HOME}/.docker/config.json')); cfg['credsStore']=''; cfg.pop('credHelpers',None); json.dump(cfg,open('${DOCKER_CONFIG_DIR}/config.json','w'))" + else + echo '{"credsStore":""}' > "${DOCKER_CONFIG_DIR}/config.json" + fi + # + # Export so all subsequent docker calls in this job inherit it + echo "DOCKER_CONFIG=${DOCKER_CONFIG_DIR}" >> "$GITHUB_ENV" + export DOCKER_CONFIG="${DOCKER_CONFIG_DIR}" + + # Login to ECR registry with token provided by aws cli + echo "🟢 Logging into ECR registry..." + aws ecr get-login-password --region "${AWS_REGION}" | \ + docker login --username AWS --password-stdin "${REGISTRY}" + + # Try pulling the exact image from ECR to skip the build + echo "🟢 Checking for existing image ${ECR_IMAGE} in ECR..." + PULL_OUTPUT=$(docker pull "${ECR_IMAGE}" 2>&1) && { + echo "🟢 Image found in ECR, pulled: ${ECR_IMAGE}" + docker tag "${ECR_IMAGE}" "${IMAGE_TAG}" + echo "🟢 Tagged as: ${IMAGE_TAG} — skipping build." + exit 0 + } || { + echo "🟠 Image not pulled (will build instead): ${PULL_OUTPUT}" + } + fi + + # Log into nvcr.io so the Dockerfile can pull nvcr.io base images. + # Credential is written into the temp config dir when ECR is enabled, + # and into the default config when it is not. + if [ -n "${{ env.NGC_API_KEY }}" ]; then + echo "🟢 Logging into nvcr.io..." + docker login -u \$oauthtoken -p ${{ env.NGC_API_KEY }} nvcr.io + else + echo "🟠 NGC_API_KEY not set — skipping nvcr.io login (normal for fork PRs)" + fi + + # Build the image + + BUILD_ARGS=( + --progress=plain + --platform linux/amd64 + -f "${{ inputs.dockerfile-path }}" + --build-arg "ISAACSIM_BASE_IMAGE_ARG=${{ inputs.isaacsim-base-image }}" + --build-arg "ISAACSIM_VERSION_ARG=${{ inputs.isaacsim-version }}" + --build-arg "ISAACSIM_ROOT_PATH_ARG=/isaac-sim" + --build-arg "ISAACLAB_PATH_ARG=/workspace/isaaclab" + --build-arg "DOCKER_USER_HOME_ARG=/root" + -t "${IMAGE_TAG}" + ) + + # Add ECR layer caching + if [ -n "${ECR_REPOSITORY}" ]; then + BUILD_ARGS+=( + --cache-from "type=registry,ref=${CACHE_IMAGE}" + --cache-to "type=registry,ref=${CACHE_IMAGE},mode=max" + -t "${ECR_IMAGE}" + ) + fi + + # Set up buildx builder with docker-container driver (required for registry cache export). + BUILDER_NAME="ci-builder-${{ github.run_id }}-${{ github.job }}" + + # Create builder (or fall back to reusing existing one on workflow re-runs) + docker buildx create --use --driver docker-container --name "${BUILDER_NAME}" \ + || docker buildx use "${BUILDER_NAME}" + + echo "🟢 Building ${IMAGE_TAG}..." + docker buildx build --load "${BUILD_ARGS[@]}" . + + # Clean up builder + docker buildx rm "${BUILDER_NAME}" || true + + echo "🟢 Build completed for ${IMAGE_TAG}, pushing to ECR..." + + if [ -n "${ECR_REPOSITORY}" ]; then + docker push "${ECR_IMAGE}" + echo "🟢 Pushed ${ECR_IMAGE} to ECR" + fi + + echo "🟢 Image ${IMAGE_TAG} is ready!" diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b1f9fd6e20db..6856184b8479 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -36,12 +36,68 @@ env: ISAACSIM_BASE_IMAGE: nvcr.io/nvidian/isaac-sim #${{ vars.ISAACSIM_BASE_IMAGE || 'nvcr.io/nvidia/isaac-sim' }} ISAACSIM_BASE_VERSION: 'latest-develop' #${{ vars.ISAACSIM_BASE_VERSION || '5.1.0' }} DOCKER_IMAGE_TAG: isaac-lab-dev:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }}-${{ github.sha }} + ECR_REPOSITORY: isaaclab-ci + ECR_REGION: us-west-2 jobs: + build: + name: Build base Docker image + runs-on: [self-hosted, gpu] + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + lfs: true + + - name: Build and push to ECR + uses: ./.github/actions/ecr-build-push-pull + with: + image-tag: ${{ env.DOCKER_IMAGE_TAG }} + isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} + isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} + dockerfile-path: docker/Dockerfile.base + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-base + + # ECR images must be pruned with a lifecycle policy. + - name: Clean up stale Docker images + if: always() + run: docker image prune -f --filter "until=24h" || true + + build-curobo: + name: Build cuRobo Docker image + runs-on: [self-hosted, gpu] + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 1 + lfs: true + + - name: Build and push to ECR + uses: ./.github/actions/ecr-build-push-pull + with: + image-tag: ${{ env.DOCKER_IMAGE_TAG }}-curobo + isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} + isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} + dockerfile-path: docker/Dockerfile.curobo + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-curobo + + # ECR images must be pruned with a lifecycle policy. + - name: Clean up stale Docker images + if: always() + run: docker image prune -f --filter "until=24h" || true + + test-isaaclab-tasks: runs-on: [self-hosted, gpu] timeout-minutes: 180 continue-on-error: true + needs: build steps: - name: Checkout Code @@ -50,12 +106,16 @@ jobs: fetch-depth: 1 lfs: true - - name: Build Docker Image - uses: ./.github/actions/docker-build + - name: Pull image from ECR + uses: ./.github/actions/ecr-build-push-pull with: image-tag: ${{ env.DOCKER_IMAGE_TAG }} isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} + dockerfile-path: docker/Dockerfile.base + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-base - name: Run IsaacLab Tasks Tests uses: ./.github/actions/run-tests @@ -68,18 +128,6 @@ jobs: filter-pattern: "isaaclab_tasks" include-files: "test_multi_agent_environments.py,test_pickplace_stack_environments.py,test_environments.py,test_factory_environments.py,test_environments_training.py,test_cartpole_showcase_environments.py,test_teleop_environments.py" - - name: Copy Test Results from IsaacLab Tasks Container - if: always() - run: | - mkdir -pv reports/ - CONTAINER_NAME="isaac-lab-tasks-test-${{ github.run_id }}-${{ github.run_attempt }}" - if docker ps -a | grep -q $CONTAINER_NAME; then - echo "Copying test results from IsaacLab Tasks container..." - docker cp $CONTAINER_NAME:/workspace/isaaclab/tests/${{ github.job }}-report.xml reports/ 2>/dev/null || echo "No test results to copy from IsaacLab Tasks container" - else - echo "[ERROR] No container $CONTAINER_NAME found! Skipping copying of test results." - fi - - name: Upload IsaacLab Tasks Test Results uses: actions/upload-artifact@v4 if: always() @@ -103,6 +151,7 @@ jobs: exit 1 fi + # ECR images must be pruned with a lifecycle policy. - name: Clean up stale Docker images if: always() run: docker image prune -f --filter "until=24h" || true @@ -111,6 +160,7 @@ jobs: runs-on: [self-hosted, gpu] timeout-minutes: 180 continue-on-error: true + needs: build steps: - name: Checkout Code @@ -119,12 +169,16 @@ jobs: fetch-depth: 1 lfs: true - - name: Build Docker Image - uses: ./.github/actions/docker-build + - name: Pull image from ECR + uses: ./.github/actions/ecr-build-push-pull with: image-tag: ${{ env.DOCKER_IMAGE_TAG }} isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} + dockerfile-path: docker/Dockerfile.base + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-base - name: Run IsaacLab Tasks Tests 2 uses: ./.github/actions/run-tests @@ -137,18 +191,6 @@ jobs: filter-pattern: "isaaclab_tasks" include-files: "test_teleop_environments_with_stage_in_memory.py,test_lift_teddy_bear.py,test_environment_determinism.py,test_hydra.py,test_env_cfg_no_forbidden_imports.py,test_rl_device_separation.py,test_cartpole_showcase_environments_with_stage_in_memory.py,test_environments_with_stage_in_memory.py" - - name: Copy Test Results from IsaacLab Tasks 2 Container - if: always() - run: | - mkdir -pv reports/ - CONTAINER_NAME="isaac-lab-tasks-2-test-${{ github.run_id }}-${{ github.run_attempt }}" - if docker ps -a | grep -q $CONTAINER_NAME; then - echo "Copying test results from IsaacLab Tasks 2 container..." - docker cp $CONTAINER_NAME:/workspace/isaaclab/tests/${{ github.job }}-report.xml reports/ 2>/dev/null || echo "No test results to copy from IsaacLab Tasks 2 container" - else - echo "[ERROR] No container $CONTAINER_NAME found! Skipping copying of test results." - fi - - name: Upload IsaacLab Tasks 2 Test Results uses: actions/upload-artifact@v4 if: always() @@ -172,6 +214,7 @@ jobs: exit 1 fi + # ECR images must be pruned with a lifecycle policy. - name: Clean up stale Docker images if: always() run: docker image prune -f --filter "until=24h" || true @@ -179,6 +222,7 @@ jobs: test-general: runs-on: [self-hosted, gpu] timeout-minutes: 180 + needs: build steps: - name: Checkout Code @@ -187,12 +231,16 @@ jobs: fetch-depth: 1 lfs: true - - name: Build Docker Image - uses: ./.github/actions/docker-build + - name: Pull image from ECR + uses: ./.github/actions/ecr-build-push-pull with: image-tag: ${{ env.DOCKER_IMAGE_TAG }} isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} + dockerfile-path: docker/Dockerfile.base + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-base - name: Run General Tests id: run-general-tests @@ -205,18 +253,6 @@ jobs: pytest-options: "" filter-pattern: "not isaaclab_tasks" - - name: Copy Test Results from General Tests Container - if: always() - run: | - mkdir -pv reports/ - CONTAINER_NAME="isaac-lab-general-test-${{ github.run_id }}-${{ github.run_attempt }}" - if docker ps -a | grep -q $CONTAINER_NAME; then - echo "Copying test results from General Tests container..." - docker cp $CONTAINER_NAME:/workspace/isaaclab/tests/${{ github.job }}-report.xml reports/ 2>/dev/null || echo "No test results to copy from General Tests container" - else - echo "[ERROR] No container $CONTAINER_NAME found! Skipping copying of test results." - fi - - name: Upload General Test Results uses: actions/upload-artifact@v4 if: always() @@ -240,6 +276,7 @@ jobs: exit 1 fi + # ECR images must be pruned with a lifecycle policy. - name: Clean up stale Docker images if: always() run: docker image prune -f --filter "until=24h" || true @@ -248,6 +285,7 @@ jobs: runs-on: [self-hosted, gpu] timeout-minutes: 120 continue-on-error: true + needs: build-curobo steps: - name: Checkout Code @@ -256,13 +294,16 @@ jobs: fetch-depth: 1 lfs: true - - name: Build Docker Image (cuRobo) - uses: ./.github/actions/docker-build + - name: Pull cuRobo image from ECR + uses: ./.github/actions/ecr-build-push-pull with: image-tag: ${{ env.DOCKER_IMAGE_TAG }}-curobo isaacsim-base-image: ${{ env.ISAACSIM_BASE_IMAGE }} isaacsim-version: ${{ env.ISAACSIM_BASE_VERSION }} - dockerfile-path: 'docker/Dockerfile.curobo' + dockerfile-path: docker/Dockerfile.curobo + ecr-repository: ${{ env.ECR_REPOSITORY }} + aws-region: ${{ env.ECR_REGION }} + cache-tag: cache-curobo - name: Run cuRobo and SkillGen Tests uses: ./.github/actions/run-tests @@ -275,18 +316,6 @@ jobs: filter-pattern: "" curobo-only: "true" - - name: Copy Test Results from cuRobo Container - if: always() - run: | - mkdir -pv reports/ - CONTAINER_NAME="isaac-lab-curobo-test-${{ github.run_id }}-${{ github.run_attempt }}" - if docker ps -a | grep -q $CONTAINER_NAME; then - echo "Copying test results from cuRobo container..." - docker cp $CONTAINER_NAME:/workspace/isaaclab/tests/${{ github.job }}-report.xml reports/ 2>/dev/null || echo "No test results to copy from cuRobo container" - else - echo "[ERROR] No container $CONTAINER_NAME found! Skipping copying of test results." - fi - - name: Upload cuRobo Test Results uses: actions/upload-artifact@v4 if: always() @@ -310,12 +339,13 @@ jobs: exit 1 fi + # ECR images must be pruned with a lifecycle policy. - name: Clean up stale Docker images if: always() run: docker image prune -f --filter "until=24h" || true combine-results: - needs: [test-isaaclab-tasks, test-isaaclab-tasks-2, test-general, test-curobo] + needs: [build, build-curobo, test-isaaclab-tasks, test-isaaclab-tasks-2, test-general, test-curobo] runs-on: ubuntu-latest if: always() diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index 85c57547312e..f13d7918c9a6 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -40,10 +40,10 @@ USER root RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ - cmake \ - git \ libglib2.0-0 \ ncurses-term \ + cmake \ + git \ wget # Install packages needed to build imgui-bundle on arm64 as no prebuilt pip wheel is provided @@ -54,8 +54,11 @@ RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev; \ fi -# Copy the Isaac Lab directory (files to exclude are defined in .dockerignore) -COPY ../ ${ISAACLAB_PATH} +# copy files necessary for installing Isaac Lab and its dependencies +# this way we minimize the chance of cache invalidation on file edits +COPY ../isaaclab.* ../environment.yml ../pyproject.toml ${ISAACLAB_PATH}/ +COPY ../tools/ ${ISAACLAB_PATH}/tools/ +COPY ../source/ ${ISAACLAB_PATH}/source/ # Fix the line endings for the shell scripts (Windows git may add \r) RUN find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} + @@ -69,11 +72,9 @@ RUN ln -sf ${ISAACSIM_ROOT_PATH} ${ISAACLAB_PATH}/_isaac_sim # Install toml dependency RUN ${ISAACLAB_PATH}/isaaclab.sh -p -m pip install toml -# Install apt dependencies for extensions that declare them in their extension.toml -RUN ${ISAACLAB_PATH}/isaaclab.sh -p ${ISAACLAB_PATH}/tools/install_deps.py apt ${ISAACLAB_PATH}/source - -# Apt Cleanup -RUN apt-get -y autoremove && apt-get clean && \ +# Install apt dependencies for extensions that declare them in their extension.toml, +RUN ${ISAACLAB_PATH}/isaaclab.sh -p ${ISAACLAB_PATH}/tools/install_deps.py apt ${ISAACLAB_PATH}/source && \ + apt-get -y autoremove && apt-get clean && \ rm -rf /var/lib/apt/lists/* # for singularity usage, have to create the directories that will binded @@ -116,6 +117,9 @@ RUN echo "export ISAACLAB_PATH=${ISAACLAB_PATH}" >> ${HOME}/.bashrc && \ echo "shopt -s histappend" >> /root/.bashrc && \ echo "PROMPT_COMMAND='history -a'" >> /root/.bashrc +# copy the rest of the files +COPY ../ ${ISAACLAB_PATH}/ + # make working directory as the Isaac Lab directory # this is the default directory when the container is run WORKDIR ${ISAACLAB_PATH} diff --git a/docker/Dockerfile.curobo b/docker/Dockerfile.curobo index 8882ff024081..36072612f576 100644 --- a/docker/Dockerfile.curobo +++ b/docker/Dockerfile.curobo @@ -36,17 +36,23 @@ ENV DEBIAN_FRONTEND=noninteractive USER root -# Install dependencies and remove cache -RUN --mount=type=cache,target=/var/cache/apt \ - apt-get update && apt-get install -y --no-install-recommends \ +# Install dependencies +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ build-essential \ - cmake \ - git \ libglib2.0-0 \ ncurses-term \ - wget && \ - apt -y autoremove && apt clean autoclean && \ - rm -rf /var/lib/apt/lists/* + cmake \ + git \ + wget + +# Install packages needed to build imgui-bundle on arm64 as no prebuilt pip wheel is provided +RUN if [ "$(dpkg --print-architecture)" = "arm64" ]; then \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + libgl1-mesa-dev libopengl-dev libglx-dev \ + libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev; \ + fi # Detect Ubuntu version and install CUDA 12.8 via NVIDIA network repo (cuda-keyring) RUN set -euo pipefail && \ @@ -83,8 +89,11 @@ ENV PATH=${CUDA_HOME}/bin:${PATH} ENV LD_LIBRARY_PATH=${CUDA_HOME}/lib64:${LD_LIBRARY_PATH} ENV TORCH_CUDA_ARCH_LIST=8.0+PTX -# Copy the Isaac Lab directory (files to exclude are defined in .dockerignore) -COPY ../ ${ISAACLAB_PATH} +# copy files necessary for installing Isaac Lab and its dependencies +# this way we minimize the chance of cache invalidation on file edits +COPY ../isaaclab.* ../environment.yml ../pyproject.toml ${ISAACLAB_PATH}/ +COPY ../tools/ ${ISAACLAB_PATH}/tools/ +COPY ../source/ ${ISAACLAB_PATH}/source/ # Fix the line endings for the shell scripts (Windows git may add \r) RUN find ${ISAACLAB_PATH} -type f -name "*.sh" -exec sed -i 's/\r$//' {} + @@ -98,10 +107,9 @@ RUN ln -sf ${ISAACSIM_ROOT_PATH} ${ISAACLAB_PATH}/_isaac_sim # Install toml dependency RUN ${ISAACLAB_PATH}/isaaclab.sh -p -m pip install toml -# Install apt dependencies for extensions that declare them in their extension.toml -RUN --mount=type=cache,target=/var/cache/apt \ - ${ISAACLAB_PATH}/isaaclab.sh -p ${ISAACLAB_PATH}/tools/install_deps.py apt ${ISAACLAB_PATH}/source && \ - apt -y autoremove && apt clean autoclean && \ +# Install apt dependencies for extensions that declare them in their extension.toml, +RUN ${ISAACLAB_PATH}/isaaclab.sh -p ${ISAACLAB_PATH}/tools/install_deps.py apt ${ISAACLAB_PATH}/source && \ + apt-get -y autoremove && apt-get clean && \ rm -rf /var/lib/apt/lists/* # for singularity usage, have to create the directories that will binded @@ -164,6 +172,9 @@ RUN echo "export ISAACLAB_PATH=${ISAACLAB_PATH}" >> ${HOME}/.bashrc && \ echo "shopt -s histappend" >> /root/.bashrc && \ echo "PROMPT_COMMAND='history -a'" >> /root/.bashrc +# copy the rest of the files +COPY ../ ${ISAACLAB_PATH}/ + # make working directory as the Isaac Lab directory # this is the default directory when the container is run WORKDIR ${ISAACLAB_PATH}