graphprotocol / graphprotocol/graph-node
Healthcheck for graph-node docker image
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Rust
- Star
- 3.2k
- Fork
- 1.1k
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Xác định Dockerfile được sử dụng cho image graph-node mặc định và kiểm tra cách các dependency cũng như health check của image được cấu hình. Sử dụng yêu cầu GraphQL được đề xuất tới http://localhost:8030/graphql làm bước kiểm tra; được coi là hoàn tất khi image có curl và health check thành công khi graph-node đang chạy, đồng thời thất bại khi nó không chạy.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- docker, graphql
- Lĩnh vực
- devops, infrastructure
- Loại issue
- Tính năng
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100