From a28d0ffcc4323b11615fcdd887bea7b7df2eefe3 Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Wed, 3 Jan 2024 16:49:28 +0000 Subject: [PATCH 1/4] Update action versions --- .github/workflows/docker-release.yml | 8 ++++---- .github/workflows/main.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index 33cd064..e7d2d6b 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -8,13 +8,13 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -25,7 +25,7 @@ jobs: - name: Build and push dsnp/instant-seal-node-with-deployed-schemas id: docker_build_instant_seal_node_with_deployed_schemas - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: push: true file: Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 922fde4..5cf8d4b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,10 +9,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f48421f..a289d3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 18 registry-url: 'https://registry.npmjs.org' From a20a7acfefbe52301705be84b8a7c054405ecdce Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Wed, 3 Jan 2024 16:49:49 +0000 Subject: [PATCH 2/4] Use frequencychain/standalone-node --- Dockerfile | 4 ++-- README.md | 5 ++++- scripts/deploy_schemas_to_node.sh | 13 ++----------- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5f19886..80ab609 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # Docker image for running Frequency parachain node container (with collating) # locally in instant seal mode then deploying schemas to that node. -#This pulls the latest instant-seal-node image -FROM frequencychain/instant-seal-node:latest as frequency-image +#This pulls the latest standalone-node image +FROM frequencychain/standalone-node:latest as frequency-image #Switch to root to install node on image USER root diff --git a/README.md b/README.md index 148a93b..397b40c 100644 --- a/README.md +++ b/README.md @@ -152,7 +152,8 @@ There are 8 schemas on the connected chain. ## Use with Docker -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`. +This repo deploys `dsnp/instant-seal-node-with-deployed-schemas` to Docker Hub. +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. ### Run Locally @@ -163,6 +164,8 @@ For any local testing do the following: ### Build Locally 1. `docker build -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas: .` +Note: `--platform=linux/amd64` is required as `frequencychain` images are only published for the `linux/amd64` platform. + ### Pushing Docker Image To match with the Frequency version, a new tag should be pushed to update the docker version of this image each time frequency releases a new version. diff --git a/scripts/deploy_schemas_to_node.sh b/scripts/deploy_schemas_to_node.sh index aa015e0..c229e2a 100644 --- a/scripts/deploy_schemas_to_node.sh +++ b/scripts/deploy_schemas_to_node.sh @@ -7,17 +7,8 @@ npm --version ldd --version whoami -/frequency/frequency --dev \ - -lruntime=debug \ - --sealing=instant \ - --no-telemetry \ - --no-prometheus \ - --rpc-port=9944 \ - --rpc-external \ - --rpc-cors=all \ - --rpc-methods=Unsafe \ - --base-path=/data \ - & +# Base image start script +/frequency/frequency-start.sh & cd frequency/schemas npm run deploy From a691cdb0ee03b434474fd3d53c94dd1c3548ee34 Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Wed, 3 Jan 2024 16:50:04 +0000 Subject: [PATCH 3/4] Wait for the 11th schema before being healthy --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 80ab609..306d41b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ EXPOSE 9944 VOLUME ["/data"] HEALTHCHECK --start-period=15s \ - CMD curl --fail -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "rpc_methods"}' http://localhost:9944/ || exit 1 + 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 ENTRYPOINT ["/tini", "--"] From 9b94326b3bee4cbcf7123842314fe4f3f3eafa39 Mon Sep 17 00:00:00 2001 From: Wil Wade Date: Wed, 3 Jan 2024 17:58:38 +0000 Subject: [PATCH 4/4] Update readme --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 397b40c..aa802e8 100644 --- a/README.md +++ b/README.md @@ -153,18 +153,17 @@ There are 8 schemas on the connected chain. ## Use with Docker This repo deploys `dsnp/instant-seal-node-with-deployed-schemas` to Docker Hub. -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. +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. +Note: `--platform=linux/amd64` is because as `frequencychain` images are only published for the `linux/amd64` platform. ### Run Locally For any local testing do the following: -1. `docker pull dsnp/instant-seal-node-with-deployed-schemas:latest` -2. `docker run docker run --rm -p 9944:9944 dsnp/instant-seal-node-with-deployed-schemas:latest` +1. `docker pull --platform=linux/amd64 dsnp/instant-seal-node-with-deployed-schemas:latest` +2. `docker run --platform=linux/amd64 --rm -p 9944:9944 dsnp/instant-seal-node-with-deployed-schemas:latest` ### Build Locally -1. `docker build -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas: .` - -Note: `--platform=linux/amd64` is required as `frequencychain` images are only published for the `linux/amd64` platform. +1. `docker build --platform=linux/amd64 -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas: .` ### Pushing Docker Image