This document provides step-by-step instructions for installing and setting up the environment for ApolloSimFuzz.
Before installation, please ensure the following dependencies are available on your system:
- uv -- Python package manager
- Docker
- NVIDIA Container Toolkit
GPU support is required for running Baidu Apollo modules.
Install uv if you haven't:
curl -LsSf https://astral.sh/uv/install.sh | shgit clone --recurse-submodules git@github.com:MingfeiCheng/ApolloSimFuzz.git
cd ApolloSimFuzzbash install.shThe script automatically performs the following:
- Clones Baidu Apollo (v7.0.0)
- Applies required patches to Apollo
- Sets up a Python 3.8 virtual environment via
uv - Installs all project dependencies
- Builds the TrafficSandbox Docker image
Expected output:
[ApolloSimFuzz] Current Apollo version: 7.0
[ApolloSimFuzz] Cloning Apollo (v7.0.0)...
...
[ApolloSimFuzz] Applying Apollo patches...
[ApolloSimFuzz] Copied dev_start_ctn.sh -> apollo/docker/scripts/
[ApolloSimFuzz] Replaced apollo/WORKSPACE
[ApolloSimFuzz] Patches applied.
[ApolloSimFuzz] Ensuring Python 3.8 is available...
[ApolloSimFuzz] Syncing project dependencies (uv sync)...
...
[ApolloSimFuzz] Building TrafficSandbox Docker image...
...
[ApolloSimFuzz] Installation completed.
After installation, the following artifacts should be available:
apollo/-- Baidu Apollo source code (with patches applied).venv/-- Python virtual environment- Docker image
drivora/sandbox:latest(verify withdocker images)
Apollo must be compiled inside a Docker dev container. You can use the automated script or do it manually.
bash build_apollo.shThis script will:
- Start the Apollo dev container
- Run
./apollo.sh buildinside the container
Expected output:
[ApolloSimFuzz] Starting Apollo dev container...
...
OK Congratulations! You have successfully finished setting up Apollo Dev Environment.
[ApolloSimFuzz] Using container: apollo_dev_<username>
[ApolloSimFuzz] Building Apollo inside container (this may take a long time)...
...
[ApolloSimFuzz] Apollo build completed.
The build process may take a significant amount of time depending on your hardware configuration.
# Step 1: Start the dev container
cd apollo
bash docker/scripts/dev_start.sh
# Step 2: Enter the container
bash docker/scripts/dev_into.sh
# Step 3: Build Apollo (inside the container)
./apollo.sh buildExpected output after dev_start.sh:
OK Congratulations! You have successfully finished setting up Apollo Dev Environment.
OK To login into the newly created apollo_dev_<username> container, please run the following command:
OK bash docker/scripts/dev_into.sh
OK Enjoy!
If you need to apply patches manually (e.g. you already have Apollo cloned separately), copy the following files:
# Copy the dev container start script
cp apollo_bridge/patches/dev_start_ctn.sh apollo/docker/scripts/dev_start_ctn.sh
# Replace the WORKSPACE file (fixes build issues)
cp apollo_bridge/patches/WORKSPACE apollo/WORKSPACEIf the TrafficSandbox Docker image was not successfully built during the initial installation, you can build it manually:
cd TrafficSandbox
bash build.shVerify the image:
docker images | grep drivora/sandboxExpected output:
drivora/sandbox latest <image_id> <time> <size>
Important: Before running the fuzzer, stop the Apollo dev container created by
build_apollo.sh. The fuzzer manages its own Apollo containers and will conflict with existing ones.
# Stop the build container first
docker stop apollo_dev_${USER}
# Then run the fuzzer
bash scripts/random.shOr run directly:
uv run python start_fuzzer.pyOr activate the environment manually:
source .venv/bin/activate
python start_fuzzer.pyCheck and modify config.yaml before running.