From 9d2203d1225047f513ae3b9ce04b5328f52a11a7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 15:20:43 +0530 Subject: [PATCH] Add steps to update stage2 laconicd and console deployments --- ops/deployments-from-scratch.md | 8 +- ops/stage1-to-stage2.md | 2 +- ops/update-deployments.md | 132 ++++++++++++++++++++++---------- testnet-nitro-node.md | 10 ++- 4 files changed, 101 insertions(+), 51 deletions(-) diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md index e4b821d..9ce5049 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -862,7 +862,7 @@
Shopify -## Shopify +## Laconic Shopify * Stack: @@ -1621,9 +1621,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: diff --git a/ops/stage1-to-stage2.md b/ops/stage1-to-stage2.md index d3453a7..1b8d20a 100644 --- a/ops/stage1-to-stage2.md +++ b/ops/stage1-to-stage2.md @@ -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: diff --git a/ops/update-deployments.md b/ops/update-deployments.md index b47bfc9..4db6067 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -255,11 +255,79 @@ Instructions to reset / update the deployments * The laconic console can now be viewed at +--- + +## 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 -* Stack: - -* Target dir: `/srv/fixturenet-eth/fixturenet-eth-deployment` +* Deployment dir: `/srv/fixturenet-eth/fixturenet-eth-deployment` * If code has changed, fetch and build with updated source code: @@ -270,7 +338,7 @@ Instructions to reset / update the deployments 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` +* Update the configuration if required in `fixturenet-eth-deployment/config.env`: ```bash CERC_ALLOW_UNPROTECTED_TXS=true @@ -288,9 +356,7 @@ Instructions to reset / update the deployments ## Nitro Bridge -* Stack: - -* Target dir: `/srv/bridge/bridge-deployment` +* Deployment dir: `/srv/bridge/bridge-deployment` * Rebuild containers: @@ -299,7 +365,9 @@ Instructions to reset / update the deployments laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild ``` -* Restart the bridge deployment +* Update the configuration if required in `bridge-deployment/config.env` + +* Restart the bridge deployment: ```bash cd /srv/bridge @@ -309,38 +377,9 @@ Instructions to reset / update the deployments laconic-so deployment --dir bridge-deployment start ``` -## Laconic Shopify - -* Stack: - -* Target 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 `laconic-shopify-deployment/config.env` if required - -* Restart the deployment - - ```bash - cd /srv/shopify - - laconic-so deployment --dir laconic-shopify-deployment stop - - laconic-so deployment --dir laconic-shopify-deployment start - ``` - ## Backend Deployment -* Stack: - -* Target dir: `/srv/deploy-backend/backend-deployment` +* Deployment dir: `/srv/deploy-backend/backend-deployment` * If code has changed, fetch and build with updated source code: @@ -351,16 +390,25 @@ Instructions to reset / update the deployments 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 +* 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 `backend-deployment/configmaps/config/prod.toml` if required +* Update the configuration if required in `backend-deployment/configmaps/config/prod.toml` -* Restart the deployment +* Restart the deployment: ```bash laconic-so deployment --dir backend-deployment stop @@ -370,4 +418,4 @@ Instructions to reset / update the deployments ## Frontend Deployment -Follow steps from [deployments-from-scratch.md](./deployments-from-scratch.md#deploy-frontend) to deploy the snowball frontend +* Follow steps from [deployments-from-scratch.md](./deployments-from-scratch.md#deploy-frontend) to deploy the snowball frontend diff --git a/testnet-nitro-node.md b/testnet-nitro-node.md index 7f7044d..bd82fcc 100644 --- a/testnet-nitro-node.md +++ b/testnet-nitro-node.md @@ -853,9 +853,13 @@ Perform swaps using a swap channel created with another Nitro node over the mirr ## Update nitro nodes -Run the following commands in the deployment machine +* Switch to deployments dir: -* Rebuild containers + ```bash + cd $DEPLOYMENTS_DIR/nitro-node + ``` + +* Rebuild containers: ```bash laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild @@ -864,8 +868,6 @@ Run the following commands in the deployment machine * Restart the nodes ```bash - cd - laconic-so deployment --dir l1-nitro-deployment stop laconic-so deployment --dir l1-nitro-deployment start