Skip to content

Commit 398f1ca

Browse files
committed
Conda-forge
1 parent 9a9ef8b commit 398f1ca

File tree

2 files changed

+16
-91
lines changed

2 files changed

+16
-91
lines changed

unitree-client/Dockerfile

Lines changed: 14 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,15 @@ FROM nvcr.io/nvidia/l4t-cuda:11.4.19-runtime AS base
22

33
ARG UV_VERSION=0.6.2
44

5-
ENV DEBIAN_FRONTEND=noninteractive \
6-
PATH="/opt/openrobots/bin:/usr/local/bin:/app/.venv/bin:${PATH}" \
7-
PKG_CONFIG_PATH="/opt/openrobots/lib/pkgconfig:/usr/local/lib/pkgconfig" \
8-
LD_LIBRARY_PATH="/opt/openrobots/lib:/usr/local/lib" \
9-
PYTHONPATH="/opt/openrobots/lib/python3.10/site-packages:/usr/local/lib:/usr/lib/python3.10:/usr/local/include:/usr/local/lib/python3.10/site-packages" \
10-
CMAKE_PREFIX_PATH="/usr/share:/usr/local:/opt/openrobots" \
11-
UV_COMPILE_BYTECODE=1 \
12-
UV_LINK_MODE=copy \
13-
BOOST_ROOT=/usr/local \
14-
BOOST_INCLUDEDIR=/usr/local/include \
15-
BOOST_LIBRARYDIR=/usr/local/lib \
16-
CYCLONEDDS_HOME=/usr/local
5+
ENV DEBIAN_FRONTEND=noninteractive
176

187
RUN apt-get update \
198
&& apt-get install -y \
9+
bzip2 \
2010
curl \
21-
git \
22-
build-essential \
23-
cmake \
11+
ca-certificates \
2412
libgl1 \
2513
libglib2.0-0 \
26-
lsb-release \
27-
libconsole-bridge0.4 \
28-
software-properties-common \
29-
liburdfdom-dev \
30-
liburdfdom-headers-dev \
31-
liburdfdom-model \
32-
liburdfdom-world \
33-
libconsole-bridge-dev \
34-
libeigen3-dev \
35-
libspdlog-dev \
3614
&& apt-get clean \
3715
&& rm -rf /var/lib/apt/lists/*
3816

@@ -52,15 +30,6 @@ RUN curl -fsSL https://neuro.debian.net/_static/neuro.debian.net.asc \
5230

5331
FROM base AS builder
5432

55-
# Numpy needed for eigenpy
56-
RUN python3.10 -m venv /app/.venv && \
57-
/app/.venv/bin/pip install --no-cache-dir --upgrade pip && \
58-
/app/.venv/bin/pip install --no-cache-dir \
59-
numpy \
60-
scipy \
61-
casadi==3.6.7
62-
# Casadi 3.7.0 introduces breaking changes to CMAKE.
63-
6433
# Build CycloneDDS: the unitree-sdk2py depends on CycloneDDS 0.10.2
6534
RUN git clone --branch=0.10.2 https://github.com/eclipse-cyclonedds/cyclonedds /tmp/cyclonedds \
6635
&& cd /tmp/cyclonedds \
@@ -86,62 +55,19 @@ RUN git clone --branch=0.10.2 https://github.com/eclipse-cyclonedds/cyclonedds-p
8655
&& cd / \
8756
&& rm -rf /tmp/cyclonedds-python
8857

89-
# Libboost for Python 3.10 -- needed by eigenpy
90-
RUN mkdir -p /tmp/boost && \
91-
cd /tmp/boost && \
92-
curl -LO https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \
93-
tar -xf boost_1_87_0.tar.gz && \
94-
cd boost_1_87_0 && \
95-
./bootstrap.sh --with-libraries=all \
96-
--with-python=/app/.venv/bin/python \
97-
--with-python-version=3.10 \
98-
--with-python-root=/app/.venv && \
99-
./b2 install \
100-
--prefix=/usr/local \
101-
include=/usr/include/python3.10 \
102-
cxxflags="-I/usr/include/python3.10 -fPIC" \
103-
linkflags="-L/usr/lib/aarch64-linux-gnu -lpython3.10" \
104-
&& cd / && rm -rf /tmp/boost
105-
106-
# Eigenpy
107-
RUN git clone https://github.com/stack-of-tasks/eigenpy /tmp/eigenpy \
108-
&& cd /tmp/eigenpy \
109-
&& mkdir build \
110-
&& cd build \
111-
&& cmake .. \
112-
-DCMAKE_BUILD_TYPE=Release \
113-
-DCMAKE_INSTALL_PREFIX=/usr/local \
114-
-DPYTHON_EXECUTABLE=/app/.venv/bin/python \
115-
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.10.so \
116-
-DPYTHON_NUMPY_INCLUDE_DIRS=/app/.venv/lib/python3.10/site-packages/numpy/core/include \
117-
&& make -j$(nproc) \
118-
&& make install \
119-
&& cd / \
120-
&& rm -rf /tmp/eigenpy
58+
RUN curl -fsSL https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-aarch64.sh -o /tmp/miniforge.sh \
59+
&& chmod +x /tmp/miniforge.sh \
60+
&& /tmp/miniforge.sh -b -p /opt/conda \
61+
&& rm /tmp/miniforge.sh
12162

122-
ENV LD_LIBRARY_PATH="/app/.venv/lib64/python3.10/site-packages/casadi:$LD_LIBRARY_PATH"
63+
RUN source /opt/conda/etc/profile.d/conda.sh \
64+
&& conda config --set auto_activate_base false \
65+
&& conda create -n unitree-client python=3.10 \
66+
&& conda clean -afy
12367

124-
# Pinocchio
125-
RUN git clone --branch=v3.5.0 https://github.com/stack-of-tasks/pinocchio /tmp/pinocchio \
126-
&& cd /tmp/pinocchio \
127-
&& mkdir build \
128-
&& cd build \
129-
&& cmake .. \
130-
-DCMAKE_BUILD_TYPE=Release \
131-
-DCMAKE_INSTALL_PREFIX=/usr/local \
132-
-DPYTHON_EXECUTABLE=/app/.venv/bin/python \
133-
-DPYTHON_LIBRARY=/usr/lib/aarch64-linux-gnu/libpython3.10.so \
134-
-DPYTHON_NUMPY_INCLUDE_DIRS=/app/.venv/lib/python3.10/site-packages/numpy/core/include \
135-
-DBUILD_TESTING=OFF \
136-
-DBUILD_WITH_CASADI_SUPPORT=ON \
137-
-DBUILD_WITH_URDF_SUPPORT=ON \
138-
-Dcasadi_DIR=/app/.venv/lib64/python3.10/site-packages/casadi/cmake \
139-
-DENABLE_TEMPLATE_INSTANTIATION=ON \
140-
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
141-
&& VERBOSE=1 make -j$(nproc) \
142-
&& VERBOSE=1 make install \
143-
&& cd / \
144-
&& rm -rf /tmp/pinocchio
68+
RUN conda install pinocchio -c conda-forge \
69+
&& conda install casadi -c conda-forge \
70+
&& conda clean -afy
14571

14672
FROM base AS runtime
14773

@@ -151,7 +77,6 @@ LABEL org.opencontainers.image.source="https://github.com/tastyducks/spectacles-
15177
ENV LD_LIBRARY_PATH="/app/.venv/lib64/python3.10/site-packages/casadi:$LD_LIBRARY_PATH"
15278

15379
COPY --from=builder /usr/local/ /usr/local
154-
COPY --from=builder /app /app
15580

15681
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
15782

unitree-client/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[project]
22
dependencies = [
33
"asyncio >=3.4.3",
4-
"casadi==3.6.7", # Built in the container.
5-
"cyclonedds @ git+https://github.com/eclipse-cyclonedds/cyclonedds-python.git@0.10.2", # Built in the container but need Python bindings.
4+
# "casadi==3.6.7", # Built in the container.
5+
# "cyclonedds @ git+https://github.com/eclipse-cyclonedds/cyclonedds-python.git@0.10.2", # Built in the container but need Python bindings.
66
"ipython>=8.34.0",
77
"meshcat @ git+https://github.com/TastyDucks/meshcat-python.git",
88
"mujoco>=3.3.0",

0 commit comments

Comments
 (0)