From 0d8628d7c3d12c773da6715048bbe064e469e674 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 13:59:56 +0000 Subject: [PATCH] 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 Reviewed-on: https://git.vdb.to/cerc-io/testnet-laconicd-stack/pulls/38 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- README.md | 8 +- ops/deployments-from-scratch.md | 10 +- ops/stage1-to-stage2.md | 2 +- ops/update-deployments.md | 165 ++++++++++++++++++ service-provider.md | 3 + .../stacks/laconic-console/stack.yml | 4 +- .../stacks/laconic-shopify/stack.yml | 4 +- .../stacks/testnet-laconicd/stack.yml | 2 +- testnet-nitro-node.md | 24 +++ 9 files changed, 208 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e89f7eb..ca9b1c9 100644 --- a/README.md +++ b/README.md @@ -22,10 +22,10 @@ Follow steps in [testnet-onboarding-validator.md](./testnet-onboarding-validator Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgrade-to-sapo-testnet) for upgrading your LORO testnet node to SAPO testnet -## Run testnet Nitro Node - -Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet - ## Setup a Service Provider Follow steps in [service-provider.md](./service-provider.md) to setup / update your service provider + +## Run testnet Nitro Node + +Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run your Nitro node for the testnet diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md index e4b821d..4d71ea4 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -862,7 +862,7 @@
Shopify -## Shopify +## Laconic Shopify * Stack: @@ -1272,6 +1272,8 @@ Follow deployment logs on the deployer UI +* On a successful deployment, the frontend can be viewed at +
@@ -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: 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 3bfd3b1..4db6067 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -254,3 +254,168 @@ 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 + +* 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 diff --git a/service-provider.md b/service-provider.md index b04bbbf..eb367de 100644 --- a/service-provider.md +++ b/service-provider.md @@ -17,6 +17,9 @@ Follow the steps below to point your deployer to the SAPO testnet ## Update service provider for SAPO testnet +* On a successful webapp-deployer setup with SAPO testnet, your deployer will be available on +* For creating a project, users can create a deployment auction which your deployer will bid on or they can perform a targeted deployment using your deployer LRN + ### Prerequisites * A SAPO testnet node (see [Join SAPO testnet](./README.md#join-sapo-testnet)) diff --git a/stack-orchestrator/stacks/laconic-console/stack.yml b/stack-orchestrator/stacks/laconic-console/stack.yml index 0e657df..ec4bfbe 100644 --- a/stack-orchestrator/stacks/laconic-console/stack.yml +++ b/stack-orchestrator/stacks/laconic-console/stack.yml @@ -2,8 +2,8 @@ version: "1.0" name: laconic-console description: "Laconic registry CLI and console" repos: - - git.vdb.to/cerc-io/laconic-registry-cli - - git.vdb.to/cerc-io/laconic-console + - git.vdb.to/cerc-io/laconic-registry-cli@v0.2.10 + - git.vdb.to/cerc-io/laconic-console@v0.2.5 containers: - cerc/laconic-registry-cli - cerc/webapp-base diff --git a/stack-orchestrator/stacks/laconic-shopify/stack.yml b/stack-orchestrator/stacks/laconic-shopify/stack.yml index 761caed..ba3169c 100644 --- a/stack-orchestrator/stacks/laconic-shopify/stack.yml +++ b/stack-orchestrator/stacks/laconic-shopify/stack.yml @@ -2,8 +2,8 @@ version: "1.0" name: laconic-shopify description: "Service that integrates a Shopify app with the Laconic wallet." repos: - - git.vdb.to/cerc-io/shopify - - git.vdb.to/cerc-io/laconic-faucet@shopify + - git.vdb.to/cerc-io/shopify@v0.1.0 + - git.vdb.to/cerc-io/laconic-faucet@v0.1.0-shopify containers: - cerc/laconic-shopify - cerc/laconic-shopify-faucet diff --git a/stack-orchestrator/stacks/testnet-laconicd/stack.yml b/stack-orchestrator/stacks/testnet-laconicd/stack.yml index 7132e7f..0ba48d5 100644 --- a/stack-orchestrator/stacks/testnet-laconicd/stack.yml +++ b/stack-orchestrator/stacks/testnet-laconicd/stack.yml @@ -2,7 +2,7 @@ version: "1.0" name: testnet-laconicd description: "Laconicd full node" repos: - - git.vdb.to/cerc-io/laconicd + - git.vdb.to/cerc-io/laconicd@v0.1.9 containers: - cerc/laconicd pods: diff --git a/testnet-nitro-node.md b/testnet-nitro-node.md index 282d4b7..bd82fcc 100644 --- a/testnet-nitro-node.md +++ b/testnet-nitro-node.md @@ -851,6 +851,30 @@ Perform swaps using a swap channel created with another Nitro node over the mirr # ] ``` +## Update nitro nodes + +* Switch to deployments dir: + + ```bash + cd $DEPLOYMENTS_DIR/nitro-node + ``` + +* Rebuild containers: + + ```bash + laconic-so --stack ~/cerc/nitro-stack/stack-orchestrator/stacks/nitro-node build-containers --force-rebuild + ``` + +* Restart the nodes + + ```bash + 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: