Skip to content

Commit bff0997

Browse files
authored
Update CI, docker base, and healthcheck (#48)
Problem ======= Needed to update the base docker base and make sure the health check was correct for loading the schemas instead of just that the rpc was available. Solution ======== - Updated GitHub Action versions - Updated health check to verify the existence of schema id 11 - Updated the docker base to use the newer `frequencychain/standalone-node` Closes #47
1 parent 83b979b commit bff0997

File tree

6 files changed

+19
-26
lines changed

6 files changed

+19
-26
lines changed

.github/workflows/docker-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
runs-on: ubuntu-22.04
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212

1313
- name: Set up Docker Buildx
14-
uses: docker/setup-buildx-action@v2
14+
uses: docker/setup-buildx-action@v3
1515

1616
- name: Login to DockerHub
17-
uses: docker/login-action@v2
17+
uses: docker/login-action@v3
1818
with:
1919
username: ${{ secrets.DOCKERHUB_USERNAME }}
2020
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -25,7 +25,7 @@ jobs:
2525
2626
- name: Build and push dsnp/instant-seal-node-with-deployed-schemas
2727
id: docker_build_instant_seal_node_with_deployed_schemas
28-
uses: docker/build-push-action@v3
28+
uses: docker/build-push-action@v5
2929
with:
3030
push: true
3131
file: Dockerfile

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
runs-on: ubuntu-22.04
1010
steps:
1111
- name: Checkout
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313

1414
- name: Use Node.js
15-
uses: actions/setup-node@v3
15+
uses: actions/setup-node@v4
1616
with:
1717
node-version: 18
1818
registry-url: 'https://registry.npmjs.org'

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ jobs:
77
runs-on: ubuntu-22.04
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Use Node.js
13-
uses: actions/setup-node@v3
13+
uses: actions/setup-node@v4
1414
with:
1515
node-version: 18
1616
registry-url: 'https://registry.npmjs.org'

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Docker image for running Frequency parachain node container (with collating)
22
# locally in instant seal mode then deploying schemas to that node.
33

4-
#This pulls the latest instant-seal-node image
5-
FROM frequencychain/instant-seal-node:latest as frequency-image
4+
#This pulls the latest standalone-node image
5+
FROM frequencychain/standalone-node:latest as frequency-image
66

77
#Switch to root to install node on image
88
USER root
@@ -46,7 +46,7 @@ EXPOSE 9944
4646
VOLUME ["/data"]
4747

4848
HEALTHCHECK --start-period=15s \
49-
CMD curl --fail -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods"}' http://localhost:9944/ || exit 1
49+
CMD curl --silent --fail -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "schemas_getBySchemaId", "params": [11]}' http://localhost:9944/ | grep -qv '{"jsonrpc":"2.0","result":null,"id":1}' || exit 1
5050

5151
ENTRYPOINT ["/tini", "--"]
5252

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,18 @@ There are 8 schemas on the connected chain.
152152

153153
## Use with Docker
154154

155-
This repo includes a docker image to push a [Frequency instant-seal-node](https://hub.docker.com/r/frequencychain/instant-seal-node) with the schemas deployed on top of it to docker hub under `dsnp/instant-seal-node-with-deployed-schemas`.
155+
This repo deploys `dsnp/instant-seal-node-with-deployed-schemas` to Docker Hub.
156+
It is based on a [Frequency Standalone Docker](https://hub.docker.com/r/frequencychain/standalone-node) with the schemas automatically deployed on top of it with the image defaults including using "instant sealing" mode.
156157

158+
Note: `--platform=linux/amd64` is because as `frequencychain` images are only published for the `linux/amd64` platform.
157159

158160
### Run Locally
159161
For any local testing do the following:
160-
1. `docker pull dsnp/instant-seal-node-with-deployed-schemas:latest`
161-
2. `docker run docker run --rm -p 9944:9944 dsnp/instant-seal-node-with-deployed-schemas:latest`
162+
1. `docker pull --platform=linux/amd64 dsnp/instant-seal-node-with-deployed-schemas:latest`
163+
2. `docker run --platform=linux/amd64 --rm -p 9944:9944 dsnp/instant-seal-node-with-deployed-schemas:latest`
162164

163165
### Build Locally
164-
1. `docker build -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas:<versionNumberHere> .`
166+
1. `docker build --platform=linux/amd64 -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas:<versionNumberHere> .`
165167

166168
### Pushing Docker Image
167169

scripts/deploy_schemas_to_node.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,8 @@ npm --version
77
ldd --version
88
whoami
99

10-
/frequency/frequency --dev \
11-
-lruntime=debug \
12-
--sealing=instant \
13-
--no-telemetry \
14-
--no-prometheus \
15-
--rpc-port=9944 \
16-
--rpc-external \
17-
--rpc-cors=all \
18-
--rpc-methods=Unsafe \
19-
--base-path=/data \
20-
&
10+
# Base image start script
11+
/frequency/frequency-start.sh &
2112

2213
cd frequency/schemas
2314
npm run deploy

0 commit comments

Comments
 (0)