imbajin commented on PR #3025:
URL: https://github.com/apache/hugegraph/pull/3025#issuecomment-4469365009
Thanks for iterating on the Docker cache changes. The cache direction looks
good, and besides the monitor/runtime compatibility point below plus the small
`.dockerignore` typo, I don't see other blockers from my side.
I think we should keep the runtime behavior unchanged in this PR.
Today the image still exposes the legacy monitor path:
```text
start-hugegraph.sh -m true
-> start-monitor.sh
-> crontab registers monitor-hugegraph.sh every minute
-> monitor-hugegraph.sh checks process + /versions
-> restart HugeGraphServer if the process is gone or REST is
unhealthy
```
After removing `cron`, that path is broken:
```text
start-hugegraph.sh -m true
-> start-monitor.sh
-> crontab: command not found
-> monitor is not registered
```
I agree that the crontab-based monitor is not the ideal long-term model for
Docker. For container users, the better direction is probably a Docker-native
lifecycle model:
```text
docker-entrypoint.sh
-> start HugeGraphServer
-> watch server pid and optionally probe /versions
-> exit the container when the server dies or stays unhealthy
-> Docker restart policy restarts the container
```
That can then be paired with:
```text
docker run --restart unless-stopped ...
Dockerfile HEALTHCHECK ...
```
But this is a runtime behavior/design change, not just a build-cache
optimization. It also needs documentation, because standalone Docker
healthcheck only marks the container as unhealthy and does not restart it by
itself; users still need a restart policy, or an entrypoint watchdog that exits
the container after repeated failures.
So for this PR, I suggest the lowest-risk path:
1. Keep `cron` in the runtime image for now, so the existing
`start-hugegraph.sh -m true` monitor path is not broken.
2. Remove only the build-time `service cron start` cleanup if needed, since
starting a service during image build does not keep it running in containers.
3. Fix the small `.dockerignore` typo: `.gitattribut` -> `.gitattributes`.
4. Leave the Docker-native watchdog / healthcheck / restart-policy design to
a follow-up PR with docs.
In short:
```text
This PR:
improve Docker build cache
keep runtime behavior unchanged
Follow-up PR:
replace legacy cron monitor with Docker-native watchdog / healthcheck docs
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]