This is the “delete everything and start from scratch” workflow for marvain.
Safety: these steps can delete AWS resources and local state. Read once before running.
- Repo root: you are in the
marvain/directory. - You have an AWS profile/region to use (examples below use
daylily+us-west-2). - You are OK deleting the CloudFormation stack for your chosen
stack_name.
marvain teardowndeletes the CloudFormation stack.- This repo’s SAM template marks both buckets as Retain:
ArtifactBucket(Retain)AuditBucket(Retain + S3 Object Lock, default 10-year governance retention)
So: stack deletion will NOT delete those buckets. If you put objects in the audit bucket, deleting them may be blocked by Object Lock.
You’ll need these if you want to attempt bucket deletion later.
<augment_code_snippet mode="EXCERPT">
. ./marvain_activate
./bin/marvain --profile daylily --region us-west-2 monitor outputs
# optional: also write outputs into your config
./bin/marvain --profile daylily --region us-west-2 monitor outputs --write-config</augment_code_snippet>
Look for ArtifactBucketName and AuditBucketName in the printed JSON.
<augment_code_snippet mode="EXCERPT">
./bin/marvain --profile daylily --region us-west-2 teardown --yes --wait</augment_code_snippet>
- Artifact bucket: typically deletable once empty.
- Audit bucket: may be not deletable if it contains Object-Lock-protected objects.
If you want to try anyway:
<augment_code_snippet mode="EXCERPT">
# Replace BUCKET with ArtifactBucketName or AuditBucketName from step 1.1
aws s3 rb "s3://BUCKET" --force</augment_code_snippet>
If AuditBucket deletion fails due to Object Lock retention, the “from scratch” approach is:
- leave the audit bucket alone, and/or
- deploy a new stack name (fresh resources) instead of trying to hard-delete locked audit history.
Config default path:
${XDG_CONFIG_HOME:-~/.config}/marvain/marvain-config.yaml
If you want to keep a copy of the token/config, back it up first.
<augment_code_snippet mode="EXCERPT">
# OPTIONAL backup
cp -v "${XDG_CONFIG_HOME:-$HOME/.config}/marvain/marvain-config.yaml" \
"${XDG_CONFIG_HOME:-$HOME/.config}/marvain/marvain-config.yaml.bak" 2>/dev/null || true
# Delete config (canonical + legacy)
rm -f "${XDG_CONFIG_HOME:-$HOME/.config}/marvain/marvain-config.yaml" \
"${XDG_CONFIG_HOME:-$HOME/.config}/marvain/marvain.yaml" \
"${XDG_CONFIG_HOME:-$HOME/.config}/marvain/config.yaml" \
"$HOME/.marvain/config.yaml"</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
rm -rf .aws-sam .aws-*</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
conda env remove -n marvain</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
conda env create -f config/marvain_conda.yaml
. ./marvain_activate</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
./bin/marvain --profile daylily --region us-west-2 doctor</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
# Create a fresh config
./bin/marvain config init --profile daylily --region us-west-2 --env dev
# Build + deploy (guided by default)
./bin/marvain build
./bin/marvain deploy
# Record outputs into config for convenience
./bin/marvain monitor outputs --write-config
# Initialize DB schema, then bootstrap your first device
./bin/marvain init db
./bin/marvain bootstrap --agent-name Forge --space-name home
# Tailing logs + open GUI
./bin/marvain logs --since 10m
# Print the deployed GUI URL (HubRestApiBase)
./bin/marvain gui</augment_code_snippet>
<augment_code_snippet mode="EXCERPT">
./bin/marvain --profile daylily --region us-west-2 teardown --yes --wait</augment_code_snippet>