-
Notifications
You must be signed in to change notification settings - Fork 27
fix some issues preventing the docker container from starting #1665
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
base: master
Are you sure you want to change the base?
Conversation
|
fixes this issue |
Gonza10V
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker image is now building but there is a check that is running for over 3 hours and one failed. Is this expected?
|
This is definitely a problem |
|
the test failed because it expects the container to have its own health check instead of having it in docker compose, I will add it back and it should pass |
|
@cl117 This is now ready for merging. Please review and approve if it looks good. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures the Docker container can start properly by persisting the Git revision before removing the .git folder, adding error handling around SPARQL updates, and switching to a curl-based healthcheck in the Dockerfile.
- Delegate setting
revisionto a pre-build script (gitrevupdate.js) and shell helper (saveconfig.sh) - Add
.catchhandlers inupdateQueryJsonanddeleteStaggeredto log and propagate SPARQL errors - Update Dockerfile to install
curl, run revision save, remove old healthcheck script, and define a built-in DockerHEALTHCHECK
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| synbiohub.js | Removed gitRevision import and inline config.set('revision', ...) to defer to the new script |
| lib/sparql/sparql.js | Wrapped updateQueryJson and deleteStaggered calls with catch handlers for logging errors |
| lib/config.js | Removed stray whitespace |
| gitrevupdate.js | Added CLI script to fetch current Git SHA and write it to the config |
| docker/saveconfig.sh | New shell helper to invoke gitrevupdate.js during Docker build |
| docker/healthcheck.js | Removed JS-based healthcheck in favor of Dockerfile HEALTHCHECK |
| docker/Dockerfile | Installed curl, ran saveconfig.sh, removed the Git folder, and updated HEALTHCHECK/ENTRYPOINT |
Comments suppressed due to low confidence (3)
lib/sparql/sparql.js:64
- [nitpick] Directly using
console.errorcan bypass the centralized logging system. Consider replacing these calls with the project'slogger.errorto keep log output consistent and configurable.
.then(parseResult)
docker/Dockerfile:8
- [nitpick] This
RUNadds an extra layer. To reduce image size and simplify the build, consider combining it with the precedingapk addor thesaveconfig.shinvocation into a singleRUNstatement.
RUN git config --global url."https://".insteadOf git://
|
Docker is failing to build |
|
|
||
| const url = 'http://localhost:' + config.get('port') + '/' | ||
|
|
||
| axios.get(url).then(response => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have to check the docs, but this might not fail on 404 etc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
never mind it does, this should work just fine
|
@PeterHindes Is this PR still need to be kept open? It is still failing. |
No description provided.