Add steps to update testnet2 deployments (#38)

Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8)

Added steps to update deployments:
- stage2 laconicd
- laconic-console-testnet2
- laconic-shopify
- fixturenet-eth
- Nitro bridge
- Nitro nodes
- Snowball backend
- Snowball frontend

Co-authored-by: Adw8 <adwaitgharpure@gmail.com>
Reviewed-on: cerc-io/testnet-laconicd-stack#38
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2024-10-30 13:59:56 +00:00
committed by nabarun
co-authored by Adw8
parent c1af2f6cc7
commit 0d8628d7c3
9 changed files with 208 additions and 14 deletions
+6 -4
View File
@@ -862,7 +862,7 @@
<details open>
<summary>Shopify</summary>
## Shopify
## Laconic Shopify
* Stack: <https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/laconic-shopify>
@@ -1272,6 +1272,8 @@
Follow deployment logs on the deployer UI
* On a successful deployment, the frontend can be viewed at <https://deploy.apps.vaasl.io>
</details>
<details open>
@@ -1621,9 +1623,9 @@
* Create a new `hosts.ini` file:
```bash
cp ../hosts.example.ini hosts.ini
```
```bash
cp ../hosts.example.ini hosts.ini
```
* Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
+1 -1
View File
@@ -20,7 +20,7 @@
laconic-so deployment --dir $STAGE1_DEPLOYMENT logs laconicd -f --tail 30
# Note: stage1 node on deployments VM has been changed to run from /srv/laconicd/testnet-laconicd-deployment instead of /srv/laconicd/stage1-deployment
# Note: stage1 node on deployments VM has been changed to run from /srv/laconicd/testnet-laconicd-deployment instead of /srv/laconicd/stage1-deployment
```
* Stop the stage1 deployment:
+165
View File
@@ -254,3 +254,168 @@ Instructions to reset / update the deployments
```
* The laconic console can now be viewed at <https://loro-console.laconic.com>
---
## stage2 laconicd
* Deployment dir: `/srv/laconicd/stage2-deployment`
* If code has changed, fetch and build with updated source code:
```bash
# laconicd source
cd ~/cerc/laconicd
# Pull latest changes, or checkout to the required branch
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
```
* Optionally, reset the data directory:
```bash
# Stop the deployment
laconic-so deployment --dir stage2-deployment stop --delete-volumes
# Remove and recreate the required data dirs
sudo rm -rf stage2-deployment/data/laconicd-data stage2-deployment/data/genesis-config
mkdir stage2-deployment/data/laconicd-data
mkdir stage2-deployment/data/genesis-config
```
* Follow [stage1-to-stage2.md](./stage1-to-stage2.md) to reinitialize stage2 and start the deployment
## laconic-console-testnet2
* Deployment dir: `/srv/console/laconic-console-testnet2-deployment`
* Steps to update the deployment similar as in [laconic-console](#laconic-console)
## Laconic Shopify
* Deployment dir: `/srv/shopify/laconic-shopify-deployment`
* If code has changed, fetch and build with updated source code:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify setup-repositories --git-ssh --pull
# rebuild containers
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify build-containers --force-rebuild
```
* Update the configuration if required in `laconic-shopify-deployment/config.env`
* Restart the deployment:
```bash
cd /srv/shopify
laconic-so deployment --dir laconic-shopify-deployment stop
laconic-so deployment --dir laconic-shopify-deployment start
```
## Fixturenet Eth
* Deployment dir: `/srv/fixturenet-eth/fixturenet-eth-deployment`
* If code has changed, fetch and build with updated source code:
```bash
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth setup-repositories --git-ssh --pull
# Rebuild the containers
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth build-containers --force-rebuild
```
* Update the configuration if required in `fixturenet-eth-deployment/config.env`:
```bash
CERC_ALLOW_UNPROTECTED_TXS=true
```
* Restart the deployment:
```bash
cd /srv/fixturenet-eth
laconic-so deployment --dir fixturenet-eth-deployment stop
laconic-so deployment --dir fixturenet-eth-deployment start
```
## Nitro Bridge
* Deployment dir: `/srv/bridge/bridge-deployment`
* Rebuild containers:
```bash
# Rebuild the containers
laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild
```
* Update the configuration if required in `bridge-deployment/config.env`
* Restart the bridge deployment:
```bash
cd /srv/bridge
laconic-so deployment --dir bridge-deployment stop
laconic-so deployment --dir bridge-deployment start
```
## Backend Deployment
* Deployment dir: `/srv/deploy-backend/backend-deployment`
* If code has changed, fetch and build with updated source code:
```bash
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend setup-repositories --git-ssh --pull
# rebuild containers
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend build-containers --force-rebuild
```
* Push updated images to the container registry:
```bash
cd /srv/deploy-backend
# login to container registry
CONTAINER_REGISTRY_URL=container-registry.apps.vaasl.io
CONTAINER_REGISTRY_USERNAME=
CONTAINER_REGISTRY_PASSWORD=
docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD
# Push backend images
laconic-so deployment --dir backend-deployment push-images
```
* Update the configuration if required in `backend-deployment/configmaps/config/prod.toml`
* Restart the deployment:
```bash
laconic-so deployment --dir backend-deployment stop
laconic-so deployment --dir backend-deployment start
```
## Frontend Deployment
* Follow steps from [deployments-from-scratch.md](./deployments-from-scratch.md#deploy-frontend) to deploy the snowball frontend