File size: 3,965 Bytes
38fb1f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a28787a
38fb1f6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM althack/ros2:humble-full AS base

# Switch to root for system operations
USER root

# Set timezone / locale if needed
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary build tools
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
        build-essential \
        curl \
        net-tools \
        iputils-ping \
        ros-${ROS_DISTRO}-rosbag2-storage-mcap \
        ros-${ROS_DISTRO}-rosbridge-server \
        git \
        ca-certificates \
        tmux \
        vim \
        && \
    rm -rf /var/lib/apt/lists/*

# TensorRT related setup
COPY docker-assets/data/TensorRT-10.13.0.35 /usr/TensorRT-10.13.0.35

# Ensure ros user owns home directory
RUN chown -R ros:ros /home/ros

# Switch to ros user
USER ros
WORKDIR /home/ros/g0plus_ros2


# ============================================
# Put in code folders
# ============================================
RUN --mount=type=secret,id=git_token,uid=1000,gid=1000 \
    GIT_TOKEN=$(cat /run/secrets/git_token) && \
    git clone https://${GIT_TOKEN}@github.com/OpenGalaxea/GalaxeaVLA.git -b main
RUN --mount=type=secret,id=git_token,uid=1000,gid=1000 \
    GIT_TOKEN=$(cat /run/secrets/git_token) && \
    git clone https://${GIT_TOKEN}@github.com/OpenGalaxea/EFMNode.git -b dev/pp_trt
COPY --chown=ros:ros docker-assets/code/Hierarchical_System /home/ros/g0plus_ros2/Hierarchical_System


# ============================================
# UV installation
# ============================================
WORKDIR /home/ros
ARG http_proxy
ARG https_proxy

RUN bash -c "\
    curl -LsSf https://astral.sh/uv/install.sh | bash && \
    ~/.local/bin/uv --version \
"
ENV PATH="/home/ros/.local/bin:${PATH}"

# ============================================
# Complete G0plus setup
# ============================================
WORKDIR /home/ros/g0plus_ros2/GalaxeaVLA

ENV UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/
ENV UV_PYTHON_INSTALL_MIRROR=https://gh-proxy.com/https://github.com/astral-sh/python-build-standalone/releases/download
ENV UV_HTTP_TIMEOUT=600


RUN uv sync --index-strategy unsafe-best-match

RUN VIRTUAL_ENV=.venv uv pip install -e .

RUN VIRTUAL_ENV=.venv uv pip install -e .[dev]


# ============================================
# Complete EFMNode, VLM and rosbridge setup
# ============================================
WORKDIR /home/ros/g0plus_ros2/GalaxeaVLA

RUN VIRTUAL_ENV=.venv uv pip install nvtx google-genai dashscope

RUN VIRTUAL_ENV=.venv uv pip install lark==1.3.1 empy==3.3.4 colcon-common-extensions==0.3.0 

RUN VIRTUAL_ENV=.venv uv pip install setuptools==59.6.0

RUN VIRTUAL_ENV=.venv uv pip install tensorflow==2.15.0

RUN VIRTUAL_ENV=.venv uv pip install netifaces pymongo tornado cbor2

# ============================================
# Install TensorRT wheel
# ============================================
RUN VIRTUAL_ENV=.venv uv pip install /usr/TensorRT-10.13.0.35/python/tensorrt-10.13.0.35-cp310-none-linux_x86_64.whl

# ============================================
# Build the ROS2 workspace using conda env
# ============================================
WORKDIR /home/ros/g0plus_ros2/Hierarchical_System

RUN bash -c "\
    source /opt/ros/humble/setup.bash && \
    source /home/ros/g0plus_ros2/GalaxeaVLA/.venv/bin/activate && \
    colcon build --symlink-install \
      --cmake-args -DPython3_ROOT_DIR=${VIRTUAL_ENV} \
"


# ============================================
# Replace super xml and update ~/.bashrc
# ============================================
COPY --chown=ros:ros docker-assets/super_client_configuration_file.xml.tpl /home/ros/super_client_configuration_file.xml.tpl

RUN echo "source /home/ros/g0plus_ros2/GalaxeaVLA/.venv/bin/activate" >> /home/ros/.bashrc && \
    echo "source /home/ros/g0plus_ros2/Hierarchical_System/install/setup.bash" >> /home/ros/.bashrc

# ============================================
# Final image settings
# ============================================
WORKDIR /home/ros