File size: 6,320 Bytes
da5a206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause

# Here we set the parts that would
# be re-used between services to an
# extension field
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
x-default-isaac-lab-volumes: &default-isaac-lab-volumes
  # These volumes follow from this page
  # https://docs.omniverse.nvidia.com/app_isaacsim/app_isaacsim/install_faq.html#save-isaac-sim-configs-on-local-disk
  - type: volume
    source: isaac-cache-kit
    target: ${DOCKER_ISAACSIM_ROOT_PATH}/kit/cache
  - type: volume
    source: isaac-cache-ov
    target: ${DOCKER_USER_HOME}/.cache/ov
  - type: volume
    source: isaac-cache-pip
    target: ${DOCKER_USER_HOME}/.cache/pip
  - type: volume
    source: isaac-cache-gl
    target: ${DOCKER_USER_HOME}/.cache/nvidia/GLCache
  - type: volume
    source: isaac-cache-compute
    target: ${DOCKER_USER_HOME}/.nv/ComputeCache
  - type: volume
    source: isaac-logs
    target: ${DOCKER_USER_HOME}/.nvidia-omniverse/logs
  - type: volume
    source: isaac-carb-logs
    target: ${DOCKER_ISAACSIM_ROOT_PATH}/kit/logs/Kit/Isaac-Sim
  - type: volume
    source: isaac-data
    target: ${DOCKER_USER_HOME}/.local/share/ov/data
  - type: volume
    source: isaac-docs
    target: ${DOCKER_USER_HOME}/Documents
    # This overlay allows changes on the local files to
    # be reflected within the container immediately
  - type: bind
    source: ../IsaacLab/source
    target: ${DOCKER_ISAACLAB_PATH}/source
  - type: bind
    source: ../IsaacLab/scripts
    target: ${DOCKER_ISAACLAB_PATH}/scripts
  - type: bind
    source: ../IsaacLab/docs
    target: ${DOCKER_ISAACLAB_PATH}/docs
  - type: bind
    source: ../IsaacLab/tools
    target: ${DOCKER_ISAACLAB_PATH}/tools
    # The effect of these volumes is twofold:
    # 1. Prevent root-owned files from flooding the _build and logs dir
    #    on the host machine
    # 2. Preserve the artifacts in persistent volumes for later copying
    #    to the host machine
  - type: volume
    source: isaac-lab-docs
    target: ${DOCKER_ISAACLAB_PATH}/docs/_build
  - type: volume
    source: isaac-lab-logs
    target: ${DOCKER_ISAACLAB_PATH}/logs
  - type: volume
    source: isaac-lab-data
    target: ${DOCKER_ISAACLAB_PATH}/data_storage
    # This volume is used to store the history of the bash shell
  - type: bind
    source: .isaac-lab-docker-history
    target: ${DOCKER_USER_HOME}/.bash_history
    # Pair lab specific volumes
  - type: bind
    source: ../scripts
    target: ${DOCKER_PAIR_LAB_SIM_PATH}/scripts
  - type: bind
    source: ../pair_lab
    target: ${DOCKER_PAIR_LAB_SIM_PATH}/pair_lab
  - type: bind
    source: ../SO-ARM100
    target: ${DOCKER_PAIR_LAB_SIM_PATH}/SO-ARM100
  - type: bind
    source: ../pyroki
    target: ${DOCKER_PAIR_LAB_SIM_PATH}/pyroki

x-default-isaac-lab-environment: &default-isaac-lab-environment
  - ISAACSIM_PATH=${DOCKER_ISAACLAB_PATH}/_isaac_sim
  - OMNI_KIT_ALLOW_ROOT=1

x-default-isaac-lab-deploy: &default-isaac-lab-deploy
  resources:
    reservations:
      devices:
        - driver: nvidia
          count: all
          capabilities: [ gpu ]

services:
  # This service is the base Isaac Lab image
  isaac-lab-base:
    profiles: [ "base" ]
    env_file: .env.base
    build:
      context: ../
      dockerfile: docker/Dockerfile.base
      args:
        - ISAACSIM_BASE_IMAGE_ARG=${ISAACSIM_BASE_IMAGE}
        - ISAACSIM_VERSION_ARG=${ISAACSIM_VERSION}
        - ISAACSIM_ROOT_PATH_ARG=${DOCKER_ISAACSIM_ROOT_PATH}
        - ISAACLAB_PATH_ARG=${DOCKER_ISAACLAB_PATH}
        - DOCKER_USER_HOME_ARG=${DOCKER_USER_HOME}
        - DOCKER_PAIR_LAB_SIM_PATH_ARG=${DOCKER_PAIR_LAB_SIM_PATH}
    image: isaac-lab-base${DOCKER_NAME_SUFFIX-}
    container_name: isaac-lab-base${DOCKER_NAME_SUFFIX-}
    environment: *default-isaac-lab-environment
    volumes: *default-isaac-lab-volumes
    network_mode: host
    deploy: *default-isaac-lab-deploy
    # This is the entrypoint for the container
    entrypoint: bash
    stdin_open: true
    tty: true

  # This service adds a ROS2 Humble
  # installation on top of the base image
  isaac-lab-ros2:
    profiles: [ "ros2" ]
    env_file:
      - .env.base
      - .env.ros2
    build:
      context: ../
      dockerfile: docker/Dockerfile.ros2
      args:
        # ROS2_APT_PACKAGE will default to NONE. This is to
        # avoid a warning message when building only the base profile
        # with the .env.base file
        - ROS2_APT_PACKAGE=${ROS2_APT_PACKAGE:-NONE}
        # Make sure that the correct Docker Name Suffix is being passed to the dockerfile, to know which base image to
        # start from.
        - DOCKER_NAME_SUFFIX=${DOCKER_NAME_SUFFIX-}
    image: isaac-lab-ros2${DOCKER_NAME_SUFFIX-}
    container_name: isaac-lab-ros2${DOCKER_NAME_SUFFIX-}
    environment: *default-isaac-lab-environment
    volumes: *default-isaac-lab-volumes
    network_mode: host
    deploy: *default-isaac-lab-deploy
    # This is the entrypoint for the container
    entrypoint: bash
    stdin_open: true
    tty: true
  isaac-lab-pair:
    profiles: [ "pair" ]
    env_file:
      - .env.base
      - .env.ros2
      - .env.pair
    build:
      context: ../
      dockerfile: docker/Dockerfile.pair
      args:
        # Make sure that the correct Docker Name Suffix is being passed to the dockerfile, to know which base image to
        # start from.
        - DOCKER_NAME_SUFFIX=${DOCKER_NAME_SUFFIX-}
        - DOCKER_PAIR_LAB_SIM_PATH_ARG=${DOCKER_PAIR_LAB_SIM_PATH}
    image: isaac-lab-pair${DOCKER_NAME_SUFFIX-}
    container_name: isaac-lab-pair${DOCKER_NAME_SUFFIX-}
    environment: *default-isaac-lab-environment
    volumes: *default-isaac-lab-volumes
    network_mode: host
    deploy: *default-isaac-lab-deploy
    # This is the entrypoint for the container
    entrypoint: bash
    stdin_open: true
    tty: true

    extra_hosts:
      - "iad2fnuc01.ecom.chewy.com:10.2.102.180"

volumes:
  # isaac-sim
  isaac-cache-kit:
  isaac-cache-ov:
  isaac-cache-pip:
  isaac-cache-gl:
  isaac-cache-compute:
  isaac-logs:
  isaac-carb-logs:
  isaac-data:
  isaac-docs:
  # isaac-lab
  isaac-lab-docs:
  isaac-lab-logs:
  isaac-lab-data: