laconicd-stack/docs/update-deployments.md
2025-06-13 16:11:56 +05:30

6.7 KiB

Update deployments after code changes

Instructions to reset / update the deployments

Login

  • Log in as dev user on the deployments VM

  • All the deployments are placed in the /srv directory:

    cd /srv
    

laconic-wallet-web

  • Deployment dir: /srv/wallet/laconic-wallet-web-deployment

  • If code has changed, fetch and build with updated source code:

    # testnet-onboarding-app source
    cd ~/cerc/laconic-wallet-web
    
    # Pull latest changes, or checkout to the required branch
    git pull
    
    # Confirm the latest commit hash
    git log
    
    # Rebuild the containers
    cd /srv/wallet
    
    laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild
    
  • Update the configuration laconic-wallet-web-deployment/config.env:

    # URL for the deploy app so that wallet can work with it
    CERC_ALLOWED_URLS=
    
    # RPC URL for the mainnet node
    CERC_LACONICD_RPC_URL=
    
  • Restart the deployment:

    laconic-so deployment --dir laconic-wallet-web-deployment stop
    
    laconic-so deployment --dir laconic-wallet-web-deployment start
    
    # Follow logs for laconic-wallet-web container, wait for the build to finish
    laconic-so deployment --dir laconic-wallet-web-deployment logs laconic-wallet-web -f
    
  • The web wallet can now be viewed at https://wallet.laconic.com

  • Add laconic-mainnet network by clicking on Add Network and filling in required details

laconic-console

  • Deployment dir: /srv/console/laconic-console-deployment

  • If code has changed, fetch and build with updated source code:

    # testnet-onboarding-app source
    cd ~/cerc/laconic-console
    
    # Pull latest changes, or checkout to the required branch
    git pull
    
    # Confirm the latest commit hash
    git log
    
    # Rebuild the containers
    cd /srv/console
    
    laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
    
  • Update the configuration, if required in laconic-console-deployment/config.env:

    # Laconicd (hosted) GQL endpoint
    LACONIC_HOSTED_ENDPOINT=
    
  • Restart the deployment:

    laconic-so deployment --dir laconic-console-deployment stop
    
    laconic-so deployment --dir laconic-console-deployment start
    
    # Follow logs for console container
    laconic-so deployment --dir laconic-console-deployment logs console -f
    
  • The laconic console can now be viewed at https://loro-console.laconic.com


Laconic Shopify

  • Deployment dir: /srv/shopify/laconic-shopify-deployment

  • If code has changed, fetch and build with updated source code:

    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:

    cd /srv/shopify
    
    laconic-so deployment --dir laconic-shopify-deployment stop
    
    laconic-so deployment --dir laconic-shopify-deployment start
    

webapp-deployer

Backend

  • Deployment dir: /srv/service-provider/webapp-deployer

  • If code has changed, fetch and build with updated source code:

    laconic-so --stack webapp-deployer-backend setup-repositories --git-ssh --pull
    
    laconic-so --stack webapp-deployer-backend build-containers --force-rebuild
    
  • Update the configuration, if required in :

    • /srv/service-provider/webapp-deployer/data/config/laconic.yml
    • /srv/service-provider/webapp-deployer/config.env
  • Restart the deployment:

    laconic-so deployment --dir webapp-deployer stop
    
    laconic-so deployment --dir webapp-deployer start
    
  • Load context for k8s

    kubie ctx vs-narwhal
    
  • Copy the GPG key file to the webapp-deployer container

    # Get the webapp-deployer pod id
    laconic-so deployment --dir webapp-deployer ps
    
    # Expected output
    # Running containers:
    # id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555
    
    # Set pod id
    export POD_ID=
    # Example:
    # export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6
    
    # Copy GPG key files to the pod
    kubectl cp webapp-deployer/webapp-deployer-api.apps.vaasl.io.pgp.key $POD_ID:/app
    kubectl cp webapp-deployer/webapp-deployer-api.apps.vaasl.io.pgp.pub $POD_ID:/app
    

Frontend

  • Deployment dir: /srv/service-provider/webapp-ui

  • If code has changed, fetch and build with updated source code:

    cd ~/cerc/webapp-deployment-status-ui
    
    # Pull latest changes, or checkout to the required branch
    git pull
    
    # Confirm the latest commit hash
    git log
    
    laconic-so build-webapp --source-repo ~/cerc/webapp-deployment-status-ui
    
  • Modify /srv/service-provider/webapp-ui/config.env like this Pull Request but with your host details.

  • Restart the deployment:

    laconic-so deployment --dir webapp-ui stop
    
    laconic-so deployment --dir webapp-ui start
    

Deploy Backend

  • Deployment dir: /srv/deploy-backend/laconic-backend-deployment

  • If code has changed, fetch and build with updated source code:

    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:

    cd /srv/deploy-backend
    
    # login to container registry
    CONTAINER_REGISTRY_URL=container-registry.apps.vaasl.io
    # For credentials: "cat /srv/service-provider/webapp-deployer/config.env | grep IMAGE_REGISTRY"
    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 laconic-backend-deployment push-images
    
  • Update the configuration if required in laconic-backend-deployment/configmaps/config/prod.toml

  • Restart the deployment:

    laconic-so deployment --dir laconic-backend-deployment stop
    
    laconic-so deployment --dir laconic-backend-deployment start
    

Deply Frontend

  • Follow steps similar to deployments-from-scratch.md to deploy the snowball frontend
    • Use auhority laconic-deploy and the script deploy-frontend.sh instead