Remove redundant steps

This commit is contained in:
Adw8 2024-10-29 18:36:17 +05:30
parent fbc3ab1ecb
commit 4efed42e10

View File

@ -36,7 +36,7 @@ Follow steps from <https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/servic
* Push images to the container registry
* login to the container registry
* Login to the container registry
```bash
# Set required variables
@ -111,7 +111,7 @@ Follow steps from <https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/servic
--min-required-payment 0
```
* Update the webapp deployer config
* Update `webapp-deployer/config.env`
```bash
# Update the webapp deployer lrn if it has changed
@ -128,19 +128,36 @@ Follow steps from <https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/servic
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 the GPG key file to the webapp-deployer container
```bash
# Get the webapp-deployer pod id
kubectl get pods --sort-by=.metadata.creationTimestamp -o jsonpath='{.items[-1].metadata.name}'
# laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
kubectl cp <path-to-your-gpg-public-key> laconic-ac473c31db9ac9fd-deployment-674bf7bf9f-529bs:/app
kubectl cp <path-to-your-gpg-private-key> $POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> $POD_ID:/app
```
* Update the webapp ui config
* Check logs
```bash
laconic-so deployment --dir webapp-deployer logs cerc-webapp-deployer
```
* Update `webapp-ui/config.env`
```bash
# URL of the webapp deployer backend
@ -155,6 +172,12 @@ Follow steps from <https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/servic
laconic-so deployment --dir webapp-ui start
```
* Check logs
```bash
laconic-so deployment --dir webapp-ui logs webapp -f
```
## Connect webapp-deployer to testnet2
Follow the steps given below to connect the webapp-deployer to testnet2
@ -196,7 +219,7 @@ Follow the steps given below to connect the webapp-deployer to testnet2
CERC_LACONICD_GQL_ENDPOINT=
# laconicd chain id
CERC_LACONICD_CHAIN_ID=laconic_9000-2
CERC_LACONICD_CHAIN_ID=laconic-testnet-2
# Endpoint for the console
# eg: https://laconic-console.example.com
@ -239,7 +262,7 @@ Follow the steps given below to connect the webapp-deployer to testnet2
* Commit a bid using the auction ID. A reveal file will be generated
```bash
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic_9000-2"
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic-testnet-2"
# {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"}
```
@ -247,7 +270,7 @@ Follow the steps given below to connect the webapp-deployer to testnet2
* Reveal a bid using the auction ID and the reveal file generated from the bid commit
```bash
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic_9000-2"
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic-testnet-2"
# {"success": true}
```
@ -297,63 +320,7 @@ Follow the steps given below to connect the webapp-deployer to testnet2
### Publish record for webapp-deployer
* Update `webapp-deployer/data/config/laconic.yml` with the
```bash
services:
registry:
# laconicd RPC endpoint
rpcEndpoint:
# laconicd GQL endpoint
gqlEndpoint:
# Key to your funded account
userKey:
# bondId that you just created
bondId: a742489e5817ef274187611dadb0e4284a49c087608b545ab6bd990905fb61f3
# laconicd chain id
chainId: laconic_9000-2
gasPrice: 0.001alnt
```
* Publish the webapp deployer record on the chain
* Set the following variables
```bash
# Path to the webapp-deployer directory, e.g., /home/dev..
DEPLOYER_DIR=
# API URL of the webapp-deployer
API_URL=
# LRN (logical resource name) of the webapp-deployer
DEPLOYER_LRN=
# Name of the GPG public key file
GPG_PUB_KEY_FILE=
# Path of the GPG public key file
GPG_PUB_KEY_FILE_PATH=
```
* Copy the GPG pub key file used while setting up the webapp-deployer to the `webapp-deployer/data/config` directory. This ensures the Docker container has access to the key during the publish process.
```bash
cp $GPG_PUB_KEY_FILE_PATH webapp-deployer/data/config
```
* Publish the deployer record
```bash
docker run -i -t \
-v $DEPLOYER_DIR/data/config:/home/root/config \
cerc/webapp-deployer-backend:local laconic-so publish-deployer-to-registry \
--laconic-config /home/root/config/laconic.yml \
--api-url $API_URL \
--public-key-file /home/root/config/$GPG_PUB_KEY_FILE \
--lrn $DEPLOYER_LRN \
--min-required-payment 0
```
Follow steps from [Update webapp deployer](#update-webapp-deployer) to publish the deployer record to the chain
<details open>
<summary>Update config for webapp deployer</summary>
@ -407,8 +374,8 @@ Follow the steps given below to connect the webapp-deployer to testnet2
```bash
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> POD_ID:/app
kubectl cp <path-to-your-gpg-private-key> $POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> $POD_ID:/app
````
* Check logs