default: @just --list # build the server build: zig build # build optimized release build-release: zig build -Doptimize=ReleaseFast # run dev server (sqlite, memory broker, debug logging) dev: build rm -f prefect.db PREFECT_SERVER_LOGGING_LEVEL=DEBUG ./zig-out/bin/prefect-server # run API test suite against local server test: PREFECT_PROFILE=zig-server ./scripts/test-api-sequence # run .serve() integration test test-serve: PREFECT_PROFILE=zig-server ./scripts/test-serve # broker backend tests (memory + redis) test-broker backend="all": #!/usr/bin/env bash set -euo pipefail if [ "{{backend}}" = "redis" ] || [ "{{backend}}" = "all" ]; then docker compose up -d redis sleep 1 fi ./scripts/test-broker-backends {{backend}} if [ "{{backend}}" = "redis" ] || [ "{{backend}}" = "all" ]; then docker compose down redis fi # database backend tests (sqlite + postgres) test-db backend="all": #!/usr/bin/env bash set -euo pipefail if [ "{{backend}}" = "postgres" ] || [ "{{backend}}" = "all" ]; then docker compose up -d postgres sleep 2 fi ./scripts/test-db-backends {{backend}} if [ "{{backend}}" = "postgres" ] || [ "{{backend}}" = "all" ]; then docker compose down postgres fi # run high-level prefect client tests (requires running server) test-client: PREFECT_PROFILE=zig-server ./scripts/test-flow PREFECT_PROFILE=zig-server ./scripts/test-blocks # run worker integration tests (scheduler + worker execution) test-worker: PREFECT_PROFILE=zig-server ./scripts/test-worker # run retry orchestration tests test-retry: PREFECT_PROFILE=zig-server ./scripts/test-retry # run full test matrix (all db × broker combinations) test-matrix: ./scripts/test-matrix # run quick test (sqlite + memory only) test-quick: ./scripts/test-matrix --quick # run all tests (legacy - prefer test-matrix) test-all: test test-serve test-client test-broker test-db # start dev services (redis + postgres) services-up: docker compose up -d redis postgres # stop dev services services-down: docker compose down # build and run server in docker docker-build: docker compose build server # run server in docker (sqlite + memory) docker-run: docker-build docker compose up server # run integration tests in docker docker-test: docker compose up --build -d server docker compose run --rm test docker compose down # run server with postgres + redis in docker docker-full: PREFECT_DATABASE_BACKEND=postgres \ PREFECT_DATABASE_URL="postgresql://prefect:prefect@postgres:5432/prefect" \ PREFECT_BROKER_BACKEND=redis \ docker compose up --build # run integration tests with postgres + redis docker-full-test: PREFECT_DATABASE_BACKEND=postgres \ PREFECT_DATABASE_URL="postgresql://prefect:prefect@postgres:5432/prefect" \ PREFECT_BROKER_BACKEND=redis \ docker compose up --build -d server docker compose run --rm test docker compose down # performance benchmark (zig server) bench: ./scripts/benchmark --server zig # performance benchmark comparison (zig vs python) bench-compare: ./scripts/benchmark --compare # performance benchmark matrix (all db × broker combinations) bench-matrix: ./scripts/benchmark --matrix # publish docker image to atcr.io docker-publish tag="latest": docker build -t prefect-server:{{tag}} . docker tag prefect-server:{{tag}} atcr.io/zzstoatzz.io/prefect-server:{{tag}} docker push atcr.io/zzstoatzz.io/prefect-server:{{tag}} # clean build artifacts clean: rm -rf zig-out .zig-cache prefect.db # --- kubernetes --- # deploy to kubernetes k8s-deploy: kubectl apply -k k8s/ # check kubernetes status k8s-status: kubectl -n prefect get pods,svc # port-forward to access locally k8s-forward: kubectl -n prefect port-forward svc/prefect-server 4200:4200 # scale API servers k8s-scale replicas="3": kubectl -n prefect scale deployment/prefect-api --replicas={{replicas}} # view logs k8s-logs component="api": kubectl -n prefect logs -l app.kubernetes.io/component={{component}} -f # delete kubernetes deployment k8s-delete: kubectl delete -k k8s/