Skip to content

cli: Implement cloud build functionality in BuildRuntime - #435

Open
singhshresth26 wants to merge 7 commits into
volcano-sh:mainfrom
singhshresth26:feat/cli-cloud-build
Open

cli: Implement cloud build functionality in BuildRuntime#435
singhshresth26 wants to merge 7 commits into
volcano-sh:mainfrom
singhshresth26:feat/cli-cloud-build

Conversation

@singhshresth26

Copy link
Copy Markdown

What type of PR is this?

/kind enhancement

What this PR does / why we need it:
This PR implements the simulated cloud build strategy (_build_cloud method) in the CLI BuildRuntime.

When a user specifies --build-mode cloud (or configures it in agent_metadata.yaml), the CLI will:

  1. Simulate packaging and archiving the agent workspace.
  2. Simulate triggering and running a remote build on the configured cloud provider (default: Huawei Cloud).
  3. Resolve the remote image destination (using a default cloud SWR registry template if no registry URL is set).
  4. Persist the image build information with build_mode: cloud to agent_metadata.yaml.

It also adds comprehensive unit tests in cmd/cli/tests/test_build_runtime.py covering both the local and cloud build paths.

Which issue(s) this PR fixes:
Fixes #434

Special notes for your reviewer:
This resolves the first code issue/TODO placeholder (# TODO: Implement cloud build functionality) in build_runtime.py.

Does this PR introduce a user-facing change?:

cli: Implement cloud build mode support in build command

Copilot AI review requested due to automatic review settings July 10, 2026 16:13
@volcano-sh-bot volcano-sh-bot added the kind/enhancement New feature or request label Jul 10, 2026
@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign yaozengzeng for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

Welcome @singhshresth26! It looks like this is your first PR to volcano-sh/agentcube 🎉

@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 implements the cloud build functionality in _build_cloud for BuildRuntime and adds corresponding unit tests. The feedback suggests returning the fully qualified image name (including the tag) instead of just the registry URL in _build_cloud to maintain consistency with local builds, and updating the unit test assertions accordingly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread cmd/cli/agentcube/runtime/build_runtime.py Outdated
Comment thread cmd/cli/tests/test_build_runtime.py
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.96%. Comparing base (3b19390) to head (e45837c).
⚠️ Report is 32 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #435      +/-   ##
==========================================
+ Coverage   58.41%   59.96%   +1.54%     
==========================================
  Files          36       36              
  Lines        3463     3589     +126     
==========================================
+ Hits         2023     2152     +129     
+ Misses       1231     1218      -13     
- Partials      209      219      +10     
Flag Coverage Δ
unittests 59.96% <ø> (+1.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI 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.

Pull request overview

This PR adds a simulated cloud build path to the AgentCube CLI BuildRuntime so users can run agentcube build with --build-mode cloud and have the CLI resolve a cloud registry destination and persist build information into agent_metadata.yaml.

Changes:

  • Implemented _build_cloud() in BuildRuntime to simulate a remote build and update metadata with cloud build details.
  • Added unit tests covering local and cloud build flows.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
cmd/cli/agentcube/runtime/build_runtime.py Implements the cloud build strategy and metadata persistence for cloud builds.
cmd/cli/tests/test_build_runtime.py Adds tests for both local and cloud build paths.

Comment thread cmd/cli/agentcube/runtime/build_runtime.py Outdated
Comment thread cmd/cli/agentcube/runtime/build_runtime.py
Comment thread cmd/cli/tests/test_build_runtime.py
Comment thread cmd/cli/tests/test_build_runtime.py Outdated
Copilot AI review requested due to automatic review settings July 10, 2026 16:27

Copilot AI 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.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

Comment thread cmd/cli/agentcube/runtime/build_runtime.py Outdated
Comment thread cmd/cli/agentcube/runtime/build_runtime.py Outdated
Comment thread cmd/cli/tests/test_build_runtime.py Outdated
Comment thread cmd/cli/agentcube/runtime/build_runtime.py
@acsoto

acsoto commented Jul 28, 2026

Copy link
Copy Markdown
Member

The PR description says users can select --build-mode cloud when building, but --build-mode is only exposed by pack; the build command has no build-mode override. Is the intended flow pack --build-mode cloud followed by build, or should this PR expose the option on build too?

@singhshresth26

Copy link
Copy Markdown
Author

I have now exposed --build-mode directly as an option on the build CLI command as well, so users can override it at build time (e.g. agentcube build --build-mode cloud --dry-run).

@acsoto

acsoto commented Jul 28, 2026

Copy link
Copy Markdown
Member

Have you seen AI's suggestions?
And pls sign off your commit

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
… checks

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
… validation

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
@singhshresth26

Copy link
Copy Markdown
Author

Sorry for not seeing the AI suggestions earlier and for missing the sign-offs!

I've just updated the code to address the AI review comments (implemented the registry URL base parsing logic, normalized provider checks, and added corresponding unit tests). I also signed off the new commits and force-pushed the branch. Thanks!

Comment thread cmd/cli/agentcube/cli/main.py
Comment thread cmd/cli/agentcube/runtime/build_runtime.py
Comment thread cmd/cli/agentcube/runtime/build_runtime.py Outdated
… and registry port validation

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
@acsoto

acsoto commented Jul 28, 2026

Copy link
Copy Markdown
Member

With the current behavior, cloud mode without --dry-run fails, while dry-run neither persists image metadata nor can be published. This no longer implements the PR/issue claim to persist cloud build information and enable end-to-end cloud publishing; it only previews a hypothetical image. Please align the title, description, release note, and linked issue with that scope, or clarify the supported workflow this PR is intended to add.

@acsoto

acsoto commented Jul 28, 2026

Copy link
Copy Markdown
Member

Looks like most of the review comments have been addressed. Could you resolve those threads so it's easier to see what's still open?

…shing

Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
Signed-off-by: Shresth Singh <shresthengineer@gmail.com>
@singhshresth26

Copy link
Copy Markdown
Author

Sorry for the delay! I have resolved the remaining issues in the latest commit:

Cloud Build Support (without --dry-run): Allowed simulated cloud builds to succeed without --dry-run, writing the build details to agent_metadata.yaml on disk. This enables the end-to-end cloud publishing workflow.
Dry-Run Preservation: When --dry-run is explicitly specified, builds remain strictly side-effect free (in-memory only) and are blocked from publishing.
Test Updates: Added test coverage verifying metadata is correctly written to disk on non-dry-run cloud builds, and added integration tests for publishing cloud-built images.
All tests are passing. Let me know if everything looks good!

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

Labels

kind/enhancement New feature or request size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement cloud build functionality in BuildRuntime

5 participants