graphprotocol / graphprotocol/graph-node
Healthcheck for graph-node docker image
还没有人认领这个 Issue。
- 主要语言
- Rust
- 星标
- 3.2k
- 派生
- 1.1k
- 平均合并
- 4 天 1 小时
- 30 天内合并 PR
- 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:
- Add a curl dependency to the docker image (i.e.
apt-get -y install curlin the docker file) - 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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
找到默认 graph-node 镜像使用的 Dockerfile,并检查其依赖项和健康检查是如何配置的。使用针对 http://localhost:8030/graphql 的提议 GraphQL 请求作为检查;当镜像包含 curl,且 graph-node 运行时健康检查成功、未运行时健康检查失败,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- docker, graphql
- 领域
- devops, infrastructure
- Issue 类型
- 功能
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100