-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile is missing HEALTHCHECK #8404
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
Hello, |
Container exposes several ports both tcp and udp. See Dockerfile for details.
Checking ports 4001/tcp, 4001/udp, and 5001/tcp would be a good start. Am I right in thinking @Stebalien? |
I would check if some known file can be retrieved from the gateway. E.g., the empty directory. That should provide a reasonable end-to-end health check. |
What about |
That will stall until you actually download it. The best bets are either an "empty directory" (which you're guaranteed to have) or the welcome docs (see the output of `ipfs init`).
|
Hey @Stebalien I found below file is guaranteed to exist after a node has started. |
As long as that CID isn't hard-coded because it can change and a hard-coded CID will bit rot. |
Yeah. The contents of |
Or we could ping any one of the node in the swarm? |
`ipfs id` command will return node info once it is up. Can this be used?
That would work, but it won't verify that data can be fetched from the repo.
Or we could ping any one of the node in the swarm?
That's likely going to be flaky.
|
I tried this within the container hash=`echo "I <3 IPFS -$(whoami)" | ipfs add -q`
wget "https://ipfs.io/ipfs/$hash" -O /dev/null &> /dev/null but wget sometimes fails fetch the file This is what i found out later |
I'd be careful about _adding_ things as that can trigger network traffic, etc.
In terms of that failure, you're trying to fetch them from the gateway. Try to keep the health check locally.
Again, just fetch an empty directory. It'll always have the same CID and every node will have it.
|
Well in that case, we would need to create an empty directory that no one will add any data into and add directory to ipfs and then fetch locally. Is this flow correct? |
The CID of the empty directory is QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn. It's pinned on all nodes by default.
|
Oh. Okay. I was unaware of that. Thanks for the info. |
Big Thank You to all who contributed! |
Checklist
Description
Dockerfile
is missingHEALTHCHECK
. It would be a nice addition. Something simple should work like checking whether exposed ports respond with curl or netcat. https://docs.docker.com/engine/reference/builder/#healthcheckThe text was updated successfully, but these errors were encountered: