graphprotocol / graphprotocol/graph-node

Healthcheck for graph-node docker image

Ouverte
#5,484 3 commentaires 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

enhancement Stale
Langage dominant
Rust
Étoiles
3.2k
Forks
1.1k
Merge moyen
4 j 1 h
PR mergées (30 j)
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.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Localisez le Dockerfile utilisé pour l’image graph-node par défaut et examinez comment ses dépendances et ses vérifications de santé sont configurées. Utilisez la requête GraphQL proposée contre http://localhost:8030/graphql comme vérification ; le travail est terminé lorsque l’image inclut curl et que la vérification de santé réussit lorsque graph-node est en cours d’exécution et échoue lorsqu’il ne l’est pas.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
docker, graphql
Domaine
devops, infrastructure
Type d'issue
Fonctionnalité
Difficulté
2/5
Temps estimé
1-3 heures
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.