open-rmf / rmf-web

Apache License 2.0
87 stars 41 forks source link

[Other issue]: How to properly expose RMF Dashboard to local network with RMF-Web 0.2.0? #1028

Open cardboardcode opened 15 hours ago

cardboardcode commented 15 hours ago

Before proceeding, is there an existing issue or discussion for this?

Description

Hi Open-RMF team, as usual, thanks for the hard work on maintaining the repository thus far.

This enquiry comes in regards to recent changes introduced in rmf-web release of version 0.2.0.

Enquiry :question:

How does one expose the RMF-Dashboard (Eg. http://localhost:5173) such that it is accessible on different devices in the same local network (Eg. http://<host_device_ip_address>:5173)?

Asking because:

Things I Tried :hammer:

  -e RMF_SERVER_URL=http://<host_device_ip_address>:8000 \
  -e TRAJECTORY_SERVER_URL=ws://<host_device_ip_address>:8006 \

Steps To Reproduce :books:

  1. Download rmf-web 0.2.0 repository:

    cd $HOME
    git clone https://github.com/open-rmf/rmf-web.git --branch 0.2.0 --depth 1 --single-branch
    cd rmf-web
  2. Create the following Dockerfile in the project root:

    
    #-----------------------
    # Stage 1 - Dependencies
    #-----------------------
    FROM ros:jazzy-ros-core
    RUN apt-get update

RUN apt-get install -y \ git \ curl \ build-essential \ python3-pip \ python3-venv \ python3-rosdep \ python3-colcon-common-extensions \ ros-$ROS_DISTRO-rmf-building-map-msgs

ENV PIP_BREAK_SYSTEM_PACKAGES=1

WORKDIR /rmf_ws/src RUN git clone https://github.com/open-rmf/rmf_internal_msgs.git WORKDIR /rmf_ws/src/rmf_internal_msgs RUN git checkout 9ff25f4

colcon compilation

ENV DEBIAN_FRONTEND=noninteractive WORKDIR /rmf_ws/ RUN rosdep init RUN rosdep update --rosdistro $ROS_DISTRO \ && rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -yr RUN . /opt/ros/$ROS_DISTRO/setup.sh \ && colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

cleanup

RUN sed -i '$isource "/rmf_ws/install/setup.bash"' /ros_entrypoint.sh

WORKDIR / COPY ./ ./rmf-web

RUN curl -fsSL https://get.pnpm.io/install.sh | bash - ENV PNPM_HOME /root/.local/share/pnpm ENV PATH "$PNPM_HOME:$PATH" RUN pnpm env use --global 20 RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get update && apt-get install -y \ nodejs \ jq && \ pip3 install pipenv \ && rm -rf /var/lib/apt/lists/*

-----------------

Stage 2 - build

-----------------

WORKDIR /rmf-web/ RUN pnpm config set unsafe-perm RUN pnpm install RUN pnpm store prune WORKDIR /rmf-web/packages/dashboard

----------

Stage 3 - cleanup

----------

ENTRYPOINT ["/ros_entrypoint.sh"] CMD ["pnpm", "start"]


3. Edit `./packages/dashboard/app-config.json` such that it looks similar to what is shown below:

```bash
  "rmfServerUrl": "http://192.168.30.173:8000",
  "trajectoryServerUrl": "ws://192.168.30.173:8006",
  1. Build the docker image using the command below:

    docker build -t rmf_web_custom:jazzy .

    :warning: This will take about 15 minutes, depending on your internet strength.

  2. Run the docker image using the command below:

    docker run -it --rm \
    --name rmf_web_custom_c \
    --network host \
    -v /dev/shm:/dev/shm \
    rmf_web_custom:jazzy

Expected Behaviour :green_circle:

RMF Dashboard is accessible on: http://192.168.30.173:5173

Actual Behaviour :red_circle:

RMF Dashboard is still only accessible on: http://localhost:5173

Similar Issues