Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
11c9b5a
Add docker compose files
sitaowang1998 Aug 6, 2026
470f7e5
Fix network
sitaowang1998 Aug 6, 2026
139286e
Add image tag and worker image name
sitaowang1998 Aug 6, 2026
bb36fec
Add clean task
sitaowang1998 Aug 6, 2026
07baeee
Fix config
sitaowang1998 Aug 6, 2026
c6d4696
Merge branch 'main' into docker-compose
sitaowang1998 Aug 7, 2026
ce11907
Rename variables
sitaowang1998 Aug 7, 2026
4c7b4c0
Merge branch 'docker-compose' of github.com:sitaowang1998/spider into…
sitaowang1998 Aug 7, 2026
7f2d8f3
Merge branch 'main' into docker-compose
sitaowang1998 Aug 7, 2026
6b92262
Merge branch 'main' into docker-compose
sitaowang1998 Aug 11, 2026
bc35203
Expose user-facing config through env file
sitaowang1998 Aug 11, 2026
1bf2687
Merge branch 'docker-compose' of github.com:sitaowang1998/spider into…
sitaowang1998 Aug 11, 2026
d3dbf06
Fix generated storage config keys
sitaowang1998 Aug 11, 2026
0d6b169
Merge branch 'main' into docker-compose
sitaowang1998 Aug 11, 2026
b3eed39
Add defaults for Compose configuration
sitaowang1998 Aug 11, 2026
98ebc3b
Merge remote-tracking branch 'origin/main' into docker-compose
sitaowang1998 Aug 12, 2026
07f764e
Update Compose runtime configuration
sitaowang1998 Aug 12, 2026
ab5a157
Split configs out
sitaowang1998 Aug 12, 2026
d5c1a02
Merge branch 'main' into docker-compose
sitaowang1998 Aug 12, 2026
7807436
Rename env
sitaowang1998 Aug 12, 2026
0ccb692
Add 5 min wait timeout for docker compose up
sitaowang1998 Aug 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ build
# IDE-related directories and files
.idea
cmake-build-debug

# Local Docker Compose credentials
tools/deployment/spider-compose/.env
17 changes: 17 additions & 0 deletions taskfiles/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ version: "3"

vars:
G_BUILD_SCRIPT: "{{.ROOT_DIR}}/tools/docker/build.sh"
G_SPIDER_COMPOSE_DIR: "{{.ROOT_DIR}}/tools/deployment/spider-compose"

tasks:
build:
Expand All @@ -21,3 +22,19 @@ tasks:
build-worker:
deps: [":init"]
cmd: "'{{.G_BUILD_SCRIPT}}' worker"

compose:validate:
dir: "{{.G_SPIDER_COMPOSE_DIR}}"
cmd: "docker compose --file compose.yaml config --quiet"

compose:up:
dir: "{{.G_SPIDER_COMPOSE_DIR}}"
cmd: "docker compose --file compose.yaml up --detach --wait"

@coderabbitai coderabbitai Bot Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== locate docker taskfiles =="
fd -a 'docker\.ya?ml$' . || true

echo "== taskfiles/docker.yaml excerpt =="
if [ -f taskfiles/docker.yaml ]; then
  nl -ba taskfiles/docker.yaml | sed -n '1,120p'
fi

echo "== env examples and wait references =="
fd -a '(\.env\.example|example.*\.env|.*env.*)' . | sed -n '1,80p'
rg -n "SPIDER_COMPOSE_WAIT_TIMEOUT|wait-timeout|docker compose|120|wait" -S . --glob '!node_modules' --glob '!dist' --glob '!build' 2>/dev/null | sed -n '1,200p'

Repository: y-scope/spider

Length of output: 299


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== taskfiles/docker.yaml excerpt =="
if [ -f taskfiles/docker.yaml ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' taskfiles/docker.yaml | sed -n '1,120p'
fi

echo "== tracked relevant files (sample) =="
git ls-files | grep -E '(^|/)(\.env\.example|example.*\.env|.*\.env|taskfiles/docker\.yaml|compose\.ya?ml|README\.md)$' | sed -n '1,120p'

echo "== wait and variable references =="
grep -RIn -E "SPIDER_COMPOSE_WAIT_TIMEOUT|wait-timeout|docker compose|120|wait" --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build . 2>/dev/null | sed -n '1,240p' || true

Repository: y-scope/spider

Length of output: 29282


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Taskfile references =="
for f in $(git ls-files 'Taskfile*' 'taskfiles/*' 'pyproject.toml'); do
  echo "--- $f"
  grep -nIIn -E "dotenv|envfile|env_file|SPIDER_COMPOSE_WAIT_TIMEOUT|compose:up|docker" "$f" 2>/dev/null || true
done

echo "== spider-compose env and compose metadata =="
if [ -f tools/deployment/spider-compose/.env.example ]; then
  awk '{printf "%6d\t%s\n", NR, $0}' tools/deployment/spider-compose/.env.example
fi
if [ -f tools/deployment/spider-compose/compose.yaml ]; then
  sed -n '1,80p' tools/deployment/spider-compose/compose.yaml
fi

echo "== repo-wide 120/wait references excluding generated deps =="
grep -RIn -E "SPIDER_COMPOSE_WAIT_TIMEOUT|wait-timeout|compose:up|120.*second|second.*120|startup timeout|bounded|timeout" --exclude-dir=node_modules --exclude-dir=dist --exclude-dir=build --exclude-dir=.git . 2>/dev/null | sed -n '1,160p' || true

Repository: y-scope/spider

Length of output: 23494


🌐 Web query:

Docker Compose up --wait-timeout documentation

💡 Result:

The --wait-timeout option in Docker Compose is used with the --wait flag to specify a maximum duration, in seconds, to wait for the services in a project to reach a running or healthy state [1][2][3]. Key details regarding this option: Purpose: It prevents the docker compose up command from waiting indefinitely when services fail to start or reach a healthy state within a reasonable timeframe [4][5]. Usage: It must be used in conjunction with the --wait flag, which signifies that the command should wait for services to be running or healthy [1][2]. Because the --wait flag implies detached mode, --wait-timeout is typically used when running services in the background [1][3]. Syntax: You can specify the timeout in seconds as follows: docker compose up -d --wait --wait-timeout Note: This option is distinct from the --timeout (or -t) flag, which is used to set the timeout for container shutdown [1][6]. While the --wait-timeout feature was introduced to address issues where processes would hang, users should be aware of ongoing maintenance and potential bugs in specific edge cases, such as complex dependency conditions (e.g., service_completed_successfully) [7][4].

Citations:


Restore the bounded startup timeout.

tcompose:up uses docker compose up --detach --wait without --wait-timeout, so startup waits are no longer bounded by the documented 120-second limit. Add SPIDER_COMPOSE_WAIT_TIMEOUT=120 to tools/deployment/spider-compose/.env.example, load the variable in the Taskfile, and pass --wait-timeout ${.SPIDER_COMPOSE_WAIT_TIMEOUT:-120} to the compose command.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@taskfiles/docker.yaml` at line 32, Restore the bounded startup timeout for
tcompose:up: add SPIDER_COMPOSE_WAIT_TIMEOUT=120 to
tools/deployment/spider-compose/.env.example, load that variable in the
Taskfile, and update the docker compose command to pass --wait-timeout using the
variable with 120 as its fallback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@sitaowang1998 sounds reasonable, can you confirm

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

As discussed offline, add a 5 minutes timeout.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


compose:down:
dir: "{{.G_SPIDER_COMPOSE_DIR}}"
cmd: "docker compose --file compose.yaml down"
Comment thread
coderabbitai[bot] marked this conversation as resolved.

compose:clean:
dir: "{{.G_SPIDER_COMPOSE_DIR}}"
cmd: "docker compose --file compose.yaml down --volumes --remove-orphans"
3 changes: 2 additions & 1 deletion taskfiles/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ tasks:
.github/ \
docs/ \
taskfile.yaml \
taskfiles/
taskfiles/ \
tools/deployment/spider-compose/

toml-check:
cmds:
Expand Down
20 changes: 20 additions & 0 deletions tools/deployment/spider-compose/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copy this file to `.env` and replace the development credentials before starting Spider.
Comment thread
20001020ycx marked this conversation as resolved.
Outdated

# Required database credentials.
SPIDER_DATABASE_ROOT_PASSWORD=spider-root-password
SPIDER_STORAGE_DB_PASSWORD=spider-password
SPIDER_STORAGE_DB_USERNAME=spider-user

# Optional deployment settings and their defaults.
SPIDER_IMAGE_TAG=main
SPIDER_PULL_POLICY=always

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate files =="
git ls-files | rg '(^|/)(\.env\.example|docker\.yaml|compose\.ya?ml)$' || true

echo
echo "== spider compose env example =="
if [ -f tools/deployment/spider-compose/.env.example ]; then
  cat -n tools/deployment/spider-compose/.env.example
fi

echo
echo "== taskfiles/docker.yaml relevant references =="
if [ -f taskfiles/docker.yaml ]; then
  rg -n "SPIDER_|spider|compose|pull|build|task" taskfiles/docker.yaml -C 3
fi

echo
echo "== compose files referencing SPIDER_PULL_POLICY or spider pull_policy =="
for f in $(git ls-files | rg '(^|/)(docker|docker-compose|compose)\.ya?ml$' -i); do
  echo "-- $f --"
  rg -n "SPIDER_PULL_POLICY|pull_policy|services:" "$f" -C 3 || true
done

Repository: y-scope/spider

Length of output: 2845


🌐 Web query:

Docker Compose pull_policy missing cached image when available

💡 Result:

If Docker Compose is failing to use a locally cached image when you expect it to, it is typically due to a mismatch between the expected image tag/digest or the configuration of the pull_policy. The pull_policy attribute controls how Docker Compose handles image retrieval [1][2]. When you believe an image should be found locally but it is not, check the following: 1. Verify Image Existence and Tags: Ensure the image name and tag (or digest) exactly match what is defined in your docker-compose.yml file. You can verify this by running the command docker images [1]. If the tag in your local cache does not match the tag defined in the compose file, Compose will treat it as missing [1][3]. 2. Check the pull_policy Setting: - missing (or if_not_present): This is the default policy if no build section is defined [2]. It uses the local image if it exists; otherwise, it attempts to pull from the registry [1][4]. - never: This tells Compose to use the local image only and never attempt to pull from a registry [3][4]. If the image is not in your local cache, the service will fail to start [5][3]. - build: If a build section is present, Compose may prioritize building the image from source over using an existing local image [2][6]. 3. Interaction with the build Directive: If your service includes a build section, Docker Compose's behavior changes [6]. Even if an image exists locally, Compose might trigger a rebuild or attempt to pull if not configured correctly [6][7]. If you want to force the use of a local image while a build section is present, setting pull_policy: never can prevent accidental pulls, though you may still need to manage the build behavior explicitly [2][7]. Troubleshooting Tips: - Verify with docker images: Confirm that the exact image name and tag reside in the Docker daemon's image store [1][3]. - Overriding policies: You can force a specific behavior during execution by using the --pull flag with the docker compose up command (e.g., --pull always or --pull never) to override the file configuration for a single run [2]. - Clean up: If you suspect issues with local cache integrity, ensure that there are no dangling images or conflicting tags that might be confusing the resolution process [3].

Citations:


🌐 Web query:

Docker Compose service pull_policy always local image pull policy always documentation

💡 Result:

In Docker Compose, the pull_policy attribute defines the behavior for fetching container images from a registry [1][2]. The pull_policy: always setting instructs Docker Compose to pull the image from the registry every time the service starts, regardless of whether the image already exists in the local platform cache [1][2]. This is useful for tags that are frequently updated (such as:latest or development branch tags) to ensure you are always using the most recent version available on the registry [2]. The following pull_policy options are available in the Compose Specification [1]: - always: Pulls the image from the registry every time [1][2]. - missing (or if_not_present): The default behavior. Compose pulls the image only if it is not already available in the local platform cache [1][2]. Note that the:latest tag is always checked/pulled even with this policy [1][2]. - never: Does not attempt to pull the image from a registry. It relies entirely on the locally cached image and will report a failure if the image is missing [1][2]. - build: Compose builds the image from source, even if it is already present [1][2]. - daily: Checks the registry if the last pull occurred more than 24 hours ago [1][2]. - weekly: Checks the registry if the last pull occurred more than 7 days ago [1][2]. - every_: Checks for updates if the last pull took place before the specified duration (e.g., every_12h, every_30m) [1][2]. You can also override the configuration file setting using command-line flags. For example, using docker compose up --pull always will force a pull for all services regardless of their individual pull_policy settings [2]. Likewise, the docker compose pull command respects the pull_policy defined in your file unless a different policy is specified via the --policy flag [3][2].

Citations:


🌐 Web query:

site:docs.docker.com reference/compose-file/services pull_policy always missing never

💡 Result:

In Docker Compose, the pull_policy attribute is used within a service definition to control when and how the service's image is pulled from a registry [1][2]. While command-line flags like --pull (available in commands such as docker compose up and docker compose create) explicitly accept values such as "always", "missing", "never", and sometimes "build" [3][4], the pull_policy attribute within the compose.yaml file itself functions based on the Compose Specification's defined behavior for image resolution [5][6]. When pull_policy is configured in a service definition, it determines the image pulling strategy: - always: Compose always attempts to pull the image from the registry, even if it is already present locally [5]. - missing: Compose pulls the image only if it is not already available in the local image store [1][2]. - never: Compose does not attempt to pull the image from the registry and relies entirely on the local image. If pull_policy is omitted, the default behavior of Compose is to attempt to pull the image if it is missing, and in scenarios where a build section is also defined, Compose manages the precedence of pulling versus building from source according to the Compose Build Specification [5][1][2]. Note that the --pull command-line flag provides additional control during runtime execution, separate from the persistent configuration set in the Compose file [7][3][4].

Citations:


🌐 Web query:

"SPIDER_WORKER_CONTAINER_IMAGE_REF" "tools/docker/build.sh" "build.sh"

💡 Result:

The term SPIDER_WORKER_CONTAINER_IMAGE_REF is not a standard tool or universal environment variable, but rather an application-specific configuration identifier. It is primarily associated with projects using containerized worker architectures, such as those found in custom CI/CD pipelines or distributed systems [1]. In the context of the requested path tools/docker/build.sh, this script is a common pattern used in various open-source projects (such as Apache TVM, Apache Karaf, and Microsoft Playwright) to automate the building and tagging of Docker images [2][3][4]. While build.sh scripts generally perform the same function—compiling source and wrapping it in a container—they are specific to the repository where they reside [2][3][4]. If you are encountering SPIDER_WORKER_CONTAINER_IMAGE_REF in a configuration file or environment, it is likely being used as a reference to define which Docker image tag or registry path the worker service should pull or utilize for a given task [1]. To effectively use a tools/docker/build.sh script, you should: 1. Navigate to the directory containing the script. 2. Check the script's usage by running./tools/docker/build.sh --help (or equivalent), as most of these scripts require arguments like --tag, --platform, or specific environment variables to function correctly [3][4]. 3. Ensure any required dependencies (e.g., node_modules, cargo builds, or specific build-time binaries) are installed or prepared as indicated by the script's internal logic [2][4]. If you are working with a specific project, consult that project's documentation or repository root README for how their build system handles image references [5][6].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files under tools =="
git ls-files tools | sed -n '1,200p'

echo
echo "== tools/docker/build.sh references if present =="
if [ -f tools/docker/build.sh ]; then
  wc -l tools/docker/build.sh
  rg -n "SPIDER_IMAGE_TAG|SPIDER_WORKER_CONTAINER_IMAGE_REF|IMAGE_TAG|tag|build|DOCKER|docker" tools/docker/build.sh -C 2 || true
fi

echo
echo "== compose image references =="
cat -n tools/deployment/spider-compose/compose.yaml

Repository: y-scope/spider

Length of output: 7466


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== taskfiles/docker.yaml referenced build images and compose default =="
cat -n taskfiles/docker.yaml
echo
echo "== tools/docker/build.sh =="
cat -n tools/docker/build.sh
echo
echo "== tools/docker/Dockerfile stages =="
sed -n '1,220p' tools/docker/Dockerfile | rg -n "FROM|AS " -C 2 || sed -n '1,220p' tools/docker/Dockerfile

Repository: y-scope/spider

Length of output: 4176


Use a local-image-friendly default pull policy.

taskfiles/docker.yaml builds images with docker tag using spider-${service}:dev-..., while tools/deployment/spider-compose/compose.yaml expects ghcr.io/y-scope/spider/${SPIDER_IMAGE_TAG:-main} by default. With SPIDER_PULL_POLICY=always, Compose pulls that registry reference every start, so local dev builds are ignored unless SPIDER_WORKER_CONTAINER_IMAGE_REF is overridden.

If local builds are meant to work with this Compose setup, use an example value matching the local tag or document that local builds need an explicit override.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/deployment/spider-compose/.env.example` at line 10, Update the
SPIDER_PULL_POLICY example in the environment template to a local-image-friendly
default that allows locally tagged images to be used without pulling from the
registry, or document the required explicit override for local builds. Keep it
consistent with the image references produced by the deployment taskfiles and
consumed by the Compose configuration.

@20001020ycx 20001020ycx Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder this could be the workflow of a spider developer who wishes to spin up a docker compose against their local chnage:

  1. Build; writes build/spider-storage-image.id (and the other two).
    task docker:build

  2. Point compose at the exact image just built (the env script does this on every up):
    export SPIDER_STORAGE_IMAGE_REF="$(cat build/spider-storage-image.id)"

  3. Bring the stack up.
    docker compose up

CLP does this automatically, particularly the 2nd step, like a single task package would do the step 1 and 2. Then we do ./sbin/start.sh

Shall we provide wiring and script for the same user experience.

SPIDER_RESTART_POLICY=on-failure:3
SPIDER_SCHEDULER_LOG_LEVEL=INFO
SPIDER_STORAGE_HOST_PORT=50051
SPIDER_STORAGE_LOG_LEVEL=INFO
SPIDER_STORAGE_PUBLISH_IP=127.0.0.1
SPIDER_WORKER_LOG_LEVEL=INFO
SPIDER_WORKER_REPLICAS=4
Comment thread
20001020ycx marked this conversation as resolved.
Outdated

# A complete worker image reference takes precedence over `SPIDER_IMAGE_TAG` when set.
# SPIDER_WORKER_CONTAINER_IMAGE_REF=ghcr.io/y-scope/spider/worker:main
142 changes: 142 additions & 0 deletions tools/deployment/spider-compose/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
name: "spider"

x-service-defaults: &service_defaults
logging:
driver: "local"
pull_policy: "${SPIDER_PULL_POLICY:-always}"
restart: "${SPIDER_RESTART_POLICY:-on-failure:3}"
stop_grace_period: "60s"

x-healthcheck-defaults: &healthcheck_defaults
interval: "30s"
retries: 3
start_interval: "2s"
start_period: "60s"
timeout: "2s"

services:
spider-database:
<<: *service_defaults
image: "mariadb:10.11.16"
networks:
- "spider-internal"
environment:
MYSQL_DATABASE: "spider-db"
MYSQL_PASSWORD: "${SPIDER_STORAGE_DB_PASSWORD:?Please set a value.}"
MYSQL_ROOT_PASSWORD: "${SPIDER_DATABASE_ROOT_PASSWORD:?Please set a value.}"
MYSQL_USER: "${SPIDER_STORAGE_DB_USERNAME:?Please set a value.}"
volumes:
- type: "volume"
source: "spider-database-data"
target: "/var/lib/mysql"
healthcheck:
<<: *healthcheck_defaults
test: [
"CMD",
"mysqladmin", "ping",
"--silent",
"-h", "127.0.0.1",
"-u", "${SPIDER_STORAGE_DB_USERNAME:?Please set a value.}",
"--password=${SPIDER_STORAGE_DB_PASSWORD:?Please set a value.}",
]

spider-storage:
<<: *service_defaults
image: "ghcr.io/y-scope/spider/storage:${SPIDER_IMAGE_TAG:-main}"
networks:
- "default"
- "spider-internal"
command: [
"spider-storage",
"--config", "/etc/spider/storage.yaml",
]
environment:
RUST_LOG: "${SPIDER_STORAGE_LOG_LEVEL:-INFO}"
SPIDER_STORAGE_DB_PASSWORD: "${SPIDER_STORAGE_DB_PASSWORD:?Please set a value.}"
SPIDER_STORAGE_DB_USERNAME: "${SPIDER_STORAGE_DB_USERNAME:?Please set a value.}"
ports:
- host_ip: "${SPIDER_STORAGE_PUBLISH_IP:-127.0.0.1}"
published: "${SPIDER_STORAGE_HOST_PORT:-50051}"
target: 50051
configs:
- source: "spider-storage-config"
target: "/etc/spider/storage.yaml"
depends_on:
spider-database:
condition: "service_healthy"
restart: true
healthcheck:
<<: *healthcheck_defaults
test: [
"CMD",
"timeout", "2",
"bash", "-c", "</dev/tcp/127.0.0.1/50051",
]

spider-scheduler:
<<: *service_defaults
image: "ghcr.io/y-scope/spider/scheduler:${SPIDER_IMAGE_TAG:-main}"
networks:
- "spider-internal"
command: [
"spider-scheduler",
"--config", "/etc/spider/scheduler.yaml",
]
environment:
RUST_LOG: "${SPIDER_SCHEDULER_LOG_LEVEL:-INFO}"
configs:
- source: "spider-scheduler-config"
target: "/etc/spider/scheduler.yaml"
depends_on:
spider-storage:
condition: "service_healthy"
restart: true
healthcheck:
<<: *healthcheck_defaults
test: [
"CMD",
"timeout", "2",
"bash", "-c", "</dev/tcp/127.0.0.1/50052",
]

spider-worker:
<<: *service_defaults
image: >-
${SPIDER_WORKER_CONTAINER_IMAGE_REF:-ghcr.io/y-scope/spider/worker:${SPIDER_IMAGE_TAG:-main}}
networks:
- "default"
- "spider-internal"
Comment thread
20001020ycx marked this conversation as resolved.
command: [
"spider-execution-manager",
"--config", "/etc/spider/worker.yaml",
]
environment:
RUST_LOG: "${SPIDER_WORKER_LOG_LEVEL:-INFO}"
configs:
- source: "spider-worker-config"
target: "/etc/spider/worker.yaml"
depends_on:
spider-scheduler:
condition: "service_healthy"
restart: true
spider-storage:
condition: "service_healthy"
restart: true
deploy:
replicas: "${SPIDER_WORKER_REPLICAS:-4}"

configs:
spider-scheduler-config:
file: "./config/scheduler.yaml"
spider-storage-config:
file: "./config/storage.yaml"
spider-worker-config:
file: "./config/worker.yaml"

networks:
default:
spider-internal:
internal: true

volumes:
spider-database-data:
21 changes: 21 additions & 0 deletions tools/deployment/spider-compose/config/scheduler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
connection_pool_size: 4
host: "0.0.0.0"
port: 50052
runtime:
advertised_endpoint:
host: "spider-scheduler"
port: 50052
scheduler:
policy: "round_robin"
config:
active_job_queue_capacity: 64
cleanup_ready_task_capacity: 256
commit_ready_task_capacity: 256
dispatch_queue_capacity: 64
finalizing_job_expiration_timeout_sec: 300
ready_task_capacity: 65536
storage_poll_timeout_ms: 10
tick_interval_ms: 5
storage_endpoint:
host: "spider-storage"
port: 50051
12 changes: 12 additions & 0 deletions tools/deployment/spider-compose/config/storage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
host: "0.0.0.0"
port: 50051
runtime:
db_config:
host: "spider-database"
max_connections: 64
name: "spider-db"
port: 3306
ready_queue_config:
cleanup_capacity: 256
commit_capacity: 256
task_capacity: 1048576
16 changes: 16 additions & 0 deletions tools/deployment/spider-compose/config/worker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
connection_pool_size: 4
liveness:
scheduler_heartbeat_interval_sec: 10
storage_heartbeat_interval_sec: 10
scheduler:
host: "spider-scheduler"
port: 50052
scheduler_poll_wait_ms: 1000
storage:
host: "spider-storage"
port: 50051
task_executor:
bin_path: "/usr/local/bin/spider-task-executor"
inherited_env: []
max_log_line_bytes: 65536
package_dir: "/opt/spider/packages"
Loading