Skip to content

feat(gateway): add deploy_gateway_name and deploy_gateway_fqdn#2

Merged
ashraffouda merged 4 commits into
mainfrom
feat/gateway-deploy
May 19, 2026
Merged

feat(gateway): add deploy_gateway_name and deploy_gateway_fqdn#2
ashraffouda merged 4 commits into
mainfrom
feat/gateway-deploy

Conversation

@ashraffouda
Copy link
Copy Markdown

Closes the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.

What's added:

  • GatewayNameProxy::new() / validate() / zos_workload() and the same
    for GatewayFQDNProxy — forward conversion mirroring the existing
    from_workload() parsers.

  • workloads::Deployment now carries gateway_name_proxies and
    gateway_fqdn_proxies Vecs, included in zos_deployment() and
    validate().

  • grid_client::build_gateway_name_proxy / build_gateway_fqdn_proxy
    internal builders producing DeployWorkload with the correct JSON
    data shape ZOS expects (name/fqdn, tls_passthrough,
    backends, optional network).

  • Public request types GatewayNameDeployment / GatewayFqdnDeployment
    and the result type GatewayDeploymentOutcome.

  • GridClient::deploy_gateway_name(req) — submits a substrate name
    contract, polls grid_proxy for its id, then creates a node contract,
    RMB-deploys the workload, waits for ok, and reads back the
    assigned FQDN.

  • GridClient::deploy_gateway_fqdn(req) — skips the name-contract step
    (user owns the domain) and follows the rest of the flow.

  • GridClient::cancel_gateway(outcome) — convenience that deletes the
    RMB deployment and cancels both contracts.

  • Three new unit tests covering the workload round-trip and validation.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.comCloses the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.

What's added:

  • GatewayNameProxy::new() / validate() / zos_workload() and the same
    for GatewayFQDNProxy — forward conversion mirroring the existing
    from_workload() parsers.

  • workloads::Deployment now carries gateway_name_proxies and
    gateway_fqdn_proxies Vecs, included in zos_deployment() and
    validate().

  • grid_client::build_gateway_name_proxy / build_gateway_fqdn_proxy
    internal builders producing DeployWorkload with the correct JSON
    data shape ZOS expects (name/fqdn, tls_passthrough,
    backends, optional network).

  • Public request types GatewayNameDeployment / GatewayFqdnDeployment
    and the result type GatewayDeploymentOutcome.

  • GridClient::deploy_gateway_name(req) — submits a substrate name
    contract, polls grid_proxy for its id, then creates a node contract,
    RMB-deploys the workload, waits for ok, and reads back the
    assigned FQDN.

  • GridClient::deploy_gateway_fqdn(req) — skips the name-contract step
    (user owns the domain) and follows the rest of the flow.

  • GridClient::cancel_gateway(outcome) — convenience that deletes the
    RMB deployment and cancels both contracts.

  • Three new unit tests covering the workload round-trip and validation.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.comCloses the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.

What's added:

  • GatewayNameProxy::new() / validate() / zos_workload() and the same
    for GatewayFQDNProxy — forward conversion mirroring the existing
    from_workload() parsers.

  • workloads::Deployment now carries gateway_name_proxies and
    gateway_fqdn_proxies Vecs, included in zos_deployment() and
    validate().

  • grid_client::build_gateway_name_proxy / build_gateway_fqdn_proxy
    internal builders producing DeployWorkload with the correct JSON
    data shape ZOS expects (name/fqdn, tls_passthrough,
    backends, optional network).

  • Public request types GatewayNameDeployment / GatewayFqdnDeployment
    and the result type GatewayDeploymentOutcome.

  • GridClient::deploy_gateway_name(req) — submits a substrate name
    contract, polls grid_proxy for its id, then creates a node contract,
    RMB-deploys the workload, waits for ok, and reads back the
    assigned FQDN.

  • GridClient::deploy_gateway_fqdn(req) — skips the name-contract step
    (user owns the domain) and follows the rest of the flow.

  • GridClient::cancel_gateway(outcome) — convenience that deletes the
    RMB deployment and cancels both contracts.

  • Three new unit tests covering the workload round-trip and validation.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

ashraf and others added 4 commits May 19, 2026 12:51
Closes the gap that prevented Rust callers from deploying ZOS
gateway-name-proxy and gateway-fqdn-proxy workloads. The structs
existed already but only with from_workload() — there was no path to
push one onto the chain.

What's added:

- `GatewayNameProxy::new() / validate() / zos_workload()` and the same
  for `GatewayFQDNProxy` — forward conversion mirroring the existing
  from_workload() parsers.

- `workloads::Deployment` now carries `gateway_name_proxies` and
  `gateway_fqdn_proxies` Vecs, included in `zos_deployment()` and
  `validate()`.

- `grid_client::build_gateway_name_proxy` / `build_gateway_fqdn_proxy`
  internal builders producing DeployWorkload with the correct JSON
  data shape ZOS expects (`name`/`fqdn`, `tls_passthrough`,
  `backends`, optional `network`).

- Public request types `GatewayNameDeployment` / `GatewayFqdnDeployment`
  and the result type `GatewayDeploymentOutcome`.

- `GridClient::deploy_gateway_name(req)` — submits a substrate name
  contract, polls grid_proxy for its id, then creates a node contract,
  RMB-deploys the workload, waits for `ok`, and reads back the
  assigned FQDN.

- `GridClient::deploy_gateway_fqdn(req)` — skips the name-contract step
  (user owns the domain) and follows the rest of the flow.

- `GridClient::cancel_gateway(outcome)` — convenience that deletes the
  RMB deployment and cancels both contracts.

- Three new unit tests covering the workload round-trip and validation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The deploy_gateway_name/deploy_gateway_fqdn methods built the right
workload but signing the deployment then failed with
"unsupported live workload type gateway-name-proxy" — workload_challenge
in deployment.rs had no arms for the new types and bumped on the
default `other` branch.

Encoding order matches the Go SDK's Challenge() for the same workload
type: name (or fqdn) → backends... → tls_passthrough → network.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The previous arms used (name → backends → tls_passthrough → network),
which produced a different challenge byte sequence than the ZOS node
expected. The on-chain RMB deploy then failed with
`failed to verify signature`.

ZOS canonical order (pkg/gridtypes/zos/gw_name.go and gw_fqdn.go in
threefoldtech/zos v0.5.5): Name → TLSPassthrough → Backends, with no
`network` field. Updated both arms to match exactly, including the
`%t` boolean formatting used by Go's fmt.Fprintf.

Verified end-to-end on dev grid against gent02.dev.grid.tf — a
gateway-name-proxy now deploys to ready state and the assigned FQDN
is returned from the workload result.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ashraffouda ashraffouda merged commit 10d9eae into main May 19, 2026
1 check passed
@ashraffouda ashraffouda deleted the feat/gateway-deploy branch May 20, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant