Symlink invoke command to support existing projects#13629
Conversation
Summary of ChangesHello @giohappy, 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 modifies the Dockerfile for Ubuntu-based images to ensure backward compatibility for existing projects. It specifically addresses issues arising from the recent upgrade to Ubuntu 24.04 and the adoption of Python virtual environments, which altered the default path for the 'invoke' command. By installing the 'invoke' package and creating a symbolic link to a well-known global path, this change allows existing 'entrypoint.sh' scripts to continue functioning without modification, streamlining the upgrade process for users. 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds a symlink for the invoke command to maintain backward compatibility for existing projects after an upgrade. The changes are in the Dockerfile. I've provided a couple of suggestions to improve the robustness and readability of the Dockerfile instructions.
| RUN pip3 install uwsgi \ | ||
| && pip install pip --upgrade \ | ||
| && pip install wheel==0.38.1 \ | ||
| && pip install invoke==2.2.0 \ | ||
| && pip install GDAL==3.8.4 |
There was a problem hiding this comment.
For better readability, consistency, and efficiency, it's a good practice to upgrade pip first, and then install all packages in a single pip install command. This reduces the number of processes spawned within the RUN instruction and makes the package list easier to manage.
RUN pip install --upgrade pip && \
pip install \
uwsgi \
wheel==0.38.1 \
invoke==2.2.0 \
GDAL==3.8.4
| # Create symlink for "invoke" command | ||
| # Required after installing via pip inside a virtualenv and avoid changing the | ||
| # entrypoint.sh in existing GeoNode Projects where /usr/local/bin/invoke is used | ||
| RUN ln -s $(which invoke) /usr/local/bin/invoke |
There was a problem hiding this comment.
Using which invoke makes this command dependent on the PATH environment variable. For better robustness and to make the Dockerfile more explicit, it's recommended to use the absolute path to the invoke executable within the virtual environment.
RUN ln -s /usr/src/venv/bin/invoke /usr/local/bin/invoke
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #13629 +/- ##
=======================================
Coverage 73.95% 73.95%
=======================================
Files 930 930
Lines 54934 54934
Branches 7400 7400
=======================================
Hits 40624 40624
Misses 12690 12690
Partials 1620 1620 🚀 New features to boost your workflow:
|
This solution avoids having to change the entrypoint.sh in existing projects, after the upgrade to Ubuntu 24.04 and the introduction of the Python venv