Skip to content

Symlink invoke command to support existing projects#13629

Merged
giohappy merged 4 commits intomasterfrom
symlink_invoke
Oct 17, 2025
Merged

Symlink invoke command to support existing projects#13629
giohappy merged 4 commits intomasterfrom
symlink_invoke

Conversation

@giohappy
Copy link
Contributor

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

@cla-bot cla-bot bot added the cla-signed CLA Bot: community license agreement signed label Oct 17, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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

  • Install 'invoke' package: The 'invoke' Python package (version 2.2.0) is now explicitly installed during the Docker image build process.
  • Create symlink for 'invoke' command: A symbolic link is created from the 'invoke' executable, located within the Python virtual environment, to '/usr/local/bin/invoke'. This ensures the command is globally accessible.
  • Maintain compatibility for existing projects: This change addresses compatibility issues for existing GeoNode projects that rely on '/usr/local/bin/invoke', preventing the need to modify their 'entrypoint.sh' scripts after the upgrade to Ubuntu 24.04 and the introduction of Python virtual environments.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@giohappy giohappy changed the title Symlink import command to support existing projects Symlink invoke command to support existing projects Oct 17, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 35 to 39
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
Copy link

codecov bot commented Oct 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.95%. Comparing base (02a7619) to head (3762cf4).
⚠️ Report is 4 commits behind head on master.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@giohappy giohappy merged commit e529915 into master Oct 17, 2025
16 checks passed
@giohappy giohappy deleted the symlink_invoke branch October 17, 2025 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed CLA Bot: community license agreement signed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants