cardinal

Start Perch

Fetch Perch into a workspace and start it with the workspace, against a running one, or by hand.

Fetch it

cardinal perch get [--ref REF]

This clones Perch into the workspace's tools/perch/ at tag or branch REF, or its main branch when you leave --ref out. It pins the git URL, tag and commit under perch: in cardinal.workspace.exs. Perch stays out of the apps list and the build. A new workspace's .gitignore lists tools/.

Run perch get again to update. If the clone fails, the old copy stays.

Start it

CommandWhen to use it
cardinal start --verboseDevelopment. Starts Postgres, S3 and the web server, logs Cardinal at debug level, and starts Perch once the web server listens
cardinal perchA workspace that is already running, such as a host where cardinal start is not how Cardinal runs
bin/perch in tools/perch/By hand, with the environment set yourself

Both cardinal commands print Perch: http://localhost:4100 and pass Perch three variables: CARDINAL_WORKSPACE, CARDINAL_DATABASE_URL and PERCH_PORT. Perch stops when the command stops, Ctrl-C included.

Without tools/perch/, cardinal start --verbose prints a hint naming cardinal perch get and starts without it. cardinal perch fails with the same hint.

Start it by hand

cd tools/perch
mix setup
CARDINAL_WORKSPACE=~/aincrad \
CARDINAL_DATABASE_URL=ecto://cardinal:cardinal@localhost:5432/cardinal \
bin/perch

bin/perch fetches dependencies on first run, then runs mix phx.server. Open http://127.0.0.1:4100.

Without Perch: cardinal nodes

Every Cardinal node, web and worker, writes a heartbeat row to platform.nodes every 10 seconds, with or without Perch. cardinal nodes reads those rows, so node liveness works on any install.

cardinal nodes
web@host1  web  212 MB  seen 4s ago  live
worker@host2  worker  180 MB  seen 41s ago  stale

It lists nodes that reported in the last day. A node silent for over 30 seconds is stale and makes the exit code 1, so a script or health check can use it. With no rows it prints that no node has reported.

On this page