Repository navigation
feat: all-in-one nodes for cloud engines - #11349
Conversation
|
✅ No security or compliance issues detected. Reviewed everything up to 7c3df56. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. |
basvandijk
left a comment
There was a problem hiding this comment.
Approve for the files under rs/tests/driver/src/driver/.
A PR description would be nice for a >2k diff ;)
|
✅ No security or compliance issues detected. Reviewed everything up to 7c3df56. Security Overview
Detected Code ChangesThe diff is too large to display a summary of code changes. |
pierugo-dfinity
left a comment
There was a problem hiding this comment.
Are we confident launching this without a system test?
Would there be a way to test that the different arguments to different methods of different canisters do not drift away from production?
Follows the review of the cloud engine configuration fetch: - name the operator lookup and its validation after what they do, and let them pass a `CanisterId` around rather than a bare `PrincipalId` - drop the `GatewayConfig` re-export, the unused `build` argument and the `pub(super)` on `OperatorApiError` - turn the `TryFrom<(HttpGatewayConfig, AcmeCredentials)>` conversion into a free `validate_gateway_config`, since it validates rather than casts - have `env_overlay` hand out the `OsString` map the process runner wants - create the ACME cache directory in `OrchestratorArgs::create_dirs`, next to the other directories the orchestrator owns - use `ic_types::time::current_time` for the last-success timestamp - spell out the operator's access control instead of naming its `isNode` cache, and clarify the control flow of the engine management canister id in `generate_ic_config`
…the review The engine operator canister answers `getHttpGatewayConfig` with `dns_api_urls : opt vec text`, while the orchestrator decoded a singular `dns_api_url : opt text`. Candid records key their fields by name hash, so the canister's value was dropped on decode and the configuration never completed: an all-in-one node logged "dns_api_url is not configured yet" forever and never launched ic-gateway. Carry the list end to end, into the comma-separated `ACME_DNS_IC_DNS_LB_URLS` that ic-gateway expects. Follows the rest of the review of the cloud engine configuration fetch: - collect the module's errors in `cloud_engine::error::CloudEngineError` and drop `OrchestratorError::CloudEngineError`, so the fetch path no longer converts between four error types on its way out - replace `AgentFactory` with free functions in `cloud_engine::agent`: the anonymous agent to an API boundary node needs nothing but the registry, and the node-signed one now belongs to `CloudEngineManager` itself - factor the node signing identity into `NodeSender::for_this_node`, which `registration` now shares - take the subnet from the `subnet_assignment` the upgrade loop publishes instead of resolving it a second time - take the engine management canister id and the replica URL as given, so the constructor no longer answers with an `Option` - rename `GatewayConfig` to `EngineConfig`, to tell the configuration the operator hands out apart from the static `IcGatewayProcessConfig` - restart ic-gateway whenever the configuration differs from the applied one, the way `IcBoundaryManager` does with the domain name - reject an engine management canister id that is no canister id while `ic.json5` is read, which `CanisterId`'s `Deserialize` does not do - cover the fetch outcomes of `CloudEngineManager` with unit tests Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
… comments Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…onfig # Conflicts: # rs/ic_os/config/tool/src/guestos/generate_ic_config.rs # rs/orchestrator/src/processes.rs # rs/orchestrator/src/upgrade.rs # rs/tests/driver/src/util.rs
There was a problem hiding this comment.
This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):
-
Update
unreleased_changelog.md(if there are behavior changes, even if they are
non-breaking). -
Are there BREAKING changes?
-
Is a data migration needed?
-
Security review?
How to Satisfy This Automatic Review
-
Go to the bottom of the pull request page.
-
Look for where it says this bot is requesting changes.
-
Click the three dots to the right.
-
Select "Dismiss review".
-
In the text entry box, respond to each of the numbered items in the previous
section, declare one of the following:
-
Done.
-
$REASON_WHY_NO_NEED. E.g. for
unreleased_changelog.md, "No
canister behavior changes.", or for item 2, "Existing APIs
behave as before.".
Brief Guide to "Externally Visible" Changes
"Externally visible behavior change" is very often due to some NEW canister API.
Changes to EXISTING APIs are more likely to be "breaking".
If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.
If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.
Reference(s)
For a more comprehensive checklist, see here.
GOVERNANCE_CHECKLIST_REMINDER_DEDUP
- No
unreleased_changelog.mdentry needed: no canister behavior changes. The only file under Governance ownership isrs/rust_canisters/cloud_engine_stub, a new test-only canister (testonly = True) used as a test double by the orchestrator's integration tests. It is not deployed. - No breaking changes: no existing API is touched.
- No data migration.
- No security review needed for this path: the stub has no production callers.
…or-fetch-cloud-engine-config
…strator test target
The canister supplies it as such
|
11828 bumped hickory-resolver to 0.26.3, which introduced a regression that causes a validated lookup to fail when two concurrently queried nameservers both return truncated UDP responses, as a workaround |
dfinity#11744) There is quite a lot going on in this PR. It is more of a `refactor` of the orchestrator's process manager but it still introduces the following functional changes (motivated by existing issues, thus `fix`): - Today, when `stop`ping a process, we just send a `SIGTERM` and instantly return. There's no guarantee that the process actually terminated, just that "it probably will in the future". This is great for not blocking the thread, but it is in contradiction with - The logic of stopping the replica before removing the state when leaving a subnet (today, there's technically a race where the state is removed while the replica is still running for a bit), - The logic of stopping-then-starting the replica when a recovery CUP is observed or the subnet ID changes, - The logic of stopping-then-starting `ic-boundary` when the domain name changes, - The [upcoming](dfinity#11349) logic of stopping-then-starting `ic-gateway` when its config changes. This PR thus modifies `stop` to block until the process actually terminated: if `stop` returned `Ok(())`, the process is guaranteed to have terminated, which fixes the cases above. - Moreover, `stop` does so by waiting up to 30 seconds, then tries again with `SIGKILL` for up to 10 seconds. This is in concordance with how systemd does it and allows force-killing a stuck process. This also means that this function could take up to 40 seconds to return, and blocks a tokio worker thread doing so (though I think that's acceptable since it should be very rare and the runtime has many threads). - The previous point means that the upgrade loop could hold a write-lock on `MultipleProcessesManager` for up to 40 seconds, preventing the dashboard from serving the processes' PIDs (that need a read-lock to that manager). Provide the dashboard with only a view of the processes' PIDs, not needing a lock on the entire manager. Also generalize over any number of processes with a type-erased `trait ProcessObserver`. - P.S.: We now display `ic-boundary`'s PID on the dashboard. - Today, the `stop_replica_if_recovery_cup_or_subnet_changed` function in the upgrade loop is fragile because it assumes we will always reach it on the iteration where we observe the recovery CUP or subnet-split. Though, if there was an error between the observation and that call, then the next iteration would not re-observe it and the replica would not be restarted (this was already mentioned [here](dfinity#11238)). - We fix this by moving this responsibility out of the upgrade loop and move it to every implementer of `Process`. This allows to simplify the upgrade loop and to remove the `IcBoundaryManager`'s custom restart logic by including it directly into `ProcessManager<P>` for any `P: Process`.
Cloud engines nodes will be "all-in-one" nodes. This means they don't just run the replica, but also
ic-gatewayand potentially alsoic-boundary. The orchestrator already supports running multiple processes, but we can't just startic-gateway, we also need to provide it with the right, engine-specific config. That's what this PR is doing:This PR adds an additional service to the orchestrator that fetches the HTTP Gateway config from the engine operator canister and uses it to run
ic-gateway.The config includes the domain names, DNS API URLs and API key (for the DNS-01 ACME challenge to obtain the certificates), and the ACME account. That's the bare minimum for
ic-gatewayto run. In the future, the config will be extended.The config is stored in the engine operator canister, which resides on the engine itself. The orchestrator first has to discover this canister using the engine management canister. Then, it needs to use the node's identity to make the call as the config is protected and can only be accessed by the nodes making up the engine.