This guide covers local usage of the current gitaly executable and its
server subcommand.
It mirrors the practical structure of the Go docs (README, doc/README.md,
doc/beginners_guide.md, and config docs), but only documents behavior that
exists in the Rust code today.
gitaly server boots a tonic gRPC server and serves ServerService
methods:
ServerInfoDiskStatisticsReadinessCheckServerSignature
This is early-phase functionality, intended for local development and smoke testing.
- Rust toolchain compatible with this workspace (
rust-toolchain.toml) gitavailable inPATH(used to populate reported Git version)- Optional:
grpcurlfor manual RPC testing
The server uses a TOML config file passed via --config or GITALY_CONFIG.
listen_addr = "127.0.0.1:2305"
internal_addr = "127.0.0.1:9236"
[[storages]]
name = "default"
path = "/tmp/gitaly-storage"[runtime.limiter]
concurrency_limit = 1024
queue_limit = 0
[runtime.cgroups]
enabled = true
bucket_count = 500Runtime defaults:
runtime.limiter.concurrency_limit = 1024runtime.limiter.queue_limit = 0runtime.cgroups.enabled = trueruntime.cgroups.bucket_count = 500
Validation rules:
listen_addrmust be non-empty and parse as a socket address.- At least one storage is required.
- Storage
namemust be non-empty and unique. - Storage
pathmust be absolute. runtime.limiter.concurrency_limitmust be> 0.- If
runtime.cgroups.enabled = true, thenruntime.cgroups.bucket_countmust be> 0.
From gitaly-rs/:
cargo run -p gitaly -- server --config /path/to/gitaly.tomlOptional runtime directory:
cargo run -p gitaly -- server --config /path/to/gitaly.toml --runtime-dir /tmp/gitaly-rs-runtimeEnvironment variable equivalents:
GITALY_CONFIG=/path/to/gitaly.tomlGITALY_RUNTIME_DIR=/tmp/gitaly-rs-runtime
Help:
cargo run -p gitaly -- --help- Start server:
mkdir -p /tmp/gitaly-storage
cat > /tmp/gitaly-rs.toml <<'EOF'
listen_addr = "127.0.0.1:2305"
internal_addr = "127.0.0.1:9236"
[runtime.limiter]
concurrency_limit = 64
queue_limit = 8
[runtime.cgroups]
enabled = false
bucket_count = 500
[[storages]]
name = "default"
path = "/tmp/gitaly-storage"
EOF
cargo run -p gitaly -- server --config /tmp/gitaly-rs.toml- In another terminal (from repo root
/Users/fcoury/code/gitaly):
grpcurl -plaintext -import-path ./proto -proto server.proto -d '{}' 127.0.0.1:2305 gitaly.ServerService/ServerInfo
grpcurl -plaintext -import-path ./proto -proto server.proto -d '{}' 127.0.0.1:2305 gitaly.ServerService/DiskStatistics
grpcurl -plaintext -import-path ./proto -proto server.proto -d '{}' 127.0.0.1:2305 gitaly.ServerService/ReadinessCheck
grpcurl -plaintext -import-path ./proto -proto server.proto -d '{}' 127.0.0.1:2305 gitaly.ServerService/ServerSignature- Limiter is always active using configured runtime values.
- Cgroup assignment is additive:
- Linux: filesystem-backed manager is used.
- non-Linux (including macOS): noop manager is used.
- Disabling cgroups (
runtime.cgroups.enabled = false) skips cgroup manager wiring entirely.
missing config path; pass --config <path> or set GITALY_CONFIG- Provide
--configor exportGITALY_CONFIG.
- Provide
invalid listen_addr- Use
host:port, for example127.0.0.1:2305.
- Use
runtime limiter concurrency limit must be greater than zero- Set
runtime.limiter.concurrency_limitto1or higher.
- Set
runtime cgroup bucket count must be greater than zero when cgroups are enabled- Set
runtime.cgroups.bucket_countto1or higher, or disable cgroups.
- Set
warning: ... Skipping cluster.proto ... missing proto/raftpb/raft.proto- Known workspace warning from proto generation; unrelated to basic
ServerServiceruntime behavior.
- Known workspace warning from proto generation; unrelated to basic
failed to parse config ... duplicate key ...- Remove duplicate TOML tables, such as multiple
[auth]sections.
- Remove duplicate TOML tables, such as multiple
failed to parse config ... invalid type: string ..., expected a sequence- Use TOML arrays for list values.
- Example:
client_tokens = ["user-token-1"], notclient_tokens = "[user-token-1]".
failed to connect to gitaly at ... connection refused- Start the server and ensure
gitaly_addrmatches the serverlisten_addr. - Example:
gitaly server --config /Volumes/External/gitaly-workspace/config/gitaly-rs.toml.
- Start the server and ensure
listener failed to bind ... Address already in use- Another process owns the port; stop it or change
http_listen_addr/ssh_listen_addr.
- Another process owns the port; stop it or change