Nomploy Nomad Packs

← All packs

surrealdb v0.1.0

Databases

SurrealDB — a scalable, multi-model database (document, graph, relational, and more) with a SQL-like query language, queryable over HTTP and WebSocket. Deployed as a host-networked Nomad service with RocksDB storage on a persistent volume.

nomad-pack run surrealdb --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- surrealdb

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 8000 1 volume image surrealdb/surrealdb:latest tracks :latest image bumped 28 days ago
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run surrealdb -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "surrealdb"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The SurrealDB container image. Pin a tag in production.
image = "surrealdb/surrealdb:latest"

# Host port for the SurrealDB HTTP/WebSocket API.
port = 8000

# Initial root username (created on first start, then persisted in storage).
root_user = "root"

# Initial root password. CHANGE THIS.
root_password = "root"

# Docker named volume for /data (the RocksDB storage). SurrealDB runs as root, so a fresh volume is writable. Back it up.
data_volume = "surrealdb_data"

# Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 500
    memory = 512
  }
NameTypeDefaultDescription
job_name string
"surrealdb"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"surrealdb/surrealdb:latest"
The SurrealDB container image. Pin a tag in production.
port number
8000
Host port for the SurrealDB HTTP/WebSocket API.
root_user string
"root"
Initial root username (created on first start, then persisted in storage).
root_password key string
"root"
Initial root password. CHANGE THIS.
data_volume string
"surrealdb_data"
Docker named volume for /data (the RocksDB storage). SurrealDB runs as root, so a fresh volume is writable. Back it up.
constraints list
[]
Placement constraints — pin to one node so the local volume stays put. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 500
    memory = 512
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: surrealdb_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/surrealdb_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/surrealdb_data/_data backup:<bucket>/surrealdb_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

surrealdb

SurrealDB — a scalable, multi-model database (document, graph, relational, time-series) with a SQL-like query language (SurrealQL), queryable over HTTP and WebSocket. Host-networked Nomad service with on-disk RocksDB storage on a persistent volume.

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run surrealdb --registry nomploy --var root_password=<secret>

In nomploy: create a Compose service, type Nomad Pack, pack surrealdb, set root_password, then Deploy. Endpoint at http://<node-ip>:8000.

Key variables

Variable Default Notes
image surrealdb/surrealdb:latest Pin a tag in production.
port 8000 HTTP + WebSocket API.
root_user / root_password root / root Root creds, persisted on first start. Change the password.
data_volume surrealdb_data RocksDB storage. Back it up.
constraints [] Pin to a node so the local volume stays put.
resources cpu 500 / mem 512 Raise for larger workloads.

Notes