-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expand file tree
/
Copy pathDockerfile.kitless
More file actions
147 lines (127 loc) · 5.52 KB
/
Copy pathDockerfile.kitless
File metadata and controls
147 lines (127 loc) · 5.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# 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
# Kit-less image for GPU-accelerated training without Isaac Sim or Kit:
# Newton physics, OVRTX rendering, and every core RL framework.
ARG BASE_IMAGE_ARG=ubuntu:24.04
FROM ghcr.io/astral-sh/uv:0.9.25@sha256:13e233d08517abdafac4ead26c16d881cd77504a2c40c38c905cf3a0d70131a6 AS uv
FROM ${BASE_IMAGE_ARG} AS builder
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ISAACLAB_PATH_ARG=/workspace/isaaclab
ENV ISAACLAB_PATH=${ISAACLAB_PATH_ARG}
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV VIRTUAL_ENV=${ISAACLAB_PATH_ARG}/.venv
ENV PATH=${ISAACLAB_PATH_ARG}/.venv/bin:/usr/local/bin:${PATH}
ENV UV_NO_CACHE=1
ENV PIP_RETRIES=12
ENV UV_HTTP_RETRIES=12
# Native build tools remain confined to this stage.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
cmake \
git \
libglib2.0-0 \
python3 \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy uv from its official versioned image instead of executing a mutable
# installer URL during the build.
COPY --from=uv /uv /uvx /usr/local/bin/
WORKDIR ${ISAACLAB_PATH}
# Copy the install inputs before the rest of the runtime tree so dependency
# installation remains cached when only scripts or application code changes.
COPY pyproject.toml uv.lock VERSION LICENSE LICENSE-mimic README.md ./
COPY source/ source/
COPY isaaclab.sh ./
COPY tools/wheel_builder/uv-overrides.txt tools/wheel_builder/uv-overrides.txt
# Same entry point as Dockerfile.base. The selectors are explicit because a bare
# --install excludes `ov` and `visualizer`; both take `[all]` here. The standalone
# importers are explicit wheel extras, so install them with the resolver overrides
# that preserve Isaac Lab's dependency versions. The venv pins python3.12 to match
# the runtime stage's libpython3.12, and isaaclab.sh resolves VIRTUAL_ENV first.
RUN uv venv --python /usr/bin/python3.12 --seed --no-managed-python "${VIRTUAL_ENV}" \
&& chmod +x "${ISAACLAB_PATH}/isaaclab.sh" \
&& "${ISAACLAB_PATH}/isaaclab.sh" --install newton,rl[all],ov[all],visualizer[all] \
&& uv pip install \
--overrides "${ISAACLAB_PATH}/tools/wheel_builder/uv-overrides.txt" \
"isaacsim-asset-isolated>=6.0,<6.1" \
"tinyobjloader==2.0.0rc13" \
&& python -c "import importlib.metadata as m; \
names = {d.metadata['Name'].lower() for d in m.distributions()}; \
assert 'isaacsim' not in names; \
assert 'isaacsim-asset-isolated' in names; \
assert 'ovphysx' in names; \
assert 'ovrtx' in names; \
assert 'viser' in names; \
assert 'rerun-sdk' in names" \
&& test ! -e "${ISAACLAB_PATH}/_isaac_sim"
# isaaclab.utils.assets parses apps/isaaclab.python.kit at import time to
# resolve the Nucleus asset root, so apps/ is required even without Kit.
COPY apps/ apps/
COPY scripts/ scripts/
COPY docs/licenses/ docs/licenses/
COPY docker/docker-compose.yaml docker/docker-compose.yaml
COPY docker/utils/volume_mounts.py docker/utils/volume_mounts.py
FROM ${BASE_IMAGE_ARG} AS runtime
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ARG ISAACLAB_PATH_ARG=/workspace/isaaclab
ENV ISAACLAB_PATH=${ISAACLAB_PATH_ARG}
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
# Build arg like Dockerfile.base, so the image home and the Compose mounts
# derived from DOCKER_USER_HOME cannot drift apart.
ARG DOCKER_USER_HOME_ARG=/home/isaaclab
ENV DOCKER_USER_HOME=${DOCKER_USER_HOME_ARG}
ENV HOME=${DOCKER_USER_HOME}
ENV VIRTUAL_ENV=${ISAACLAB_PATH_ARG}/.venv
ENV PATH=${ISAACLAB_PATH_ARG}/.venv/bin:/usr/local/bin:${PATH}
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility,graphics
# Libraries ovrtx loads at init. GLVND splits these: libgl1 gives libGL.so.1,
# but libOpenGL.so.0 and libEGL.so.1 need libopengl0 and libegl1. libxrender1 is
# for the Newton GL viewer: pyglet's xlib backend resolves libXrender.so.1 via
# ctypes at import time and nothing else in this list pulls it in transitively.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
git \
libegl1 \
libgl1 \
libglib2.0-0 \
libgomp1 \
libopengl0 \
libpython3.12 \
libvulkan1 \
libx11-6 \
libxext6 \
libxrender1 \
python3 \
&& rm -rf /var/lib/apt/lists/* \
&& if getent passwd ubuntu >/dev/null; then userdel -r ubuntu; fi \
&& if getent group ubuntu >/dev/null; then groupdel ubuntu; fi \
&& groupadd --gid 1000 isaaclab \
&& useradd --uid 1000 --gid 1000 --home-dir "${HOME}" --create-home --shell /bin/bash isaaclab \
&& mkdir -p "${HOME}" \
&& chown -R isaaclab:isaaclab "${HOME}" \
&& chmod 750 "${HOME}"
COPY --from=builder /usr/local/bin/uv /usr/local/bin/uv
COPY --from=builder /usr/local/bin/uvx /usr/local/bin/uvx
COPY --from=builder --chown=isaaclab:isaaclab ${ISAACLAB_PATH} ${ISAACLAB_PATH}
# A fresh named volume inherits ownership from the image directory at its mount
# path, so pre-create and chown them; derived from Compose to avoid duplication.
RUN set -o pipefail \
&& export DOCKER_ISAACLAB_PATH="${ISAACLAB_PATH}" \
DOCKER_USER_HOME="${HOME}" \
&& dirs="$(python ${ISAACLAB_PATH}/docker/utils/volume_mounts.py \
--volumes_key x-kitless-isaac-lab-volumes | grep '^/')" \
&& mkdir -p ${dirs} \
&& chown -R isaaclab:isaaclab ${dirs}
USER isaaclab
WORKDIR ${ISAACLAB_PATH}
CMD ["bash"]