Skip to content

[CELEBORN-2390] Add docker-compose for local cluster - #3768

Open
yew1eb wants to merge 5 commits into
apache:mainfrom
yew1eb:add-docker-compose
Open

[CELEBORN-2390] Add docker-compose for local cluster#3768
yew1eb wants to merge 5 commits into
apache:mainfrom
yew1eb:add-docker-compose

Conversation

@yew1eb

@yew1eb yew1eb commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add a docker-compose.yaml under docker/ to run a minimal local Celeborn cluster (1 master + 3 workers) for development and debugging, with a build-image.sh wrapper and a conf/. The existing docker/Dockerfile is unchanged.

Why are the changes needed?

There is no lightweight local deployment path today — only the K8s Helm chart or running master/worker manually on the host.

Does this PR resolve a correctness bug?

  • Yes

Does this PR introduce any user-facing change?

  • Yes

How was this patch tested?

Ran the cluster locally with docker compose up -d:

$ docker compose -f docker/docker-compose.yaml up -d
$ docker compose -f docker/docker-compose.yaml ps

image image

@yew1eb
yew1eb force-pushed the add-docker-compose branch 3 times, most recently from e17f836 to 0c8a74e Compare July 25, 2026 07:27
@yew1eb
yew1eb force-pushed the add-docker-compose branch from 0c8a74e to b6fce04 Compare July 25, 2026 07:33
@yew1eb

yew1eb commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

@SteNicholas @RexXiong @zaynt4606 Could you help review this PR? Thanks!

@yew1eb

yew1eb commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

Ping @pan3793, @cxzl25, @RexXiong, @SteNicholas

@pan3793

pan3793 commented Aug 13, 2026

Copy link
Copy Markdown
Member

I feel this might be less useful without Compute Engine integration ... if you suppose run Compute Engine outside, e.g., run Spark on your host with local mode, then it requires a direct connection from Spark to Celeborn Worker, you should expose the Worker's port too

@yew1eb

yew1eb commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @pan3793. Added an example Spark cluster (1 master + 2 workers) to docker-compose so the stack can be exercised end-to-end.
Spark runs inside celeborn-net and contacts the master directly via spark.celeborn.master.endpoints=celeborn-master:9097, so no worker ports need to be exposed — worker push/fetch ports stay random, handed out by the master.

./docker/build-image.sh -Pspark-3.5      # celeborn:dev + celeborn-spark:dev
docker compose -f docker/docker-compose.yaml up -d
docker exec celeborn-spark-master /opt/spark/bin/spark-submit \
    --master spark://celeborn-spark-master:7077 \
    --class org.apache.spark.examples.GroupByTest \
    /opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar 10 100 1000 10
image image

Reviewer noted the standalone Celeborn compose is less useful without a
compute engine: it cannot be exercised end-to-end, and running Spark in
local mode on the host would require exposing worker ports. Add an
example Spark cluster (1 master + 2 workers) to docker-compose whose
shuffle is served by Celeborn, addressing both concerns:
- Spark runs inside the celeborn-net, so the client only contacts the
  master RPC (celeborn-master:9097); worker push/fetch ports stay random
  and unexposed.
- A GroupByTest spark-submit example gives an end-to-end shuffle check.

Changes:
- docker/spark/Dockerfile: apache/spark:3.5.0 + celeborn client shaded jar
- docker/spark/conf/spark-defaults.conf: CelebornShuffleManager/Kryo/...
- docker-compose.yaml: spark-master/spark-worker services + shared volume
- build-image.sh: optionally build celeborn-spark:dev when -Pspark-3.x
  produces dist/spark/*.jar; base tag via CELEBORN_SPARK_BASE_TAG
  (renamed to avoid collision with Spark's own SPARK_IMAGE_TAG env)
- README.md: Spark build + GroupByTest run/verify instructions
- .gitignore: exclude any jar copied into the docker/spark build context

@pan3793 pan3793 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couples of minor issues, overall lgtm

Comment thread .gitignore Outdated
tmp/

# Spark client shaded jar copied into the docker build context by build-image.sh
docker/spark/*.jar

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just exclude *.jar globally?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread docker/build-image.sh Outdated
BASE_SPARK_IMAGE_TAG="${CELEBORN_SPARK_BASE_TAG:-3.5.0}"

echo "==> Building distribution (./build/make-distribution.sh $*) ..."
./build/make-distribution.sh "$@"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we prefer to add --sbt-enabled

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread docker/build-image.sh Outdated
# Only build it when make-distribution produced a Spark client shaded jar, which
# happens when a -Pspark-3.x profile was passed. If absent, skip gracefully so
# the Celeborn-only workflow keeps working.
SPARK_CLIENT_JAR="$(ls dist/spark/celeborn-client-spark-3-shaded_*.jar 2>/dev/null || true)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about spark 4?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Supported

Comment thread docker/README.md Outdated
Comment on lines +81 to +84
docker exec celeborn-spark-master /opt/spark/bin/spark-submit \
--master spark://celeborn-spark-master:7077 \
--class org.apache.spark.examples.GroupByTest \
/opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar 10 100 1000 10

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace with the version-agnostic bin/run-example

Suggested change
docker exec celeborn-spark-master /opt/spark/bin/spark-submit \
--master spark://celeborn-spark-master:7077 \
--class org.apache.spark.examples.GroupByTest \
/opt/spark/examples/jars/spark-examples_2.12-3.5.0.jar 10 100 1000 10
docker exec celeborn-spark-master /opt/spark/bin/run-example \
--master spark://celeborn-spark-master:7077 \
GroupByTest 10 100 1000 10

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread docker/spark/Dockerfile Outdated
# Usage (built by build-image.sh, not directly):
# docker build -t celeborn-spark:dev docker/spark/

ARG spark_image_tag=3.5.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why choose 3.5.0 instead of 3.5.9?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumped to 3.5.9

- .gitignore: exclude *.jar globally instead of docker/spark/*.jar
- build-image.sh: pass --sbt-enabled to make-distribution.sh
- build-image.sh/Dockerfile: support Spark 4 client jar, derive default
  base image tag from Spark major version (3 -> 3.5.9, 4 -> 4.0.4)
- Dockerfile: bump default apache/spark base tag from 3.5.0 to 3.5.9
- README.md: use version-agnostic bin/run-example in the example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants