Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI, docker base, and healthcheck #48

Merged
merged 4 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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", "--"]

Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,16 +152,18 @@ 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 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:<versionNumberHere> .`
1. `docker build --platform=linux/amd64 -t dsnp/instant-seal-node-with-deployed-schemas:latest -t dsnp/instant-seal-node-with-deployed-schemas:<versionNumberHere> .`

### Pushing Docker Image

Expand Down
13 changes: 2 additions & 11 deletions scripts/deploy_schemas_to_node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
wesbiggs marked this conversation as resolved.
Show resolved Hide resolved

cd frequency/schemas
npm run deploy
Expand Down