feat(harness): support Runtime network configuration#137
Draft
zakahan wants to merge 1 commit into
Draft
Conversation
4ee8582 to
e8491db
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Runtime network configuration support to Harness deployments.
This change lets users select the network mode and provide VPC-related settings when
agentkit deploy --harnesscreates a new Runtime. The CLI forwards the settings through the Harness deployment layer and into the cloud launch configuration consumed by the Runtime creation path.Motivation
Harness deployments currently rely on the platform's default Runtime network configuration. That is insufficient for agents that must:
Users need to express these settings at deployment time without manually modifying the generated launch configuration.
What changed
CLI options
agentkit deploy --harnessnow accepts:--runtime-network-mode: Runtime network mode (public,private, orboth);--runtime-vpc-id: VPC ID used by private or combined networking;--runtime-subnet-id/--runtime-subnet-ids: repeatable subnet ID option;--runtime-enable-shared-internet-accessand its negative form,--no-runtime-enable-shared-internet-access.The options are Harness-specific. Passing any of them without
--harnessreturns a CLI parameter error instead of silently ignoring the values.Configuration flow
The deployment path collects the explicitly supplied values into a
runtime_networkmapping and passes it throughbuild_agentkit_config. Empty network configuration is omitted, preserving the existing launch configuration for users who do not opt in.The generated cloud section can now contain a structure such as:
{ "runtime_network": { "mode": "private", "vpc_id": "vpc-123", "subnet_ids": ["subnet-a", "subnet-b"], "enable_shared_internet_access": true } }The cloud runner consumes this mapping when creating the Runtime and converts it to the platform-specific public/private network fields.
Create-versus-update behavior
Runtime network configuration is applied only when creating a Runtime. If deployment resolves a name collision to an update of an existing Runtime, the command fails with an actionable error explaining that the existing Runtime must be deleted and recreated to change its network configuration.
This avoids accepting settings that the update/version path cannot apply.
Example
Compatibility
build_agentkit_configAPI remains backward compatible becauseruntime_networkis optional and defaults toNone.Validation
UV_CACHE_DIR=/tmp/uv-cache uv run --no-sync --with pytest python -m pytest tests/toolkit/cli/test_cli_deploy_harness_network.py— 4 passedgit diff --check upstream/main...HEADpassed.The tests cover CLI forwarding, rejection without
--harness, inclusion of an explicit network mapping, and omission of empty network configuration.