Add instructions for deployment ops #19

Merged
ashwin merged 13 commits from pm-add-ops into main 2024-08-09 10:18:12 +00:00
2 changed files with 132 additions and 60 deletions
Showing only changes of commit b89c5bbc3f - Show all commits

View File

@ -21,7 +21,7 @@
* Target dir: `/srv/laconicd/stage0-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/laconicd
@ -146,7 +146,7 @@
* Target dir: `/srv/app/onboarding-app-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/app
@ -260,7 +260,7 @@
* Target dir: `/srv/wallet/laconic-wallet-web-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/wallet
@ -359,7 +359,7 @@
* Target dir: `/srv/laconicd/stage1-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/laconicd
@ -437,7 +437,7 @@
* Target dir: `/srv/faucet/laconic-faucet-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/faucet
@ -561,7 +561,7 @@
* Target dir: `/srv/console/laconic-console-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment if required:
```bash
cd /srv/console

72
ops/update-deployments.md Normal file
View File

@ -0,0 +1,72 @@
# update-deployments
Instructions to reset / update the deployments
## Login
* Log in as `dev` user on the deployments VM
* All the deployments are placed in the `/srv` directory:
```bash
cd /srv
```
## stage0 laconicd
* Deployment dir: `/srv/laconicd/stage0-deployment`
* Fetch and build with updated source code:
```bash
# laconicd source
cd ~/cerc/laconicd
# Pull latest changes
git pull
# Confirm the latest commit hash
git log
# Rebuild the containers
cd /srv/laconicd
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild
```
* Reset the data directory:
```bash
# Stop the deployment
laconic-so deployment --dir stage0-deployment stop --delete-volumes
# Remove and recreate the required data dir
sudo rm -rf stage0-deployment/data/laconicd-data
mkdir stage0-deployment/data/laconicd-data
```
* Restart the deployment:
```bash
laconic-so deployment --dir stage0-deployment start
# Follow logs for laconicd container, check that new blocks are getting created
laconic-so deployment --dir stage0-deployment logs laconicd -f
```
* Since the stage0 laconicd chain has been reset, reset the faucet deployment with new faucet key:
```bash
cd /srv/faucet
export FAUCET_ACCOUNT_PK=$(laconic-so deployment --dir /srv/laconicd/stage0-deployment exec laconicd "echo y | laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe")
cat <<EOF > laconic-faucet-deployment/config.env
CERC_FAUCET_KEY=$FAUCET_ACCOUNT_PK
EOF
# Restart the deployment
laconic-so deployment --dir laconic-faucet-deployment stop
laconic-so deployment --dir laconic-faucet-deployment start
```