feat: introduce API-based execution engine as an alternative to legacy shell script orchestration - #130
feat: introduce API-based execution engine as an alternative to legacy shell script orchestration#130satyakommula96 wants to merge 15 commits into
Conversation
…y shell script orchestration
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
|
@cjac Could you please review this PR |
There was a problem hiding this comment.
Code Review
This pull request introduces an optional API-based execution engine (ApiExecutionEngine) using native Google Cloud Python client libraries to manage Dataproc custom image creation, alongside a base ExecutionEngine interface and a CLI-based engine wrapper. Key feedback on these changes includes fixing a runtime AttributeError caused by an invalid scheduling enum reference, addressing a potential command injection vulnerability in the CLI engine by avoiding shell=True, and replacing a broken csv.reader metadata parser with a robust regex-based solution (while also improving its corresponding unit test). Additionally, the reviewer recommended removing an unused Dataproc client, using fromisoformat for more robust timestamp parsing, making the hardcoded 1-hour build timeout configurable, and avoiding retries on non-transient BadRequest errors.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…ing, and update build timeout validation
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces an optional API-based execution engine (ApiExecutionEngine) for creating Dataproc custom images using native Google Cloud Python client libraries instead of generating local shell scripts. It refactors the main entry point to support both CLI and API engines, adds a requirements.txt file, and includes comprehensive unit tests. The review feedback highlights several high-to-medium severity issues in the new API engine, including overly restrictive zone/region validation regexes that fail for GovCloud, a bug in the GCS log upload path that ignores bucket prefixes, potential AttributeError crashes when image labels are missing, and redundant disk deletion during cleanup. Additionally, it is recommended to replace verbose subprocess.Popen usage with subprocess.run in the CLI engine.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces an optional API-based execution engine (ApiExecutionEngine) that utilizes native Google Cloud Python client libraries to manage custom Dataproc image creation, alongside documentation updates, dependency definitions, and unit tests. The review feedback highlights several critical areas for improvement: resolving a bug in version parsing to correctly handle hyphenated image labels (e.g., 2-1-115-debian11), properly propagating credentials loaded via the --oauth flag to all API clients and helpers, and robustly handling trailing slashes in GCS bucket paths. Additionally, the reviewer recommends gracefully handling non-integer values in accelerator counts, removing the unused google-cloud-dataproc dependency from both requirements.txt and unit test setups, and expanding test coverage to validate hyphenated version parsing.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
Hi @cjac! Now that the new API-based execution engine is fully implemented, thoroughly tested. |
|
Easy tiger! The users have not yet even seen it, much less tested it. You haven't even told me whether you've run the manual tests I've asked you to run. |
Apologies for the excitement - we definitely want to make sure we walk before we run. To answer your question: Yes, we have now successfully completed real-world end-to-end manual testing on a live GCP account! Here is a summary of what was verified in the live manual run using the new
We are fully aligned on not rushing - we should definitely keep the legacy We're excited to get feedback from other users as they start trying it out! |
… in documentation
But that wasn't my question. Have you confirmed that the scripts in examples/secure-boot/ work with the new code? Let's leave the default to be the existing bash-based approach with an argument to select the python implementation for this release. Once we get some feedback from users we can make the decision about whether to change the default engine. |
|
/gemini review Are these changes likely to work with the existing examples in examples/secure-boot ? |
|
Hi @cjac! Thanks for the follow-up. To answer your question: Yes, the scripts in The I have verified that the We are keeping the legacy |
cjac
left a comment
There was a problem hiding this comment.
please do a thorough audit of all whitespace-only changes and remove them from this PR. We can fix them up in a separate, dedicated PR. Doing them in this one confuses the issue and masks the actual changes.
cjac
left a comment
There was a problem hiding this comment.
remove all of the formatting changes from this change. Minimize the delta.
|
@cjac removed all whitespace changes. Please review again |
|
Did you try running examples/secure-boot/build-and-run-podman.sh ? When I get a few minutes, that's what I'll use to test your code. But I haven't had a few minutes. |
|
@cjac exeuted examples/secure-boot/build-and-run-podman.sh and it is passsed |
|
Perfect. Thank you! |
#129