Environment:4paradigm OpenMLDB Docker Compose
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, DevOps |
| Last Updated | 2026-10-12 16:00 GMT |
Overview
Docker Compose v3.9 environment for orchestrating OpenMLDB demo test scenarios in a containerized single-host setup.
Description
This environment provides the Docker Compose orchestration layer for running OpenMLDB demo scenarios. The demo Docker image is built from openjdk:11.0.13-jre-slim-bullseye and includes the OpenMLDB binary, ZooKeeper 3.4.14, Spark 3.2.1 (OpenMLDB fork), Python SDK, and all demo scenario scripts. The docker-compose.test.yml defines a single sut service that runs the full demo test suite: cluster initialization, quickstart SQL, Java/Python/C++ SDK demos, taxi-trip ML pipeline, talkingdata demo, oneflow SQL pipeline, and openmldb_tool verification.
Usage
Use this environment for running the OpenMLDB demo test suite in a reproducible containerized environment. Required by the Demo_Scenarios and openmldb_tool implementations. Also useful for CI/CD pipelines.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux / macOS / Windows (WSL2) | Docker Desktop or Docker Engine |
| Hardware | 4GB+ RAM, 2+ CPU cores | Demo runs multiple services |
| Disk | 5GB+ free | Docker image, OpenMLDB packages, Spark, ZooKeeper |
| Docker | Docker Engine 20.10+ | With docker-compose v2+ |
| Compose | docker-compose v3.9+ | Compose file format version 3.9 |
Dependencies
System Packages
docker>= 20.10docker-compose>= 2.0 (ordocker composeplugin)
Docker Image Contents
- Base:
openjdk:11.0.13-jre-slim-bullseye openmldbbinary (stripped, from release tarball)zookeeper-3.4.14spark-3.2.1-bin-openmldbspark(OpenMLDB Spark fork)- Python packages:
openmldb,openmldb-tool,py4j,lightgbm,xgboost,pandas,numpy - System:
libgomp1,curl,binutils,procps,python3,vim,rsync
Build Arguments
OPENMLDB_VERSION— OpenMLDB release version (default:0.9.2in Dockerfile)USE_ADD_WHL— iftrue, install OpenMLDB from local wheel instead of pipSKIP_DOWNLOAD— ifskip_download, use pre-staged packages
Credentials
No credentials required. All packages are downloaded from public repositories.
Quick Install
# Build the demo Docker image
cd demo
docker-compose -f docker-compose.test.yml build
# Run all demo scenarios
docker-compose -f docker-compose.test.yml up --exit-code-from sut
# Run with specific OpenMLDB version
docker-compose -f docker-compose.test.yml build --build-arg OPENMLDB_VERSION=0.9.2
Code Evidence
Docker Compose service definition from `demo/docker-compose.test.yml:1-19`:
version: "3.9"
services:
sut:
build:
context: .
volumes:
- ./jd-recommendation:/work/oneflow_demo
- ./quick_start:/work/quick_start
- ./java_quickstart/demo/target:/work/java_quickstart
- ./python_quickstart:/work/python_quickstart
- ./cxx_quickstart:/work/cxx_quickstart
- ./usability_testing:/work/usability_testing
command:
- /bin/bash
- -ecx
- |
mkdir -p /tmp/openmldb/tablet-1/udf
mkdir -p /tmp/openmldb/tablet-2/udf
./init.sh
sleep 5
Docker image base and packages from `demo/Dockerfile:1-19`:
FROM openjdk:11.0.13-jre-slim-bullseye
RUN apt-get update \
&& apt-get install -y --no-install-recommends libgomp1 curl binutils procps python3 python3-pip python3-numpy vim rsync
RUN pip install --no-cache-dir py4j==0.10.9 lightgbm==3 tornado requests pandas==1.5 xgboost==1.4.2 numpy==1.26.4
openmldb_tool verification from `demo/docker-compose.test.yml:73-77`:
openmldb_tool status --diff -f /work/openmldb/conf/hosts
openmldb_tool inspect
openmldb_tool test
openmldb_tool static-check --conf_file=/work/openmldb/conf/hosts -VCL --local
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
Cannot connect to the Docker daemon |
Docker not running | systemctl start docker
|
port 2181 already in use |
ZooKeeper port conflict | Stop conflicting service or change port mapping |
init.sh: command not found |
init.sh not copied into container | Rebuild image: docker-compose build --no-cache
|
openmldb binary not exist |
setup_openmldb.sh failed during build | Check network access during Docker build; use SKIP_DOWNLOAD=skip_download with pre-staged packages
|
demo-1.0-SNAPSHOT.jar not found |
Java demo JAR not built | Build Java demo first, or download: curl -SLO https://openmldb.ai/download/testing/demo-1.0-SNAPSHOT.jar
|
Compatibility Notes
- Docker Compose v2: Use
docker compose(plugin) instead ofdocker-compose(standalone). - Apple Silicon (M1/M2): Use
--platform linux/amd64if aarch64 image has issues. - CI/CD: Use
--exit-code-from sutto propagate test failure exit codes. - Pre-staged packages: Pass
SKIP_DOWNLOAD=skip_downloadand add tarballs toadditions/directory for air-gapped builds.