graphprotocol / graphprotocol/graph-node

Healthcheck for graph-node docker image

オープン
#5,484 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

enhancement Stale
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

デフォルトの graph-node イメージに使用される Dockerfile を特定し、その依存関係とヘルスチェックがどのように設定されているかを確認してください。チェックには http://localhost:8030/graphql に対する提案された GraphQL リクエストを使用します。完了の条件は、イメージに curl が含まれており、graph-node の実行中にはヘルスチェックが成功し、実行されていないときには失敗することです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
docker, graphql
領域
devops, infrastructure
issue の種類
機能追加
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。