Skip to content

HorizonRobotics/robo_orchard_file_server

Repository files navigation

RoboOrchard File Server

The RoboOrchard File Server is a lightweight, high-performance, asynchronous file server designed specifically for the RoboOrchard project. Built with FastAPI, it provides an efficient and reliable solution for remotely accessing and streaming robotics data files, such as MCAP.

This server addresses the common workflow where data is recorded on a robot, while developers and analysts need to access it from a separate workstation. It acts as a crucial component that allows users to easily browse, access, and stream this data via a web browser or client application, greatly simplifying remote data handling.

Key Features

  1. Dynamic Directory Browsing

The server automatically generates clean, user-friendly HTML listings for any given directory. This allows users to navigate the file system directly from a web browser to locate and access data files, offering an experience similar to traditional Apache or Nginx directory indexing.

  1. High-Performance Asynchronous File Transfer

Leveraging the asynchronous I/O capabilities of FastAPI and aiofiles, the server delivers excellent performance and concurrency. It remains responsive even when serving large data files or handling multiple simultaneous requests, ensuring it doesn't block critical processes.

  1. Partial Content Streaming (Range Requests)

The server fully supports HTTP Byte Range Requests, enabling it to serve 206 Partial Content responses. This feature is critical for handling large robotics data files, as it allows clients (like Foxglove Studio or custom web applications) to request only specific segments of a file. This enables efficient streaming and live-previewing without needing to download the entire file first.

  1. Built-in Cross-Origin Resource Sharing (CORS) Support

By default, the server enables a permissive Cross-Origin Resource Sharing (CORS) policy. This allows web applications running on any origin to securely request files from the server. It is a foundational feature for building rich, interactive front-end applications that work with the served data, such as the visualization panels in the RoboOrchard Data Recorder App.

Getting Started

Prerequisites

Before you begin, ensure you have the following installed on your system:

  • Ubuntu 22.04

  • Python 3.10+

  • make build automation tool

Installation

Clone the repository to your machine

git clone https://github.com/HorizonRobotics/robo_orchard_file_server
cd /path/to/repo

This project uses a Makefile to simplify the setup. We recommend using a Python virtual environment.

# prepare development dependency
make dev-env

# Installs the local Python packages in editable mode
make install

Running the Serve

a. Basic usage

You can start the server directly from the command line. It listens on 0.0.0.0, making it accessible to other devices on the local network.

robo-orchard-simple-file-server

b. Specifying the Serving Directory

You can set the ROBO_ORCHARD_SIMPLE_FILE_SERVER_BASE_DIR environment variable to serve files from a specific directory.

ROBO_ORCHARD_SIMPLE_FILE_SERVER_BASE_DIR=/path/to/your/data robo-orchard-simple-file-server

c. Specifying the Port

Use the --port argument to run the server on a fixed port.

robo-orchard-simple-file-server --port 8080

Once started, you can access the files via http://<server_ip>: in your browser or client application.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published