Skip to content

Skip default dependencies in YAML template when workers use private IPs - #4597

Open
ashokballolli wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
ashokballolli:yaml-template-skip-deps-private-ips
Open

ashokballolli wants to merge 2 commits into
GoogleCloudPlatform:mainfrom
ashokballolli:yaml-template-skip-deps-private-ips

Conversation

@ashokballolli

Copy link
Copy Markdown

Fixes #4565

When the workers only use private IPs, the YAML template still adds the default requirements file, so pip download tries to reach PyPI and the launcher times out. As discussed in the issue, the template now does not add the requirements file in this case. The private IP setting is read from the args (--no_use_public_ips) or from options in the YAML. These jobs can still pass their own requirements_file.

Tested on Dataflow with private and public IPs, details and screenshots here: #4565 (comment). Also added unit tests.

This is a bug fix, so the bug-fix label should fit.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 prevents pipeline timeouts in private IP environments by skipping the addition of default runtime dependencies when workers do not have public IP access.

Highlights

  • Private IP Detection: Added a helper function to detect if pipeline workers only use private IPs.
  • Dependency Management: Skipped adding default runtime dependencies when workers use private IPs to prevent timeouts.
  • Testing: Added unit tests to verify dependency behavior under private IP configurations.
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 the 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 counterproductive. 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

  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. ↩

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

Copy link
Copy Markdown
Contributor

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 prevents adding default runtime dependencies when pipeline workers are configured to use only private IPs, as they typically lack access to PyPI. It introduces a helper function _uses_private_ips to parse pipeline options and check if use_public_ips is set to false, and updates the main execution flow to skip dependency addition and log an informational message when this condition is met. Unit tests have also been added to cover these scenarios. I have no feedback to provide.

@ashokballolli
ashokballolli force-pushed the yaml-template-skip-deps-private-ips branch from 9359244 to f6f86d9 Compare November 20, 2026 07:39
@ashokballolli

Copy link
Copy Markdown
Author

/gemini review

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

Copy link
Copy Markdown
Contributor

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 introduces a check to prevent adding default runtime dependencies when Apache Beam pipeline workers are configured to use only private IPs, as they typically lack access to PyPI. It adds the _uses_private_ips helper function to parse pipeline options and skip dependency installation accordingly, accompanied by comprehensive unit tests to validate this behavior. I have no feedback to provide.

@ashokballolli

Copy link
Copy Markdown
Author

Hi @chamikaramj, this is the fix we discussed on #4565. I tested it again on Dataflow with private and public IPs and both jobs worked fine. Could you please take a look when you get time? It also needs the bug-fix label.

cc @GoogleCloudPlatform/dataflow-templates-wg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 participant