fix(pelican): resolve listen port from SERVER_PORT env var#357
Conversation
The app only auto-created the data directory, so when the Pelican install script's directories didn't persist, the server crashed on startup with "unable to open database file: no such file or directory". - Auto-create parent directory for DB file and maps directory on startup - Add full image variant (with map tools) to Pelican egg, default to it - Use human-readable names in docker_images dropdown
Pelican's {{server.allocations.default.port}} template in env var
defaults is not resolved by all Pelican versions, causing the app to
crash with "unknown port". The entrypoint now sets OCAP_LISTEN from
Pelican's injected SERVER_PORT variable, and the egg default falls
back to a safe static value.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the robustness and compatibility of the OCAP2 Web Server deployment, particularly within Pelican/Wings environments. It resolves a critical startup failure caused by inconsistent environment variable template resolution for allocated ports and improves the server's ability to manage its required data directories. These changes ensure more reliable server operation and simplify deployment. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly resolves an issue with Pelican port allocation by updating the entrypoint script to use the SERVER_PORT environment variable. The corresponding change to the Pelican egg provides a safe fallback port, which is a solid approach. The additional changes to ensure necessary directories are created on startup improve the application's robustness, especially for standalone Docker usage. The test updates are also well-implemented. Overall, the changes are sound and well-executed.
Summary
{{server.allocations.default.port}}template in env var defaults isn't resolved by all versions, causingunknown portcrash on startupOCAP_LISTENfrom Pelican's injectedSERVER_PORTenv var0.0.0.0:5000as safe fallback (entrypoint overrides it with the actual allocated port)Test plan
OCAP_LISTENenv var or default)