Use deployment command for azimuth stack
This commit is contained in:
parent
339ea6b628
commit
46cf428b9c
@ -17,4 +17,4 @@
|
|||||||
rpcProviderEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_RPC"
|
rpcProviderEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_RPC"
|
||||||
|
|
||||||
[jobQueue]
|
[jobQueue]
|
||||||
historicalLogsBlockRange = "REPLACE_WITH_CERC_HISTORICAL_BLOCK_RANGE"
|
historicalLogsBlockRange = REPLACE_WITH_CERC_HISTORICAL_BLOCK_RANGE
|
||||||
|
@ -9,11 +9,11 @@ Prerequisite: `ipld-eth-server` RPC and GQL endpoints
|
|||||||
Clone required repositories:
|
Clone required repositories:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack azimuth setup-repositories
|
laconic-so --stack azimuth setup-repositories --pull
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: If the repository already exists and checked out to a different version, `setup-repositories` command will throw an error.
|
NOTE: If the repository already exists and checked out to a different version, `setup-repositories` command will throw an error.
|
||||||
For getting around this, the `azimuth-watcher-ts` repository can be removed and then run the command.
|
For getting around this, the `azimuth-watcher-ts` repository can be removed and then run the command again.
|
||||||
|
|
||||||
Build the container images:
|
Build the container images:
|
||||||
|
|
||||||
@ -23,42 +23,85 @@ laconic-so --stack azimuth build-containers
|
|||||||
|
|
||||||
This should create the required docker images in the local image registry.
|
This should create the required docker images in the local image registry.
|
||||||
|
|
||||||
### Configuration
|
## Create a deployment
|
||||||
|
|
||||||
* Create and update an env file to be used in the next step:
|
First, create a spec file for the deployment, which will map the stack's ports and volumes to the host:
|
||||||
|
```bash
|
||||||
|
laconic-so --stack azimuth deploy init --output azimuth-spec.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Ports
|
||||||
|
|
||||||
|
Edit `network` in spec file to map container ports to same ports in host
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
...
|
||||||
|
network:
|
||||||
|
ports:
|
||||||
|
watcher-db:
|
||||||
|
- 0.0.0.0:15432:5432
|
||||||
|
azimuth-watcher-server:
|
||||||
|
- 0.0.0.0:3001:3001
|
||||||
|
censures-watcher-server:
|
||||||
|
- 0.0.0.0:3002:3002
|
||||||
|
claims-watcher-server:
|
||||||
|
- 0.0.0.0:3003:3003
|
||||||
|
conditional-star-release-watcher-server:
|
||||||
|
- 0.0.0.0:3004:3004
|
||||||
|
delegated-sending-watcher-server:
|
||||||
|
- 0.0.0.0:3005:3005
|
||||||
|
ecliptic-watcher-server:
|
||||||
|
- 0.0.0.0:3006:3006
|
||||||
|
linear-star-release-watcher-server:
|
||||||
|
- 0.0.0.0:3007:3007
|
||||||
|
polls-watcher-server:
|
||||||
|
- 0.0.0.0:3008:3008
|
||||||
|
gateway-server:
|
||||||
|
- 0.0.0.0:4000:4000
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
|
### Data volumes
|
||||||
|
Container data volumes are bind-mounted to specified paths in the host filesystem.
|
||||||
|
The default setup (generated by `laconic-so deploy init`) places the volumes in the `./data` subdirectory of the deployment directory. The default mappings can be customized by editing the "spec" file generated by `laconic-so deploy init`.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Once you've made any needed changes to the spec file, create a deployment from it:
|
||||||
|
```bash
|
||||||
|
laconic-so --stack azimuth deploy create --spec-file azimuth-spec.yml --deployment-dir azimuth-deployment
|
||||||
|
```
|
||||||
|
|
||||||
|
## Set env variables
|
||||||
|
|
||||||
|
Inside the deployment directory, open the file `config.env` and add variable to update RPC endpoint :
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# External ipld-eth-server endpoints
|
# External RPC endpoints
|
||||||
CERC_IPLD_ETH_RPC=
|
CERC_IPLD_ETH_RPC=
|
||||||
CERC_IPLD_ETH_GQL=
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* NOTE: If `ipld-eth-server` is running on the host machine, use `host.docker.internal` as the hostname to access host ports
|
* NOTE: If RPC endpoint is on the host machine, use `host.docker.internal` as the hostname to access the host port, or use the `ip a` command to find the IP address of the `docker0` interface (this will usually be something like `172.17.0.1` or `172.18.0.1`)
|
||||||
|
|
||||||
### Deploy the stack
|
## Start the stack
|
||||||
|
|
||||||
* Deploy the containers:
|
Start the deployment:
|
||||||
|
```bash
|
||||||
```bash
|
laconic-so deployment --dir azimuth-deployment start
|
||||||
laconic-so --stack azimuth deploy-system --env-file <PATH_TO_ENV_FILE> up
|
```
|
||||||
```
|
|
||||||
|
|
||||||
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
* List and check the health status of all the containers using `docker ps` and wait for them to be `healthy`
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
|
|
||||||
Stop all the services running in background:
|
To stop all azimuth services running in the background, while preserving chain data:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack azimuth deploy-system down
|
laconic-so deployment --dir azimuth-deployment stop
|
||||||
```
|
```
|
||||||
|
|
||||||
Clear volumes created by this stack:
|
To stop all azimuth services and also delete data:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# List all relevant volumes
|
laconic-so deployment --dir azimuth-deployment stop --delete-volumes
|
||||||
docker volume ls -q --filter "name=.*watcher_db_data"
|
|
||||||
|
|
||||||
# Remove all the listed volumes
|
|
||||||
docker volume rm $(docker volume ls -q --filter "name=.*watcher_db_data")
|
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user