From 52418d61137407d762a164dd358d7a8fb010708b Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 30 Oct 2024 13:21:26 +0530 Subject: [PATCH] Add steps to update snowball and nitro node deployments --- ops/update-deployments.md | 60 ++++++++++++++++++++++++++++++--------- testnet-nitro-node.md | 22 ++++++++++++++ 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/ops/update-deployments.md b/ops/update-deployments.md index 3516a5a..b47bfc9 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -264,21 +264,13 @@ Instructions to reset / update the deployments * If code has changed, fetch and build with updated source code: ```bash - cd ~/cerc/fixturenet-eth-stacks - - # Pull latest changes, or checkout to the required branch - git pull - - # Confirm the latest commit hash - git log + laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth setup-repositories --git-ssh --pull # Rebuild the containers - cd /srv/fixturenet-eth - 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 @@ -287,6 +279,8 @@ Instructions to reset / update the deployments * Restart the deployment: ```bash + cd /srv/fixturenet-eth + laconic-so deployment --dir fixturenet-eth-deployment stop laconic-so deployment --dir fixturenet-eth-deployment start @@ -302,14 +296,14 @@ Instructions to reset / update the deployments ```bash # Rebuild the containers - cd /srv/bridge - laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/bridge build-containers --force-rebuild ``` * Restart the bridge deployment ```bash + cd /srv/bridge + laconic-so deployment --dir bridge-deployment stop laconic-so deployment --dir bridge-deployment start @@ -317,19 +311,21 @@ Instructions to reset / update the deployments ## Laconic Shopify -* Stack: +* 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 --pull --git-ssh --pull + 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 @@ -339,3 +335,39 @@ Instructions to reset / update the deployments laconic-so deployment --dir laconic-shopify-deployment start ``` + +## Backend Deployment + +* Stack: + +* Target 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 + laconic-so deployment --dir backend-deployment push-images + ``` + +* Update `backend-deployment/configmaps/config/prod.toml` if required + +* 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 diff --git a/testnet-nitro-node.md b/testnet-nitro-node.md index 05af47d..4069bbe 100644 --- a/testnet-nitro-node.md +++ b/testnet-nitro-node.md @@ -728,6 +728,28 @@ 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 + +* Rebuild containers + + ```bash + laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild + ``` + +* Restart the nodes + + ```bash + cd + + laconic-so deployment --dir l1-nitro-deployment stop + laconic-so deployment --dir l1-nitro-deployment start + + laconic-so deployment --dir l2-nitro-deployment stop + laconic-so deployment --dir l2-nitro-deployment start + ``` + ## Clean up * Switch to deployments dir: