Skip to content

testing curl agent#5679

Draft
siddhartha-quad wants to merge 6 commits into
GoogleCloudPlatform:developfrom
siddhartha-quad:fix-curl-agent
Draft

testing curl agent#5679
siddhartha-quad wants to merge 6 commits into
GoogleCloudPlatform:developfrom
siddhartha-quad:fix-curl-agent

Conversation

@siddhartha-quad
Copy link
Copy Markdown
Contributor

fix curl ops agent

Submission Checklist

NOTE: Community submissions can take up to 2 weeks to be reviewed.

Please take the following actions before submitting this pull request.

  • Fork your PR branch from the Toolkit "develop" branch (not main)
  • Test all changes with pre-commit in a local branch #
  • Confirm that "make tests" passes all tests
  • Add or modify unit tests to cover code changes
  • Ensure that unit test coverage remains above 80%
  • Update all applicable documentation
  • Follow Cluster Toolkit Contribution guidelines #

@siddhartha-quad siddhartha-quad added the release-chore To not include into release notes label May 18, 2026
@github-actions github-actions Bot added the external PR from external contributor label May 18, 2026
@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 improves the security and reliability of the Ops Agent installation process within the startup scripts. By replacing direct pipe-to-bash execution with a controlled, retry-enabled wrapper, the script ensures safer handling of downloaded content and increases the success rate of agent deployments.

Highlights

  • Security Improvement: Replaced insecure 'curl | bash' patterns with a more robust, generalized installer wrapper function.
  • Reliability: Implemented a centralized retry mechanism for agent installations to handle transient network or execution failures.
  • Code Refactoring: Standardized installation logic across both Debian and RedHat distributions by utilizing the new shared helper function.
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.

Copy link
Copy Markdown
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 introduces a shared installer function, install_agent_shared, to standardize the installation of monitoring and logging agents across Debian and RedHat systems, replacing direct curl-to-bash executions with a more robust download-and-retry mechanism. Feedback indicates that the install_cmd parameter and the associated local installation functions are redundant, as the agent scripts' --also-install flag already manages package installation. Removing these redundancies will simplify the implementation and prevent unnecessary package manager operations.

Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh
@siddhartha-quad siddhartha-quad changed the title fix curl ops agent testing curl agent May 18, 2026
@siddhartha-quad
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
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 refactors the monitoring agent installation scripts by introducing a shared install_agent_shared function to standardize the process across different platforms. It also includes a workaround for Ubuntu 24.04 by setting REPO_CODENAME=jammy and appends || true to service start commands. The reviewer highlights that the hardcoded REPO_CODENAME should be applied conditionally to avoid issues on other distributions and that using || true masks potential service start failures, which should be addressed to ensure proper error reporting.

Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh Outdated
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh Outdated
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh Outdated
Comment thread modules/scripts/startup-script/files/install_monitoring_agent.sh Outdated
siddhartha-quad and others added 4 commits May 18, 2026 17:05
updated hardcoded version

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
updated hardcoded version

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
removed true from services

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
removed true from services

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@siddhartha-quad
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
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 refactors the monitoring agent installation script by introducing a generalized install_agent_shared function. This function improves security by avoiding direct curl | bash execution, using temporary directories with restricted permissions, and implementing a retry mechanism for robustness. Additionally, the script adds a workaround for Ubuntu 24.04 to resolve 404 errors by setting the repository codename to jammy. Both Debian and Red Hat installation paths have been updated to utilize this new shared logic. I have no feedback to provide.

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

Labels

external PR from external contributor release-chore To not include into release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant