Skip to content

feat: all-in-one nodes for cloud engines - #11349

Merged
r-birkner merged 31 commits into
masterfrom
rjb/make-orchestrator-fetch-cloud-engine-config
Oct 15, 2026
Merged

r-birkner merged 31 commits into
masterfrom
rjb/make-orchestrator-fetch-cloud-engine-config

Conversation

@r-birkner

@r-birkner r-birkner commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Cloud engines nodes will be "all-in-one" nodes. This means they don't just run the replica, but also ic-gateway and potentially also ic-boundary. The orchestrator already supports running multiple processes, but we can't just start ic-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-gateway to 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.

@github-actions github-actions Bot added the feat label Aug 27, 2026
@r-birkner
r-birkner marked this pull request as ready for review August 27, 2026 12:56
@r-birkner
r-birkner requested review from a team as code owners August 27, 2026 12:56
@zeropath-ai

zeropath-ai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 7c3df56.

Security Overview
Detected Code Changes

The diff is too large to display a summary of code changes.

@basvandijk basvandijk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve for the files under rs/tests/driver/src/driver/.

A PR description would be nice for a >2k diff ;)

@zeropath-ai

zeropath-ai Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 7c3df56.

Security Overview
Detected Code Changes

The diff is too large to display a summary of code changes.

@pierugo-dfinity pierugo-dfinity 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.

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?

Comment thread rs/config/src/cloud_engine.rs Resolved
Comment thread rs/orchestrator/src/error.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved
Comment thread rs/config/src/cloud_engine.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved

@frankdavid frankdavid 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.

👍🏻 for node

r-birkner and others added 10 commits September 4, 2026 07:27
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]>
…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
Comment thread rs/orchestrator/src/processes.rs Resolved
Comment thread rs/orchestrator/src/processes.rs Resolved
Comment thread rs/orchestrator/src/orchestrator.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved
Comment thread rs/orchestrator/src/cloud_engine/mod.rs Resolved
@r-birkner
r-birkner requested a review from a team as a code owner September 24, 2026 08:19

@github-actions github-actions 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.

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. 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

Comment thread rs/orchestrator/BUILD.bazel Resolved
Comment thread rs/orchestrator/Cargo.toml Resolved
@r-birkner
r-birkner dismissed github-actions[bot]’s stale review October 7, 2026 11:50
  1. No unreleased_changelog.md entry needed: no canister behavior changes. The only file under Governance ownership is rs/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.
  2. No breaking changes: no existing API is touched.
  3. No data migration.
  4. No security review needed for this path: the stub has no production callers.
@r-birkner
r-birkner dismissed blind-oracle’s stale review October 14, 2026 12:33

The canister supplies it as such

@r-birkner
r-birkner added this pull request to the merge queue Oct 15, 2026
Merged via the queue into master with commit 7546892 Oct 15, 2026
38 checks passed
@r-birkner
r-birkner deleted the rjb/make-orchestrator-fetch-cloud-engine-config branch October 15, 2026 08:46
@AleDema

AleDema commented Oct 19, 2026

Copy link
Copy Markdown

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 --dns-dnssec-disabled is passed to PocketIC's own gateway resolver, noting that nothing else in the repo validates DNSSEC because "the GuestOS ic-gateway sidecar is not launched". Now that this PR is merged, that is no longer true, the gateway is run on cloud engine nodes and its binary shipped with the replica is compiled with the faulty hickory version, so ic-gateway would exit on startup and the orchestrator would keep restarting it.

maksym-arutyunyan pushed a commit to maksym-arutyunyan/ic that referenced this pull request Oct 20, 2026
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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants