From 6c7e232bb1d19bc690e6553f149c125687f97868 Mon Sep 17 00:00:00 2001 From: David Boreham Date: Thu, 20 Jun 2024 20:30:34 +0000 Subject: [PATCH] Add some stack usage doc --- README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 382379e..06d1a14 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,57 @@ # snowballtools-base-api-stack -Stack definition for the snowball api service. \ No newline at end of file +Stack definition for the snowball api service. + +## Running this stack locally + +(Assumes stack-orchestrator and docker are already installed) + +### Fetch the stack repo + +``` +$ laconic-so fetch-stack git.vdb.to/cerc-io/snowballtools-base-api-stack +``` + +### Clone project repositories + +``` +$ laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend setup-repositories --git-ssh --pull +``` + +### Build service container + +(Might take 10 minutes) + +``` +$ laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend build-containers +``` + +### Create a deployment + +A deployment is a collection of all the stuff needed to run a single instance of a stack, in this case the snowball api service. + +Initialize: + +``` +$ laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend deploy init --output local-deployment-spec.yml --config SNOWBALL_BACKEND_CONFIG_FILE_PATH=/config/local.toml +``` +Then create: +``` +$ laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend deploy create --deployment-dir local-deployment --spec-file local-deployment-spec.yml +``` +Next create a file at `local-deployment/data/config/local.toml` with this content: +``` + +``` +Finally start the service: +``` +$ laconic-so deployment --dir local-deployment start +``` +To check logs: +``` +$ laconic-so deployment --dir local-deployment logs +``` +To stop the service: +``` +$ laconic-so deployment --dir local-deployment stop +```