Skip to content

Runtime Configuration

This page consolidates the runtime configuration entries that can be confirmed in the current repository. Configuration sources include Docker Compose, Dockerfile, CMake, startup scripts, and application constants.

Docker Compose Configuration

x86 development runtime:

  • Linux: docker-compose.x86.yml
  • Windows: docker-compose.x86.windows.yml

Sophon release package build:

text
docker-compose.sophon.yml

x86 Docker Environment Variables

Set in Dockerfile.x86:

VariableDefaultDescription
INSTALLPATH/appfs/cosmo_wander/cwai_dataMain installation directory (can be overridden as needed)
COSMO_PLATFORM_TYPEx86_64Platform type

scripts/docker-entrypoint.x86.sh ensures the runtime directory exists and executes:

bash
${INSTALLPATH}/scripts/run_start.sh start ${DATADIR}/log/logs/INTE_RUN_container.log

Sophon Build Variables

docker-compose.sophon.yml supports the following build arguments:

VariableDefaultDescription
SOPHON_APT_MIRRORhttps://mirrors.aliyun.com/ubuntuapt mirror
SOPHON_NODE_DIST_BASE_URLhttps://npmmirror.com/mirrors/nodeNode download mirror
SOPHON_RUSTUP_INIT_URLhttps://rsproxy.cn/rustup-init.shrustup-init download URL
SOPHON_RUSTUP_DIST_SERVERhttps://rsproxy.cnRust dist server
SOPHON_RUSTUP_UPDATE_ROOThttps://rsproxy.cn/rustupRust update root

Resource Directories

Build PathResource Directory
x86 Dockerdata/resource/aiboxresource_x86
Sophon packagedata/resource/aiboxresource

CMake installs resources via RESOURCE_DIR.

Runtime Directories

PathDescription
<INSTALLPATH>Main installation directory, set by the INSTALLPATH environment variable in the Dockerfile
<DATADIR>User data, by default located on a persistent volume
<DATADIR>/log/logsLogs
<DATADIR>/upgradeUpgrade packages
<DATADIR>/tmp/*nginx temporary directories

Ports

PortDescription
8080x86 Docker host access to the web console
80nginx inside the container
8000Backend HTTP
9000Backend WebSocket
1936SRS RTMP
1985SRS API
18088SRS HTTP stream

Stream Variables

Set by scripts/run_start.sh:

bash
COSMO_STREAM_PLAY_MODE=srs
COSMO_STREAM_RTMP_BASE=rtmp://127.0.0.1:1936/live
COSMO_STREAM_RTC_API_PORT=1985
COSMO_STREAM_HTTP_PORT=18088

CMake Key Options

User-configurable cache options (set with -D<option>=<value>):

OptionDescription
COSMO_TARGET_ARCHaarch64 or x86_64
COSMO_NN_USE_SOPHON_BACKENDEnable the Sophon backend (mutually exclusive with COSMO_NN_USE_CPU_BACKEND)
COSMO_NN_USE_CPU_BACKENDEnable the CPU/ONNX Runtime backend (mutually exclusive with COSMO_NN_USE_SOPHON_BACKEND)
COSMO_DEV_MODEDevelopment mode
BUILD_TESTSBuild the test suite

Derived variables (set automatically by the build system, not to be set directly):

VariableDescription
COSMO_ENABLE_OPENH264Enable OpenH264 under the CPU backend
COSMO_OPENH264_USE_ASMEnable ASM for OpenH264 under the CPU backend
COSMO_MODEL_GUARDModel guard integration

Released under the Apache 2.0 License.