diff --git a/README.md b/README.md index ca9b1c9..0f90c98 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ Follow steps in [Upgrade to SAPO testnet](./testnet-onboarding-validator.md#upgr Follow steps in [service-provider.md](./service-provider.md) to setup / update your service provider +### Support Custom Domains + +Follow steps to [Update service provider for custom domains](./service-provider.md#update-service-provider-for-custom-domains) + ## 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/update-deployments.md b/ops/update-deployments.md index 220a7ae..31768b4 100644 --- a/ops/update-deployments.md +++ b/ops/update-deployments.md @@ -351,17 +351,18 @@ Instructions to reset / update the deployments laconic-so deployment --dir webapp-deployer start ``` -- Load context for k8s +* Load context for k8s + ```bash kubie ctx vs-narwhal ``` -- Copy the GPG key file to the webapp-deployer container +* Copy the GPG key file to the webapp-deployer container ```bash # 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 @@ -394,7 +395,7 @@ Instructions to reset / update the deployments laconic-so build-webapp --source-repo ~/cerc/webapp-deployment-status-ui ``` -- Modify `/srv/service-provider/webapp-ui/config.env` like [this Pull Request](https://git.vdb.to/cerc-io/webapp-deployment-status-ui/pulls/6) but with your host details. +* Modify `/srv/service-provider/webapp-ui/config.env` like [this Pull Request](https://git.vdb.to/cerc-io/webapp-deployment-status-ui/pulls/6) but with your host details. * Restart the deployment: @@ -406,7 +407,7 @@ Instructions to reset / update the deployments ## Deploy Backend -* Deployment dir: `/srv/deploy-backend/backend-deployment` +* Deployment dir: `/srv/deploy-backend/laconic-backend-deployment` * If code has changed, fetch and build with updated source code: @@ -430,22 +431,23 @@ Instructions to reset / update the deployments docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD # Push backend images - laconic-so deployment --dir backend-deployment push-images + laconic-so deployment --dir laconic-backend-deployment push-images ``` -* Update the configuration if required in `backend-deployment/configmaps/config/prod.toml` +* Update the configuration if required in `laconic-backend-deployment/configmaps/config/prod.toml` * Restart the deployment: ```bash - laconic-so deployment --dir backend-deployment stop + laconic-so deployment --dir laconic-backend-deployment stop - laconic-so deployment --dir backend-deployment start + laconic-so deployment --dir laconic-backend-deployment start ``` ## Deply Frontend -* Follow steps from [deployments-from-scratch.md](./deployments-from-scratch.md#deploy-frontend) to deploy the snowball frontend +* Follow steps similar to [deployments-from-scratch.md](./deployments-from-scratch.md#deploy-frontend) to deploy the snowball frontend + * Use auhority `laconic-deploy` and the script `deploy-frontend.sh` instead ## Fixturenet Eth diff --git a/service-provider.md b/service-provider.md index 33c9cf7..d2bca50 100644 --- a/service-provider.md +++ b/service-provider.md @@ -398,3 +398,113 @@ Follow the steps below to point your deployer to the SAPO testnet ```bash laconic-so deployment --dir webapp-ui logs webapp ``` + +## Update service provider for custom domains + +### Stop webapp deployer + +```bash +# In directory where webapp-deployer deployment was created +laconic-so deployment --dir webapp-deployer stop +``` + +### Update webapp deployer setup + +* Fetch latest stack repos: + + ```bash + # In directory where webapp-deployer deployment was created + laconic-so --stack webapp-deployer-backend setup-repositories --pull + + # Confirm latest commit hash in the ~/cerc/webapp-deployment-status-api repo + ``` + +* Rebuild container images: + + ```bash + laconic-so --stack webapp-deployer-backend build-containers --force-rebuild + ``` + +* Push stack images to the container registry: + + * Login to the container registry: + + ```bash + # Set required variables + # eg: container-registry.pwa.laconic.com + CONTAINER_REGISTRY_URL= + CONTAINER_REGISTRY_USERNAME= + CONTAINER_REGISTRY_PASSWORD= + + # login to container registry + docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD + + # WARNING! Using --password via the CLI is insecure. Use --password-stdin. + # WARNING! Your password will be stored unencrypted in /home/dev2/.docker/config.json. + # Configure a credential helper to remove this warning. See + # https://docs.docker.com/engine/reference/commandline/login/#credential-stores + + # Login Succeeded + ``` + + * Push images: + + ```bash + laconic-so deployment --dir webapp-deployer push-images + ``` + +* Update deployer config (`webapp-deployer/config.env`): + + ```bash + # Update FQDN policy to "allow" for allowing custom domains + FQDN_POLICY="allow" + + # Set IP of your k8s cluster (IP set in DNS records for users) + DEPLOYMENT_IP="a.b.c.d" + ``` + +### Start webapp deployer + +* Start the webapp deployer: + + ```bash + laconic-so deployment --dir webapp-deployer start + ``` + +* Get the webapp-deployer pod id: + + ```bash + 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 over GPG keys files to the webapp-deployer container: + + ```bash + kubie ctx default + + # Copy the GPG key files to the pod + kubectl cp $POD_ID:/app + kubectl cp $POD_ID:/app + + # Required every time you stop and start the deployer + ``` + +* Check logs: + + ```bash + # Deployer + kubectl logs -f $POD_ID + + # Deployer auction handler + kubectl logs -f $POD_ID -c cerc-webapp-auction-handler + ```