From b3ec441b34b0b7332cd7be0555b7dbda9c96bc64 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 30 Oct 2024 13:02:52 +0530 Subject: [PATCH 1/5] Add steps to update fixturenet-eth, nitro-bridge and laconic-shopify deployments --- ops/update-deployments.md | 85 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/ops/update-deployments.md b/ops/update-deployments.md index 3bfd3b1..3516a5a 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -254,3 +254,88 @@ Instructions to reset / update the deployments ``` * The laconic console can now be viewed at + +## Fixturenet Eth + +* Stack: + +* Target dir: `/srv/fixturenet-eth/fixturenet-eth-deployment` + +* 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 + + # 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` + + ```bash + CERC_ALLOW_UNPROTECTED_TXS=true + ``` + +* Restart the deployment: + + ```bash + laconic-so deployment --dir fixturenet-eth-deployment stop + + laconic-so deployment --dir fixturenet-eth-deployment start + ``` + +## Nitro Bridge + +* Stack: + +* Target dir: `/srv/bridge/bridge-deployment` + +* Rebuild containers: + + ```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 + laconic-so deployment --dir bridge-deployment stop + + 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 --pull --git-ssh --pull + + # rebuild containers + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify build-containers --force-rebuild + ``` + +* Restart the deployment + + ```bash + cd /srv/shopify + + laconic-so deployment --dir laconic-shopify-deployment stop + + laconic-so deployment --dir laconic-shopify-deployment start + ``` -- 2.45.2 From eed7b782fd9c2e4b88b8df1f5aa4dd907adf43c0 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 30 Oct 2024 13:21:26 +0530 Subject: [PATCH 2/5] 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 282d4b7..7f7044d 100644 --- a/testnet-nitro-node.md +++ b/testnet-nitro-node.md @@ -851,6 +851,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: -- 2.45.2 From 9d2203d1225047f513ae3b9ce04b5328f52a11a7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 15:20:43 +0530 Subject: [PATCH 3/5] 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 -- 2.45.2 From 68983b2e0d25cee849ff646c45b8a0ac829752f5 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 18:47:38 +0530 Subject: [PATCH 4/5] Pin repo versions in stacks --- stack-orchestrator/stacks/laconic-console/stack.yml | 4 ++-- stack-orchestrator/stacks/laconic-shopify/stack.yml | 4 ++-- stack-orchestrator/stacks/testnet-laconicd/stack.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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: -- 2.45.2 From 819ef565851d27b7fa9368c843eb9a067989de1b Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 30 Oct 2024 19:27:52 +0530 Subject: [PATCH 5/5] Update root readme --- README.md | 8 ++++---- ops/deployments-from-scratch.md | 2 ++ service-provider.md | 3 +++ 3 files changed, 9 insertions(+), 4 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 9ce5049..4d71ea4 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -1272,6 +1272,8 @@ Follow deployment logs on the deployer UI +* On a successful deployment, the frontend can be viewed at +
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)) -- 2.45.2