Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
109 lines (107 loc) · 4.18 KB
/
Copy pathdocker-compose.yml
File metadata and controls
109 lines (107 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# SPARK_VERSION overrides the tag both servers run, which is how the forward-compatibility
# run in .github/workflows/spark-versions.yml points them at a newer Spark. dev/README.md.
services:
spark-connect:
image: apache/spark:${SPARK_VERSION:-4.2.0}
container_name: latu-spark-connect
ports:
- "15002:15002"
- "4040:4040"
entrypoint: ["/opt/spark/sbin/start-connect-server.sh"]
command:
- "--wait"
# One task slot: the suite is hundreds of tiny queries, and ten tasks each cost more than
# they save. Measured; docs/decisions.md "keep whole-stage codegen and local[1]".
- "--master"
- "local[1]"
- "--conf"
- "spark.connect.grpc.binding.address=0.0.0.0"
- "--conf"
- "spark.connect.grpc.binding.port=15002"
- "--conf"
- "spark.sql.session.timeZone=UTC"
- "--conf"
- "spark.sql.shuffle.partitions=4"
# A reliable checkpoint needs a directory, and it is a SparkContext-level setting: the
# command carries no path, so `Latu.checkpoint/2` without `local: true` fails outright
# unless this is set at startup. (`spark.checkpoint.dir` since Spark 4.0; before that it
# was SparkContext.setCheckpointDir only, which Spark Connect cannot reach.)
- "--conf"
- "spark.checkpoint.dir=/tmp/latu_checkpoints"
# Progress messages are sent on a timer, default 2s, so a query shorter than that reports
# nothing at all. 100ms lets `test/integration/progress_test.exs` measure the plumbing
# without holding local[1]'s single task slot for seconds. A conf change here needs
# `docker compose up -d --force-recreate spark-connect`.
- "--conf"
- "spark.connect.progress.reportInterval=100ms"
- "--conf"
- "spark.ui.port=4040"
# `docker compose up -d --wait` returns when this passes. Without it "up" means the JVM
# exists, not that the gRPC port is listening, and the first test connects into nothing.
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/15002"]
interval: 5s
timeout: 3s
retries: 36
start_period: 15s
volumes:
- ./fixtures:/fixtures:ro
# LakeSail, for the nightly compatibility run (docs/lakesail.md). A profile, so a bare `up`
# leaves it out: it publishes the Spark servers' ports, one process behind both.
sail:
profiles: ["sail"]
image: latu-sail:${SAIL_VERSION:-0.7.3}
container_name: latu-sail
# LakeSail publishes no image; this is its own quick-start recipe. PySpark is there because
# Sail answers `spark_version` by importing it.
build:
dockerfile_inline: |
FROM python:3.13-slim
RUN pip install --no-cache-dir "pysail==${SAIL_VERSION:-0.7.3}" "pyspark-client==4.2.0"
command: ["sail", "spark", "server", "--ip", "0.0.0.0", "--port", "15002"]
ports:
- "15002:15002"
- "15003:15002"
environment:
SAIL_EXECUTION__CHECKPOINT__PATH: /tmp/latu_checkpoints
healthcheck:
test: ["CMD", "python3", "-c", "import socket; socket.create_connection(('127.0.0.1', 15002), 1)"]
interval: 5s
timeout: 3s
retries: 36
start_period: 5s
volumes:
- ./fixtures:/fixtures:ro
spark-reattach:
image: apache/spark:${SPARK_VERSION:-4.2.0}
container_name: latu-spark-reattach
ports:
- "15003:15002"
- "4041:4040"
entrypoint: ["/opt/spark/sbin/start-connect-server.sh"]
command:
- "--wait"
- "--conf"
- "spark.connect.grpc.binding.address=0.0.0.0"
- "--conf"
- "spark.connect.grpc.binding.port=15002"
- "--conf"
- "spark.connect.execute.reattachable.senderMaxStreamDuration=5s"
- "--conf"
- "spark.connect.execute.reattachable.senderMaxStreamSize=1m"
- "--conf"
- "spark.connect.execute.reattachable.observerRetryBufferSize=10m"
- "--conf"
- "spark.sql.session.timeZone=UTC"
- "--conf"
- "spark.sql.shuffle.partitions=4"
- "--conf"
- "spark.ui.port=4040"
healthcheck:
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/15002"]
interval: 5s
timeout: 3s
retries: 36
start_period: 15s
volumes:
- ./fixtures:/fixtures:ro