graphprotocol / graphprotocol/graph-node

Healthcheck for graph-node docker image

Open
#5,484 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Stale
Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Description

The docker image for the graph-node doesn't contain a health check. It would be useful to have a simple way of checking the health of a graph node in the docker image automatically.

Docker health checks are meant to provide a very simple check if the relevant application is running correctly. They should be quick and cheap so that they can execute frequently. In the graph-node case this would be a check if the graph node is up and running and not a check for a particular subgraph.

Proposal

As graph-node doesn't have a native health check, the fairly simple command to check if the node is up and running would be a GraphQL request:

query getVersion {
  version {
    version
  }
}

should return the version of the node. To run this as a shell command, we could use:

curl -s http://localhost:8030/graphql -H 'Content-Type: application/json'  -d '{"query": "query getVersion { version { version } }" }' -f -m 2

The command runs inside the docker container. However, the default docker image does not provide curl. So the proposal is two-fold:

  1. Add a curl dependency to the docker image (i.e. apt-get -y install curl in the docker file)
  2. Add a health check command to the docker file.

If there is interest in this, I'm happy to create a PR for it.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the Dockerfile used for the default graph-node image and inspect how its dependencies and health checks are configured. Use the proposed GraphQL request against http://localhost:8030/graphql as the check; done means the image includes curl and the health check succeeds when graph-node is running and fails when it is not.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, graphql
Domain
devops, infrastructure
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.