Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bb74984
feat: add PostgreSQL DAG-run store
yottahmd May 6, 2026
0aa84f5
fix: address PostgreSQL DAG-run store review feedback
yottahmd May 6, 2026
3b62c72
fix: address PostgreSQL DAG-run store nitpicks
yottahmd May 6, 2026
cc31f68
fix: address PostgreSQL DAG-run store review
yottahmd May 6, 2026
7f0751b
fix: align Postgres DAG-run cleanup retention
yottahmd May 6, 2026
d63d0af
fix: split Postgres DAG-run store connection roles
yottahmd May 6, 2026
857ce02
test: make retention query parsing portable
yottahmd May 6, 2026
2ba35b1
test: make local queue FIFO sleep portable
yottahmd May 6, 2026
bb7f636
fix: address PostgreSQL DAG-run review feedback
yottahmd May 6, 2026
8d05879
fix: address PostgreSQL DAG-run follow-up review
yottahmd May 6, 2026
9f5a715
fix: require opt-in PostgreSQL agent access
yottahmd May 6, 2026
548a907
chore: add PostgreSQL dev stop target
yottahmd May 6, 2026
c93ee71
fix: split PostgreSQL DAG-run summary from attempts
yottahmd May 7, 2026
04d1f43
feat: add postgres control-plane store
yottahmd May 7, 2026
599517f
chore: merge main
yottahmd May 7, 2026
5f05fca
ci: predownload modules before go fix
yottahmd May 7, 2026
2ad9a86
ci: isolate postgres integration tests
yottahmd May 7, 2026
832d49b
refactor: polish control-plane store implementation
yottahmd May 7, 2026
0a9282f
refactor: canonicalize postgres control-plane data
yottahmd May 7, 2026
17c1c81
refactor: separate coordinator postgres store config
yottahmd May 7, 2026
2ad7d3e
Merge remote-tracking branch 'origin/main' into codex/postgres-dagrun…
yottahmd May 7, 2026
e06b601
fix: address postgres store review feedback
yottahmd May 8, 2026
d14c197
fix: update x/net for govulncheck
yottahmd May 8, 2026
efea552
test: cover postgres store integration edge cases
yottahmd May 9, 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
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ linters:
- ui
- docs
- gen
- internal/persis/dagrunstore/postgres/db
- filenotify
settings:
revive:
Expand Down
32 changes: 32 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ APP_NAME=dagu
# Docker image build configuration
DOCKER_CMD := docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm64/v8 --builder container --build-arg LDFLAGS="$(LDFLAGS)" --push --no-cache

# PostgreSQL DAG-run store development configuration
DEV_PG_COMPOSE_FILE=$(SCRIPT_DIR)/compose.postgres.yaml
DEV_PG_COMPOSE_PROJECT?=dagu-dev-pg
DEV_PG_DSN?=postgres://dagu:dagu@localhost:54321/dagu?sslmode=disable

# Arguments for the tests
GOTESTSUM_ARGS=--format=standard-quiet
# Go test flags (see https://github.com/golang/go/issues/61229#issuecomment-1988965927)
Expand Down Expand Up @@ -121,6 +126,32 @@ run: ${FE_BUNDLE_JS}
@printf '%b\n' "${COLOR_GREEN}Starting the frontend server and the scheduler...${COLOR_RESET}"
@DAGU_DEBUG=1 go run ./cmd start-all

# dev-pg starts a local PostgreSQL instance and runs Dagu with the Postgres DAG-run store.
.PHONY: dev-pg
dev-pg: ${FE_BUNDLE_JS}
@printf '%b\n' "${COLOR_GREEN}Starting PostgreSQL for DAG-run store development...${COLOR_RESET}"
@docker compose -p ${DEV_PG_COMPOSE_PROJECT} -f ${DEV_PG_COMPOSE_FILE} up -d postgres
@printf '%b\n' "${COLOR_GREEN}Waiting for PostgreSQL to become ready...${COLOR_RESET}"
@i=0; \
while [ $$i -lt 30 ]; do \
if docker compose -p ${DEV_PG_COMPOSE_PROJECT} -f ${DEV_PG_COMPOSE_FILE} exec -T postgres pg_isready -U dagu -d dagu >/dev/null 2>&1; then \
break; \
fi; \
i=$$((i + 1)); \
sleep 1; \
done; \
if [ $$i -ge 30 ]; then \
printf '%b\n' "${COLOR_RED}Error: PostgreSQL did not become ready.${COLOR_RESET}"; \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
docker compose -p ${DEV_PG_COMPOSE_PROJECT} -f ${DEV_PG_COMPOSE_FILE} ps; \
exit 1; \
fi
@printf '%b\n' "${COLOR_GREEN}Starting Dagu with PostgreSQL DAG-run store...${COLOR_RESET}"
@DAGU_DEBUG=1 \
DAGU_DAG_RUN_STORE_BACKEND=postgres \
DAGU_DAG_RUN_STORE_POSTGRES_DSN='${DEV_PG_DSN}' \
DAGU_DAG_RUN_STORE_POSTGRES_AUTO_MIGRATE=true \
go run ./cmd start-all

# server build the binary and start the server.
.PHONY: run-server
run-server: golangci-lint bin
Expand Down Expand Up @@ -261,6 +292,7 @@ addlicense:
@${LOCAL_BIN_DIR}/addlicense \
-ignore "**/node_modules/**" \
-ignore "./**/gen/**" \
-ignore "internal/persis/dagrunstore/postgres/db/**" \
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
-ignore "Dockerfile" \
-ignore "ui/*" \
-ignore "ui/**/*" \
Expand Down
20 changes: 20 additions & 0 deletions compose.postgres.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
postgres:
image: postgres:18
environment:
POSTGRES_USER: dagu
POSTGRES_PASSWORD: dagu
POSTGRES_DB: dagu
ports:
- "54321:5432"
volumes:
# PostgreSQL 18 stores data in a major-version subdirectory under this path.
- dagu-dev-postgres-data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dagu -d dagu"]
interval: 2s
timeout: 5s
retries: 30

volumes:
dagu-dev-postgres-data:
24 changes: 24 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ require (
github.com/oapi-codegen/runtime v1.1.2
github.com/opencontainers/image-spec v1.1.1
github.com/pkg/sftp v1.13.10
github.com/pressly/goose/v3 v3.26.0
github.com/redis/go-redis/v9 v9.7.3
github.com/rhysd/changelog-from-release/v3 v3.9.1
github.com/robfig/cron/v3 v3.0.1
Expand Down Expand Up @@ -69,6 +70,7 @@ require (
)

require (
cel.dev/expr v0.25.1 // indirect
codeberg.org/chavacava/garif v0.2.0 // indirect
dev.gaijin.team/go/exhaustruct/v4 v4.0.0 // indirect
dev.gaijin.team/go/golib v0.6.0 // indirect
Expand All @@ -83,6 +85,7 @@ require (
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
github.com/alfatraining/structtag v1.0.0 // indirect
github.com/andybalholm/brotli v1.2.0 // indirect
github.com/antlr4-go/antlr/v4 v4.13.1 // indirect
github.com/ashanbrown/forbidigo/v2 v2.3.0 // indirect
github.com/ashanbrown/makezero/v2 v2.1.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.41.0 // indirect
Expand All @@ -109,6 +112,7 @@ require (
github.com/cloudflare/circl v1.6.3 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/creachadair/msync v0.7.1 // indirect
github.com/cubicdaiya/gonp v1.0.4 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
Expand All @@ -128,13 +132,15 @@ require (
github.com/go-json-experiment/json v0.0.0-20250813024750-ebf49471dced // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-openapi/jsonreference v0.20.4 // indirect
github.com/go-sql-driver/mysql v1.9.3 // indirect
github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 // indirect
github.com/godoc-lint/godoc-lint v0.10.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golangci/asciicheck v0.5.0 // indirect
github.com/golangci/swaggoswag v0.0.0-20250504205917-77f2aca3143e // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/cel-go v0.26.1 // indirect
github.com/google/gnostic-models v0.7.0 // indirect
github.com/google/go-github/v76 v76.0.0 // indirect
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
Expand All @@ -158,6 +164,7 @@ require (
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/puddle/v2 v2.2.2 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
Expand All @@ -171,6 +178,7 @@ require (
github.com/manuelarte/funcorder v0.5.0 // indirect
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
github.com/mdlayher/socket v0.5.0 // indirect
github.com/mfridman/interpolate v0.0.2 // indirect
github.com/mikelolasagasti/xz v1.0.1 // indirect
github.com/minio/crc64nvme v1.1.1 // indirect
github.com/minio/md5-simd v1.1.2 // indirect
Expand All @@ -182,32 +190,44 @@ require (
github.com/ncruces/go-strftime v0.1.9 // indirect
github.com/nwaples/rardecode/v2 v2.2.0 // indirect
github.com/oklog/run v1.0.0 // indirect
github.com/pganalyze/pg_query_go/v6 v6.1.0 // indirect
github.com/philhofer/fwd v1.2.0 // indirect
github.com/pierrec/lz4/v4 v4.1.22 // indirect
github.com/pingcap/errors v0.11.5-0.20240311024730-e056997136bb // indirect
github.com/pingcap/failpoint v0.0.0-20240528011301-b51a646c7c86 // indirect
github.com/pingcap/log v1.1.0 // indirect
github.com/pingcap/tidb/pkg/parser v0.0.0-20250324122243-d51e00e5bbf0 // indirect
github.com/pires/go-proxyproto v0.8.1 // indirect
github.com/pjbgf/sha1cd v0.3.2 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/pquerna/cachecontrol v0.2.0 // indirect
github.com/prometheus-community/pro-bing v0.4.0 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/riza-io/grpc-go v0.2.0 // indirect
github.com/rs/xid v1.6.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/safchain/ethtool v0.3.0 // indirect
github.com/samber/slog-common v0.19.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/sethvargo/go-retry v0.3.0 // indirect
github.com/skeema/knownhosts v1.3.1 // indirect
github.com/sorairolake/lzip-go v0.3.8 // indirect
github.com/speakeasy-api/jsonpath v0.6.0 // indirect
github.com/sqlc-dev/sqlc v1.30.0 // indirect
github.com/stoewer/go-strcase v1.2.0 // indirect
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 // indirect
github.com/tailscale/wireguard-go v0.0.0-20250716170648-1d0488a3d7da // indirect
github.com/tetratelabs/wazero v1.9.0 // indirect
github.com/tinylib/msgp v1.6.1 // indirect
github.com/tklauser/go-sysconf v0.3.16 // indirect
github.com/tklauser/numcpus v0.11.0 // indirect
github.com/ulikunitz/xz v0.5.15 // indirect
github.com/wasilibs/go-pgquery v0.0.0-20250409022910-10ac41983c07 // indirect
github.com/wasilibs/wazero-helpers v0.0.0-20240620070341-3dff1577cd52 // indirect
github.com/woodsbury/decimal128 v1.3.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
Expand All @@ -216,6 +236,7 @@ require (
go.augendre.info/arangolint v0.3.1 // indirect
go.augendre.info/fatcontext v0.9.0 // indirect
go.opentelemetry.io/proto/otlp v1.10.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
Expand All @@ -230,6 +251,7 @@ require (
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gvisor.dev/gvisor v0.0.0-20250205023644-9414b50a5633 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
Expand Down Expand Up @@ -469,3 +491,5 @@ require (
golang.org/x/sys v0.42.0
gopkg.in/yaml.v3 v3.0.1
)

tool github.com/sqlc-dev/sqlc/cmd/sqlc
Loading
Loading