Skip to content

Build Guide

This page documents build paths that are confirmed and available in the repository.

Build Path Overview

TargetEntry PointNotes
x86 Docker runtimedocker-compose.x86.yml / docker-compose.x86.windows.ymlStarts the containerized development/runtime environment.
Sophon release packagescripts/build_sophon_package.shCreates the target-device release package.
CPU test buildscripts/build_cpu_test.shBuilds cosmo-tests for x86 CPU validation.
Documentation sitenpm ci and npm run docs:buildBuilds this VitePress site.

x86 Docker Development Runtime

These entry points are from:

  • docker-compose.x86.yml (Linux)
  • docker-compose.x86.windows.yml (Windows)
  • Dockerfile.x86
  • scripts/build_cpu.sh

Confirmed CMake parameters:

ParameterValue
COSMO_TARGET_ARCHx86_64
COSMO_NN_USE_SOPHON_BACKENDOFF
COSMO_NN_USE_CPU_BACKENDON
COSMO_ENABLE_OPENH264ON
COSMO_DEV_MODEON
RESOURCE_DIRdata/resource/aiboxresource_x86

Linux:

bash
docker compose -f docker-compose.x86.yml up -d --build
docker compose -f docker-compose.x86.yml ps

Windows (PowerShell/CMD):

powershell
docker compose -f docker-compose.x86.windows.yml up -d --build
docker compose -f docker-compose.x86.windows.yml ps

After build:

  • Web console available at http://127.0.0.1:8080.
  • Release packages and build artifacts exported to build_output/.
  • Runtime data stored in Docker volume cosmo-x86-data.
  • Resource directory mounted to Docker volume cosmo-x86-app-resource.

Sophon Release Package

bash
bash scripts/build_sophon_package.sh

Windows PowerShell:

powershell
.\scripts\build_sophon_package.ps1

This path is from:

  • docker-compose.sophon.yml
  • Dockerfile.sophon
  • scripts/build_sophon_package.sh
  • scripts/build_sophon_package.ps1
  • scripts/build.sh

Confirmed behavior:

  • Default base image: stream_dev:0.2.
  • Builds with scripts/build.sh -t -m data/resource/aiboxresource.
  • Exports the release package only (does not start services).
  • Package output under build_output/.

Common override variables:

bash
SOPHON_STREAM_DEV_TAR=/path/to/stream_dev_22.04.tar bash scripts/build_sophon_package.sh
SOPHON_BASE_IMAGE=stream_dev:0.2 bash scripts/build_sophon_package.sh

If stream_dev:0.2 is not available locally, the helper script attempts to download and load stream_dev_22.04.tar via dfss.

CPU Test Build

bash
bash scripts/build_cpu_test.sh

This script configures CMake with the CPU backend and BUILD_TESTS=ON, producing:

build_cpu/cosmo-tests

Useful for smoke testing C++ compilation and packaging logic without a target edge device.

Documentation Build

bash
npm ci
npm run docs:build

The build output is generated under docs/.vitepress/dist and should not be committed.

Released under the Apache 2.0 License.