You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: [NODE-1991] Proxy GuestOS upgrades through HostOS - #12021
Use nginx to proxy upgrade downloads through HostOS. For type4 nodes, this will allow a single machine to download the image one time, for use in all of the GuestOS VMs.
If the proxy is not available, or the hash is incorrect, we fall back to pulling the image directly.
► rs/ic_os/networking/nss_icos/BUILD.bazel Add dependencies for config/types, deterministic_ips, serde, serde_json, macaddr
Enhancement
► rs/ic_os/networking/nss_icos/src/lib.rs Refactor to compute HostOS/GuestOS addresses via deterministic MAC and configurables; replace hard-coded IP logic ► add new config reading and address computation helpers
Enhancement
► rs/orchestrator/image_upgrader/src/image_upgrader.rs Integrate upgrade proxy usage: constants for hostos proxy, timeouts; adjust download flow to use proxy when available; support for hashing and direct download fallback; rename get_release_package_urls_and_hash to return Vec and String ► add try_download_from_urls helper
Enhancement
► rs/orchestrator/src/upgrade.rs Update get_release_package_urls_and_hash return type to (Vec, String) and adapt usage
Enhancement
► rs/orchestrator/testdata/nftables_assigned_cloud_engine.conf.golden Update expected nftables rules to account for HostOS upgrade proxy access (19300)
► rs/ic_os/networking/nss_icos/BUILD.bazel Add dependencies for config/types, deterministic_ips, serde, serde_json, macaddr
Enhancement
► rs/ic_os/networking/nss_icos/src/lib.rs Refactor to compute HostOS/GuestOS addresses via deterministic MAC and configurables; replace hard-coded IP logic ► add new config reading and address computation helpers
Enhancement
► rs/orchestrator/image_upgrader/src/image_upgrader.rs Integrate upgrade proxy usage: constants for hostos proxy, timeouts; adjust download flow to use proxy when available; support for hashing and direct download fallback; rename get_release_package_urls_and_hash to return Vec and String ► add try_download_from_urls helper
Enhancement
► rs/orchestrator/src/upgrade.rs Update get_release_package_urls_and_hash return type to (Vec, String) and adapt usage
Enhancement
► rs/orchestrator/testdata/nftables_assigned_cloud_engine.conf.golden Update expected nftables rules to account for HostOS upgrade proxy access (19300)
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The proxy accepts arbitrary upstream destinations, allowing callers to reach HostOS loopback services and bypass inbound firewall restrictions once it starts.
This PR adds a HostOS caching proxy for GuestOS upgrade images, aiming to reduce repeated downloads on multi-VM nodes while preserving direct-download fallback.
Changes:
Adds an nginx proxy, systemd service, and HostOS firewall access.
Tries proxied downloads first, with mandatory hash verification and direct fallback.
Updates hostname resolution and SELinux permissions to support HostOS discovery.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved critical issues can prevent direct-download fallback within the upgrade deadline and allow unbounded proxy downloads to exhaust the shared HostOS filesystem.
Nginx worker connection limit is too low for concurrent VM cache misses
ic-os/components/upgrade/upgrade-proxy.conf:6
A type4.1 host starts 60 GuestOS VMs (ic-os/components/hostos/guestos/start-guestos.sh:11), but worker_connections counts upstream sockets as well as client sockets. Concurrent cache misses for different image hashes can therefore require 120 connections, exceeding this single worker's limit and forcing otherwise valid upgrade requests to bypass the proxy. Please increase the limit to cover client and upstream connections for all supported VM slots, with some headroom for listeners and DNS.
Corrupt proxy partials can poison retries from the direct source
If the proxy sends corrupt bytes and then times out, FileDownloader leaves that prefix on disk, and the direct fallback resumes after it using Range. With one release URL, repeated proxy failures can therefore cause a hash mismatch on every check despite a healthy direct source. Retry the direct URL from offset zero after a hash mismatch, which already deletes the file.
If a proxy download writes an incorrect prefix and then disconnects or times out, the direct fallback resumes from those unverified bytes instead of replacing them. With a single release URL, this makes the final hash check fail even when the origin serves the correct image, and repeated proxy failures can prevent the upgrade from completing. Keep proxy partials separate from direct-download state so fallback starts clean without losing legitimate direct-download progress.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Incorrect VM-slot classification breaks GuestOS address resolution, while partial proxy downloads can corrupt direct-download fallback and cause repeated upgrade failures.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
When the proxy is unavailable, the fallback deletes partial direct-download data, forcing retries to restart from zero and potentially preventing interrupted downloads from ever completing.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The GuestOS-to-HostOS proxy spans caching, hostname resolution, firewall, and SELinux changes, requiring integration and security validation of cache sharing and fallback behavior beyond the source-only review.
…azel-lockfiles
Cargo.lock conflicted only in nss_icos's dependency list. Resolved by
taking this branch's Cargo.lock and running `cargo update --workspace`,
which applied master's manifest changes (#12021, #12094) and moved no
versions.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
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.
Use nginx to proxy upgrade downloads through HostOS. For type4 nodes, this will allow a single machine to download the image one time, for use in all of the GuestOS VMs.
If the proxy is not available, or the hash is incorrect, we fall back to pulling the image directly.