whl_deploy is a powerful tool designed specifically for Apollo deployment, aiming to significantly simplify the setup of Apollo environments and the import/export of resources. By automating key steps, whl_deploy ensures an efficient, consistent, and seamless Apollo deployment experience.
whl_deploy provides three core functionalities, covering the essential aspects of the Apollo deployment lifecycle:
- Automated Environment Setup: Installs and configures Docker, NVIDIA Container Toolkit, and optimizes the system, providing an ideal environment for Apollo.
- Apollo Resource Import: Unified import of core Apollo components, including Docker images, source code, AI models, high-definition maps, and compiled caches, drastically reducing initial setup and startup times.
- Resource Packaging & Distribution: Packages pre-configured or downloaded Apollo resources into reusable bundles, facilitating rapid deployment across multiple machines, especially useful in offline environments.
This section guides you on how to quickly install and use whl_deploy, focusing on the most common end-to-end deployment flow.
To ensure compatibility, please upgrade your setuptools and pip first:
# Highly Recommended: Upgrade setuptools and pip first
pip install setuptools -U
pip install --upgrade pip
# Install whl-deploy
pip install whl-deployThe following two commands are the essence of whl_deploy, covering the vast majority of Apollo deployment scenarios:
This command will automatically install Docker, the NVIDIA Container Toolkit, and perform necessary system configurations. This is the foundation for running Apollo.
whl-deploy setup allAfter setting up the environment, you can import all pre-packaged core Apollo resources, such as source code, Docker images, AI models, etc., with a single command. Please ensure your source package is ready.
whl-deploy import all --package=sourceIf you require more fine-grained control, whl_deploy also provides individual commands.
In some cases, you might want to configure the host environment step-by-step:
# Only install and configure Docker
whl-deploy setup docker
# Only install and configure NVIDIA Container Toolkit
whl-deploy setup nvidia_toolkitwhl_deploy allows you to manage various Apollo resources separately.
a. Source Code
- Import Source Code Package: Imports a zipped Apollo source code archive to a specified location.
# China whl-deploy import source_code -i=https://gitee.com/daohu527/apollo-lite.git # github whl-deploy import source_code -i=https://github.com/wheelos/apollo-lite.git # local whl-deploy import source_code -i=apollo-lite-main.zip
- Export Source Code Package: Packages the source code from the current Apollo environment for reuse elsewhere.
whl-deploy export source_code -o=apollo-lite-main.zip
b. Compiled Cache (Bazel Cache)
The Bazel compilation cache is crucial for accelerating the Apollo build process.
- Import Compiled Cache: Imports a pre-packaged Bazel cache.
whl-deploy import cache -i=bazel_cache.tar.gz
- Export Compiled Cache: Exports the current Bazel cache for use across multiple machines or in future deployments.
# only zip content whl-deploy export cache -o=bazel_cache.tar.gz
c. Docker Images
Manage Apollo's core container images.
- Import Docker Image: Imports a Docker image from a
.tarfile. This is useful for offline deployments or pre-loading images.whl-deploy import docker_image -i=whl_docker_image.tar
- Export Docker Image:
- Export information about all currently recognized Apollo-related Docker images:
whl-deploy export docker_image --info - Export a specific Docker image to a
.tarfile:whl-deploy export docker_image -i=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04 -o=cuda_image.tar- Note: Here, the
-iparameter should specify the name and tag of the image to be exported. For example, to export an Apollo development image, use:whl-deploy export docker_image -i=apollo:dev-latest -o=apollo_dev.tar
- Note: Here, the
- Export information about all currently recognized Apollo-related Docker images:
d. High-Definition Maps (HD Maps) (TODO - To Be Implemented)
# all maps
whl-deploy import maps -i="map_data.tar.gz"
# san_mateo only
whl-deploy import maps -i="your_map_dir/san_mateo.tar.gz"
whl-deploy export hd_maps -o=...
e. AI Models (TODO - To Be Implemented)
whl-deploy import models -i=...whl-deploy export models -o=...
whl_deploy aims to simplify Apollo deployment. If you have any questions, suggestions, or wish to contribute code, feel free to submit an Issue or a Pull Request.