Skip to content

feat(agent-relay): site values set once, every values problem in one report (chart 0.7.86) - #560

Merged
khaliqgant merged 2 commits into
mainfrom
feat/selfhost-site-values
Nov 27, 2026
Merged

khaliqgant merged 2 commits into
mainfrom
feat/selfhost-site-values

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The Automation Anywhere by-hand rehearsal (examples/aws copied to values-poc.yaml) failed mostly on partial edits: the domain is typed on 12 lines, the region on 7, the bucket on 5, the OpenSearch URL on 2. The operator changed some copies and not others, then met the chart's checks one helm install at a time.

Site values: each fact once

site:
  domain: relay.acme.com          # <domain>, api., cast., history.<domain>
  region: us-east-1
  sessionsBucket: acme-agent-relay-sessions
  opensearchUrl: https://vpc-agent-relay-abc123.us-east-1.es.amazonaws.com
  orgId: org_acme
  orgName: Acme
  adminEmail: admin@acme.com
  rds: true                       # feeds global.rdsCa.bundle (#553) from region
  # hosts: { dashboard: app.acme.com }   # optional per-host override

The umbrella fills every component value that repeats one of these (README "Site values" has the table): Relaycast baseUrl; Control publicUrl, dashboardUrl, relaycast/sessionReadApi public URLs, introspection audiences, bootstrap; the dashboard publicUrl; the read API origin, CORS, OpenSearch URL/region and LOCKER_BUCKET/LOCKER_REGION; the ingest edge origin and locker; the search indexer locker and OpenSearch; worker/alleyoop locker and historyOrigin; nativeConsumer/nativeRouting when on; global.tenant.orgId in every chart; global.rdsCa.bundle with rds; eksIngress/gkeIngress/traefikIngress hosts when that edge is on.

  • Backward compatible. Empty site keys fill nothing. The old long-form examples/aws (kept as ci/agent-relay/fixtures/aws-long-form-values.yaml) renders byte-identically, and the subdomain golden (no-site profiles, AKS doc values) is unchanged.
  • Overrides. A component value that is empty, or still what a chart profile ships at that path (values-eks.yaml's placeholder.company hosts, example bucket, example-org), takes the site value. A profile region such as us-west-2 counts as an example only while its bucket/URL is one too, so a real us-west-2 next to a real endpoint wins. Values that may differ (OpenSearch region, CORS, audiences, bootstrap, rdsCa.bundle) keep the explicit value.
  • Contradictions fail. Where values must agree (hosts/origins, bucket, bucket region, OpenSearch URL, orgId) an explicit value that differs fails with both values and the fix.

One report with every problem

Helm hands a parent's values to subcharts only through global, and it stops at the first fail. So the umbrella does the work in one template, templates/site/runs-before-subcharts/1/2/3/4/5/site.yaml. Helm renders the deepest template path first (engine sortTemplates), and each subchart's .Values is the same map as the umbrella's .Values.<subchart>. The template therefore runs before every subchart template, fills the derived values, collects every problem it can see, and fails once. Problems it collects: site values (format, .internal/example domains, a missing https://, bad bucket/region, unknown keys), contradictions, and mirrored copies of the subchart checks the rehearsal hit one at a time (read API origin, OpenSearch URLs/region, ingest origin == read origin, LOCKER_BUCKET == ingestEdge bucket, required bucket/region, Control public URLs). The mirrored checks are no stricter than the subcharts' own, which still run. One bad site value is reported once, not once per derived copy. Checks it does not mirror still fail one at a time, after the list is clear.

The rehearsal's mistakes (history origin still on example.com, OpenSearch without https://, the ingest bucket edited but LOCKER_BUCKET not) now fail once, from check-values.sh or helm:

agent-relay: 5 values problems. Nothing was installed. Fix all of them, then run helm again
(scripts/selfhost/check-values.sh lists them without a cluster):

1. sessions-pipeline.sessionReadApi.origin = "https://history.ar.example.com"
   must be a public HTTPS origin: https:// plus a public multi-label DNS name, with no path, credentials, query or fragment; .internal, .local, .lan, .test, .example, .localhost, .invalid, .home.arpa, .onion and example.com/.net/.org names are refused
   fix: set site.domain (it gives https://history.<domain>), or fix this value

2. sessions-pipeline.sessionReadApi.search.opensearch.url = "vpc-agent-relay-example.us-east-1.es.amazonaws.com"
   must be a base HTTPS origin (https://<domain endpoint>, no path or trailing slash)
   fix: set site.opensearchUrl to https://<the OpenSearch domain endpoint>

3. sessions-pipeline.ingestEdge.origin = "https://history.ar.example.com"
   must be a public HTTPS origin: https:// plus a public multi-label DNS name, with no path, credentials, query or fragment; .internal, .local, .lan, .test, .example, .localhost, .invalid, .home.arpa, .onion and example.com/.net/.org names are refused; lowercase, and no :443
   fix: set site.domain (it gives https://history.<domain>), or fix this value

4. sessions-pipeline.sessionReadApi.extraEnv LOCKER_BUCKET = "example-agent-relay-sessions"
   must equal sessions-pipeline.ingestEdge.locker.bucket ("aa-relay-sessions"): the read API reads the objects the ingest edge writes
   fix: set site.sessionsBucket once and delete LOCKER_BUCKET and every locker.bucket

5. sessions-pipeline.searchIndexer.search.opensearch.url = "vpc-agent-relay-example.us-east-1.es.amazonaws.com"
   must be an https endpoint, lowercase, with no path, trailing slash, credentials or query
   fix: set site.opensearchUrl to https://<the OpenSearch domain endpoint>

ci/agent-relay/test_site_values.py fails if any template in the built chart becomes as deep as site.yaml, or if the report stops coming out before a subchart's own failure. Single-host mode takes CORS and dashboardUrl from the single host. Verified on Helm 3.10.3, 3.16.4, 4.1.1 and 4.3.1.

check-values.sh

scripts/selfhost/check-values.sh -f ... -f values.yaml (same files as helm, no cluster) lists example values left in the operator's own files by file:line (the same markers as diagnose-install.py), then the chart's report. Exit 0/1/2. It ships in the customer handoff.

Also

  • examples/aws/values.yaml uses the short form and renders byte-identically to the long form (the fixture). The GKE and AKS guides' values.yaml stay in the long form: those guides install a pinned released chart with the checkout's files, so they move when their pin does. ci/agent-relay/fixtures/gcp-site-values.yaml is the GKE file in the short form, and tests render it; it was byte-identical to the long form through a managed-values stub. The Azure conversion was golden-identical too and is left for the pin bump.
  • ci/rds-ca: the BYO and legacy cases also turn site.rds off, since the example now enables the managed CA that way.
  • Registry: opt.agent-relay.site-values, plus the matrix entry. README, examples/aws README, scripts/selfhost README and self-hosted-eks.md are updated.
  • Chart.yaml dependency entries are untouched; only the umbrella version is bumped. No lock file changes.

Not verified: a live helm install on a cluster. The new behaviour is render-time only, and rendering is covered above.

Docs follow in a draft PR in AgentWorkforce/agentrelay.com. It depends on the infra release after the one being cut from current main.

🤖 Generated with Claude Code

…report (chart 0.7.86)

The Automation Anywhere rehearsal failed on partial edits of values typed on
up to 12 lines (domain), 7 (region), 5 (bucket) and 2 (OpenSearch URL), and
met the chart's checks one helm install at a time.

- Top-level site: domain (or hosts), region, sessionsBucket, opensearchUrl,
  orgId, orgName, adminEmail, rds. The umbrella fills every component value
  that repeats one (README "Site values"), including global.tenant.orgId in
  every chart and global.rdsCa.bundle from region with rds: true. Empty keys
  fill nothing: the old long form renders byte-identically
  (ci/agent-relay/fixtures/aws-long-form-values.yaml). Profile examples count
  as unset; a value that must agree with site and differs fails the render.
- templates/site/.../site.yaml is the deepest template path, so Helm renders
  it before any subchart: it fills the values (a subchart's .Values is the
  umbrella's .Values.<subchart> map) and fails once with every problem it can
  see, mirroring the subchart checks the rehearsal hit one at a time.
- scripts/selfhost/check-values.sh: the same list with no cluster, plus
  example values left in the operator's files by line.
- examples/aws, docs/gcp-install and docs/azure-install values use the short
  form and render byte-identically to the long form.
- ci/rds-ca: the BYO and legacy cases turn site.rds off too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39d1b6cc-402d-433c-8c47-90ec3a850aae
Commits

Reviewing files that changed from the base of the PR and between 9f53007 and 2203d1f.

Files selected for processing: 21

  • .github/workflows/fast-path.yml
  • .github/workflows/lint.yml
  • charts/agent-relay/Chart.yaml
  • charts/agent-relay/README.md
  • charts/agent-relay/templates/_site.tpl
  • charts/agent-relay/templates/site/runs-before-subcharts/1/2/3/4/5/site.yaml
  • charts/agent-relay/values.yaml
  • ci/agent-relay/fixtures/aws-long-form-values.yaml
  • ci/agent-relay/fixtures/gcp-site-values.yaml
  • ci/agent-relay/test_site_values.py
  • ci/rds-ca/legacy-values.yaml
  • ci/rds-ca/test.sh
  • docs/self-hosted-eks.md
  • docs/self-hosted-requirements.md
  • examples/aws/README.md
  • examples/aws/values.yaml
  • scripts/package-customer-handoff.sh
  • scripts/selfhost/README.md
  • scripts/selfhost/check-values.sh
  • scripts/selfhost/configure-rds.sh
  • self-hosted/requirements.yaml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5 · The PR appears safe to merge; all three previous findings are fixed and no new actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; all three previous findings are fixed and no new actionable issues were found.

Summary

Adds site: values to set shared deployment facts once and report multiple values problems together.

  • The chart fills repeated site settings and reports values problems together.
  • Operators can check values files for examples and chart problems without a cluster.

Reviews (2) · Last reviewed commit: "fix(agent-relay): review fixes for site ..." · Reviewed by Greptile

Comment thread scripts/selfhost/check-values.sh Resolved

@devin-ai-integration devin-ai-integration 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.

Devin Review found 5 potential issues.

Devin Review

Comment thread docs/gcp-install/values.yaml Outdated
Comment on lines +29 to +37
site:
domain: __DOMAIN__
region: __REGION__
sessionsBucket: __SESSIONS_BUCKET__
# Stable organization ID that partitions session data. Never change it after
# the first upload.
orgId: __ORG_ID__
orgName: __ORG_NAME__
adminEmail: __ADMIN_EMAIL__

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.

🔴 Pinned GKE and AKS installs fail

The GKE install and AKS install pass site values to chart 0.7.81. That chart ignores site, leaving required origins and storage settings unset or at placeholder values.

Learn more

Both guides use the checkout’s values files, but they download and install a specific release chart. The GKE install passes the new values to 0.7.81. The AKS chart download pins the same chart, then the AKS install passes the new AKS overlay to it. Neither chart derives values from site. In GKE, for example, the read API environment replaces Terraform’s list and leaves LOCKER_BUCKET without a value or valueFrom, which read API validation rejects. In AKS, the ingest locker inherits an anchor that no longer supplies a bucket.

Example: Fill the GKE guide’s placeholders with a real domain, bucket, and region, then run step 11. The pinned chart never copies the bucket into the read API’s LOCKER_BUCKET, so Helm rejects the install even though the site file is complete.

Recommended fix: Keep separate long-form values files for the pinned releases or move both guides and their release pins to published versions that support site. Test each guide’s actual file order against its pinned chart.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right: both guides take the checkout's values.yaml but install the pinned 0.7.81 chart. Reverted docs/gcp-install/values.yaml and docs/azure-install/values.yaml to the long form in 2203d1f. The GKE short form moves to ci/agent-relay/fixtures/gcp-site-values.yaml, which the tests render; the guides switch when their pin moves to a release with site values.

Comment on lines +68 to +70
{{- $region := $site.region | default "" -}}
{{- if and $region (not (regexMatch "^[a-z]{2}(-[a-z0-9]+)+-?[0-9]+$" $region)) -}}
{{- include "agent-relay.site.problem" (dict "st" $st "where" "site.region" "value" $region "why" "must be a cloud region name such as us-east-1" "fix" "set the region of the sessions bucket and OpenSearch domain") -}}

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.

🔴 Valid GKE regions block installation

The GKE guide puts the selected region in site.region. The two-letter prefix check rejects valid regions such as europe-west1 before Helm renders.

Learn more

Example: Set REGION=europe-west1 when filling the GKE values file. The generated site.region fails validation even when the Terraform bucket and cluster are in that region.

Recommended fix: Accept GCP-style prefixes in both copies of the generic region check, preferably by sharing one predicate. Keep the existing AWS-specific validation for OpenSearch and RDS.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2203d1f: site.region now accepts GCP region names (europe-west1, australia-southeast1, asia-south1) as well as AWS ones; the AWS-only OpenSearch and RDS checks are unchanged. Covered by test_region_names and the GKE render test, which now uses europe-west1.

Comment on lines +192 to +195
{{- if and $domain (empty $hostsIn) (empty (dig "hosts" (dict) $V.eksIngress)) -}}
{{- $d = append $d (dict "path" (list "eksIngress" "domain") "value" $domain "from" "site.domain" "must" true) -}}
{{- else if and $hosts.history (not (dig "domain" "" $V.eksIngress)) -}}
{{- $d = append $d (dict "path" (list "eksIngress" "hosts") "value" $hosts "from" "site.domain and site.hosts" "must" true) -}}

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.

🔴 EKS routes miss overridden hostnames

Adding site.hosts while retaining eksIngress.domain changes the service URLs but skips ingress host derivation and validation. The ALB rules still use the original domain, leaving the advertised hosts without matching routes.

Learn more

The chart derives component URLs per role from the site block, but the EKS ingress accepts either a base domain or explicit hosts. When site.hosts is nonempty and eksIngress.domain is already set, the derivation enters neither branch. The primary ALB edge then generates its routes from the base domain alone.

Example: An install uses eksIngress.domain: relay.acme.com. The operator adds site.domain: relay.acme.com and site.hosts.dashboard: app.acme.com. The dashboard advertises https://app.acme.com while the ALB only routes the dashboard host relay.acme.com.

Recommended fix: Resolve the effective EKS hosts from whichever ingress mode is configured and compare them per role against the site hosts. Report contradictions before rendering; keep domain mode when the effective hosts match.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2203d1f: with site.hosts set and an explicit eksIngress.domain, the chart now checks each host eksIngress.domain gives against the one site gives that role, and fails naming both (fix: delete eksIngress.domain, and site fills eksIngress.hosts). test_eks_ingress_domain_that_disagrees_with_site_hosts_fails covers the conflict and the filled hosts.

{{- $readApiOn := dig "sessionReadApi" "enabled" false $sp -}}
{{- if $readApiOn -}}
{{- $d = append $d (dict "path" (concat $spPath (list "sessionReadApi" "origin")) "value" $origin.history "from" $hostSource.history "must" true) -}}
{{- $d = append $d (dict "path" (concat $spPath (list "sessionReadApi" "cors" "allowedOrigins")) "value" (ternary (list $origin.dashboard) (list) (ne $origin.dashboard "")) "from" $hostSource.dashboard "must" false) -}}

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.

🔴 Single-host dashboard loses session reads

When the shared host differs from the site dashboard host, cors.allowedOrigins defaults to the site dashboard host. The dashboard uses the shared host, so browsers block its direct session reads.

Learn more

The dashboard’s direct read mode sends browser requests from the dashboard origin to the separate History origin. Those requests require the dashboard’s origin in the read API’s CORS allowlist. The dashboard URL helper uses global.singleHost.host in single-host mode, but site derivation still fills the allowlist from site.domain or site.hosts.dashboard.

Example: Set site.domain: relay.acme.com and global.singleHost.host: app.acme.com. With direct reads enabled and no explicit CORS list, the application opens on app.acme.com but the read API only allows https://relay.acme.com.

Recommended fix: Use the effective shared dashboard origin when deriving the CORS list in single-host mode. Preserve explicit allowlists and leave no-site renders unchanged.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2203d1f: in single-host mode the read API's CORS origin and Control's dashboardUrl come from global.singleHost.host, and profile placeholders in relay-control.publicUrl and relay-webapp.runtime.publicUrl are emptied, since the single host derives them. test_single_host_cors_is_the_single_host covers it.

Comment on lines +68 to +69
{{- $region := $site.region | default "" -}}
{{- if and $region (not (regexMatch "^[a-z]{2}(-[a-z0-9]+)+-?[0-9]+$" $region)) -}}

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.

🟡 Malformed values suppress the full report

An unquoted number in site.region reaches regexMatch after the validator records the type error. Helm aborts without printing either that diagnostic or the other collected problems.

Learn more

Example: Set site.region: 123 and misspell site.orgId as site.orgID. Both checks record problems, but the later string-only region check aborts rendering before either problem is printed. Non-string values in other fields used directly by regexMatch, such as site.sessionsBucket and site.opensearchUrl, have the same failure mode.

Recommended fix: After recording each wrong-type value, exclude it from derivation and format checks. Preserve the original in the recorded diagnostic, and add a regression test that expects the aggregate report.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In 2203d1f: a wrong-typed value was already reported (--set site.region=123 aggregates rather than aborting, because the value is stringified after it is recorded), but it was then reported a second time by the format check. Now its format check and the values derived from it are skipped, so it is one problem. test_wrong_type_is_one_problem covers it.

- site.region accepts GCP names (europe-west1, australia-southeast1) as well
  as AWS ones; the OpenSearch and RDS checks stay AWS-only.
- site.hosts with an explicit eksIngress.domain: each host eksIngress.domain
  gives must be the one site gives that role, else the render fails (the ALB
  would serve other names than Control advertises).
- Single-host mode: the read API's CORS origin and Control's dashboardUrl come
  from the single host, and profile placeholders in the publicUrls the single
  host derives are emptied.
- A wrong-typed site value is one problem: its format check and the values
  derived from it are skipped.
- check-values.sh recognizes the chart's own profiles by name, so it works in
  the customer handoff without git; a test keeps the list equal to the chart's
  values*.yaml.
- docs/gcp-install and docs/azure-install values.yaml stay in the long form:
  those guides install a pinned released chart with the checkout's files. The
  GKE short form is ci/agent-relay/fixtures/gcp-site-values.yaml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@khaliqgant
khaliqgant merged commit ce50200 into main Nov 27, 2026
11 checks passed
@khaliqgant
khaliqgant deleted the feat/selfhost-site-values branch November 27, 2026 02:18
khaliqgant added a commit that referenced this pull request Nov 27, 2026
…ne run: Pod Identity preflight, in-cluster search readiness, one final table

Khaliq's bar: from Automation Anywhere's broken state to fully green in one
run, with no manual follow-ups.

A. Pod Identity preflight, before anything destructive (including
   --reset-databases), reusing #558's checks in diagnose-install.py:
   - `diagnose-install.py --only pod-identity` checks every ServiceAccount the
     release's workloads use for S3 or OpenSearch (worker,
     session-ingest-api, session-read, search-indexer, alleyoop where
     rendered).
   - A missing association stops configure-rds.sh with the exact
     `aws eks create-pod-identity-association ...` line and the access the
     role needs; nothing has been changed at that point.
   - Opt-in POD_IDENTITY_ROLES="sa=roleArn,..." (diagnose
     --create-pod-identity) creates the missing ones and restarts their
     Deployments. A failed create (no eks:CreatePodIdentityAssociation or
     iam:PassRole) is a FAIL with the manual line.
   - No AWS credentials, or not EKS: reported UNKNOWN with the manual
     command, and the run goes on unless POD_IDENTITY_STRICT=1.
   - The check runs again after helm, for fresh installs.

B. Search readiness, from inside the cluster (`--only search`, and part of a
   full run):
   - The search bootstrap Job: its status and recorded cause, with the fix.
     The cause is the guard's termination message from #554;
     permission-denied causes point to rds-setup.sh post.
   - One signed GET /_cluster/health as the search indexer's ServiceAccount,
     in the release's services image, using its own Pod Identity credential
     source and SigV4 signer. It runs through #559's run_in_cluster, now
     generic over the Job builder and parser. Classified as:
     - unreachable (DNS/network/security group);
     - no AWS credentials;
     - 403 from fine-grained access control, with the exact
       relayhistory_indexer role and rolesmapping PUT bodies (the role ARN
       with and without its IAM path) from install step 7;
     - 403 from the domain access policy;
     - 401 (signing region).

C. The final verdict reflects workloads: after the rollouts, the full
   diagnostic (--scope all) and helm test become one table (migrations,
   Secrets, database logins + CA, Pod Identity, S3, search bootstrap,
   OpenSearch auth, workloads, values, helm test). configure-rds.sh exits 0
   only when every row passes, and keeps the report as
   STATE_DIR/last-install-diagnostic.json. Works with HELM_CHART=oci://...
   (#557) and the site: block (#560).

The diagnostic is resolved once: the copy next to the script, else the
release tag's, else the old pin. Its --only sections are feature-detected,
so an older release's copy skips them with a note.

Tests:
- configure-rds-chart-test.sh: 15/15, 6 new. A missing association stops
  before any Secrets Manager write, rds-setup.sh or helm. POD_IDENTITY_ROLES
  creates it and the run continues. No credentials goes on, and stops under
  POD_IDENTITY_STRICT. FGAC 403 gives a FAIL row with the rolesmapping body
  and a non-zero exit; unreachable gives a FAIL row; success gives PASS
  rows.
- diagnose tests: 62, 8 new (create; failed create; FGAC 403 with both ARN
  forms; FGAC via assumed role; domain-policy 403;
  unreachable/no-credentials/success; bootstrap cause; probe parser).
- The bun probe ran for real in the pinned services image: without
  credentials it reports no-credentials. With a fake credentials endpoint
  it signs and fetches: an unknown domain gives ENOTFOUND (classified
  unreachable) and a live host gives its HTTP status.
- bash -n on bash 3.2 and 5, shellcheck clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
khaliqgant added a commit that referenced this pull request Nov 27, 2026
…ne run (Pod Identity preflight, in-cluster search readiness, slow-auth probe, one final table) (#561)

* fix(support): the cluster probe gets at least 30s, and slow exec-plugin credentials aren't called unreachable

Root cause, from the coordinator: find_cluster() ran its probe with
probe=True, which capped kubectl at min(--timeout, 8)s. With kubeconfig auth
through `aws eks get-token` and a slow credential_process, one `kubectl get
secret` takes ~14s (measured: real 0m13.876s). The probe always timed out and
every workload and Pod Identity check was skipped, while the in-cluster
database Job, which uses the full timeout, still worked.

- Each probe attempt gets max(--timeout, 30)s, with one retry after 5s. The
  probe never runs below --timeout.
- When every attempt times out and the kubeconfig user authenticates
  through an exec plugin (kubectl config view --minify), the note says so:
  "This kubeconfig authenticates through an exec plugin (aws), so this is
  most likely slow credentials ..., not an unreachable cluster. Refresh the
  credentials or rerun with --timeout 90." Otherwise it still says "not
  reachable", with the time taken.
- Unchanged: skipped workload checks end in RESULT: INCOMPLETE, exit 3.

Tests (real subprocesses with a fake kubectl on PATH): a kubectl that takes
12s per call is found reachable with no "not reachable" note. A timeout with
an aws exec plugin says slow credentials. --timeout 90 is honoured. The
retry-then-INCOMPLETE test now asserts 2 attempts at 30s. Diagnose tests:
52/52. docs/support/diagnose-install.md covers exit 3, the RESULT line and
slow credentials.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(selfhost): configure-rds.sh takes a broken install to green in one run: Pod Identity preflight, in-cluster search readiness, one final table

Khaliq's bar: from Automation Anywhere's broken state to fully green in one
run, with no manual follow-ups.

A. Pod Identity preflight, before anything destructive (including
   --reset-databases), reusing #558's checks in diagnose-install.py:
   - `diagnose-install.py --only pod-identity` checks every ServiceAccount the
     release's workloads use for S3 or OpenSearch (worker,
     session-ingest-api, session-read, search-indexer, alleyoop where
     rendered).
   - A missing association stops configure-rds.sh with the exact
     `aws eks create-pod-identity-association ...` line and the access the
     role needs; nothing has been changed at that point.
   - Opt-in POD_IDENTITY_ROLES="sa=roleArn,..." (diagnose
     --create-pod-identity) creates the missing ones and restarts their
     Deployments. A failed create (no eks:CreatePodIdentityAssociation or
     iam:PassRole) is a FAIL with the manual line.
   - No AWS credentials, or not EKS: reported UNKNOWN with the manual
     command, and the run goes on unless POD_IDENTITY_STRICT=1.
   - The check runs again after helm, for fresh installs.

B. Search readiness, from inside the cluster (`--only search`, and part of a
   full run):
   - The search bootstrap Job: its status and recorded cause, with the fix.
     The cause is the guard's termination message from #554;
     permission-denied causes point to rds-setup.sh post.
   - One signed GET /_cluster/health as the search indexer's ServiceAccount,
     in the release's services image, using its own Pod Identity credential
     source and SigV4 signer. It runs through #559's run_in_cluster, now
     generic over the Job builder and parser. Classified as:
     - unreachable (DNS/network/security group);
     - no AWS credentials;
     - 403 from fine-grained access control, with the exact
       relayhistory_indexer role and rolesmapping PUT bodies (the role ARN
       with and without its IAM path) from install step 7;
     - 403 from the domain access policy;
     - 401 (signing region).

C. The final verdict reflects workloads: after the rollouts, the full
   diagnostic (--scope all) and helm test become one table (migrations,
   Secrets, database logins + CA, Pod Identity, S3, search bootstrap,
   OpenSearch auth, workloads, values, helm test). configure-rds.sh exits 0
   only when every row passes, and keeps the report as
   STATE_DIR/last-install-diagnostic.json. Works with HELM_CHART=oci://...
   (#557) and the site: block (#560).

The diagnostic is resolved once: the copy next to the script, else the
release tag's, else the old pin. Its --only sections are feature-detected,
so an older release's copy skips them with a note.

Tests:
- configure-rds-chart-test.sh: 15/15, 6 new. A missing association stops
  before any Secrets Manager write, rds-setup.sh or helm. POD_IDENTITY_ROLES
  creates it and the run continues. No credentials goes on, and stops under
  POD_IDENTITY_STRICT. FGAC 403 gives a FAIL row with the rolesmapping body
  and a non-zero exit; unreachable gives a FAIL row; success gives PASS
  rows.
- diagnose tests: 62, 8 new (create; failed create; FGAC 403 with both ARN
  forms; FGAC via assumed role; domain-policy 403;
  unreachable/no-credentials/success; bootstrap cause; probe parser).
- The bun probe ran for real in the pinned services image: without
  credentials it reports no-credentials. With a fake credentials endpoint
  it signs and fetches: an unknown domain gives ENOTFOUND (classified
  unreachable) and a live host gives its HTTP status.
- bash -n on bash 3.2 and 5, shellcheck clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(selfhost): review fixes for the one-run installer (#561)

From Greptile, Devin and CodeRabbit on #561, and Devin on agentrelay.com#344:

diagnose-install.py
- find_cluster keeps every attempt's error. It gives the slow-credentials
  message only when every attempt timed out, and also names a stalled VPN
  connection as the other cause.
- The --only sections probe the namespace's default ServiceAccount, not
  agent-relay-secrets, and count NotFound/Forbidden as an answer. A fresh
  install (no Secret yet) or a narrow Role no longer reads as "cluster
  unreachable". kubectl's (NotFound) now has its own category.
- The search probe Job carries the indexer's imagePullSecrets, so a private
  image pulls.

configure-rds.sh
- The final table counts cast./control./hoop. database checks and adds an
  "other checks" row for anything unmapped. A non-zero diagnostic exit adds
  a diagnostic row when nothing else failed, so a failed or partial
  diagnostic never becomes HEALTHY.
- The Pod Identity stop says which stage it is ("Nothing has been changed
  yet" only before any change) and lists the associations created in this
  run. It restarts their pods before stopping.
- A failed rollout restart prints the exact command and stays pending; the
  final table has a failing "pod restarts" row until it's done.
- POD_IDENTITY_STRICT=1 also stops when the release's diagnostic has no
  --only sections.
- The post-helm Pod Identity check runs after both the automatic and the
  manual helm paths.
- A fresh install creates the namespace when the cluster answers NotFound,
  instead of stopping before rds-setup.sh pre could create it.

Tests: configure-rds-chart-test.sh 17/17 (new: the namespace is created on a
fresh install; a partial POD_IDENTITY_ROLES restarts what it created, then
stops naming it). Diagnose tests: the earlier error stays visible on a mixed
failure; --only counts NotFound as an answer and never reads the Secret; the
probe carries pull secrets. shellcheck and bash -n (3.2 and 5) are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(selfhost): keep pending Pod Identity restarts across runs; don't claim nothing changed after creating associations

CodeRabbit on #561:
- A failed rollout restart is written to STATE_DIR/pending-pod-identity-restarts and
  retried on the next run (the diagnostic won't report CREATED again for an existing
  association); the file is removed once every restart succeeds, and the final table
  keeps a failing 'pod restarts' row until then.
- The stop after a partial POD_IDENTITY_ROLES says 'Only Pod Identity associations have
  been created so far: <sa>' instead of 'Nothing has been changed yet'.

configure-rds-chart-test.sh 18/18 (new: a pending restart from an earlier run is retried
and cleared).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
khaliqgant added a commit to AgentWorkforce/agentrelay.com that referenced this pull request Nov 27, 2026
…); values.yaml sets each site fact once

- EKS pins move to agent-relay-2026.11.22 (infra 95e810db, chart 0.7.87),
  which carries site values (AgentWorkforce/infra#560). Image digests are
  unchanged: the release pins the same four images.
- files/eks/values.yaml takes the domain, region, bucket, OpenSearch URL,
  org, admin and the RDS CA (rds: true) once, in a site: block. With the
  release's chart it renders byte-identically to the previous template filled
  with the same values. The step 9 sed line is unchanged: each placeholder
  now appears once.
- Step 9 runs scripts/selfhost/check-values.sh against the pulled chart; it
  lists every values problem at once, with no cluster. Troubleshooting covers
  the aggregated helm failure.
- GKE and AKS stay on agent-relay-2026.11.19 (chart 0.7.81), which predates
  site values, so their templates and steps are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
khaliqgant added a commit to AgentWorkforce/agentrelay.com that referenced this pull request Nov 27, 2026
…); values.yaml sets each site fact once (#345)

* docs(self-hosting): EKS guide on agent-relay-2026.11.22 (chart 0.7.87); values.yaml sets each site fact once

- EKS pins move to agent-relay-2026.11.22 (infra 95e810db, chart 0.7.87),
  which carries site values (AgentWorkforce/infra#560). Image digests are
  unchanged: the release pins the same four images.
- files/eks/values.yaml takes the domain, region, bucket, OpenSearch URL,
  org, admin and the RDS CA (rds: true) once, in a site: block. With the
  release's chart it renders byte-identically to the previous template filled
  with the same values. The step 9 sed line is unchanged: each placeholder
  now appears once.
- Step 9 runs scripts/selfhost/check-values.sh against the pulled chart; it
  lists every values problem at once, with no cluster. Troubleshooting covers
  the aggregated helm failure.
- GKE and AKS stay on agent-relay-2026.11.19 (chart 0.7.81), which predates
  site values, so their templates and steps are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(self-hosting): review fixes for the EKS site-values template

- rdsLayout: separate-database, as the release's examples/aws has it: chart
  0.7.87's database guard refuses the dedicated HoopDb owner rds-setup.sh
  creates without it.
- The site placeholders are quoted, so a numeric org ID or an org name such
  as yes stays a string.
- Step 9 notes the check needs Helm 3.13 or later: an older Helm renders for
  Kubernetes 1.25 offline, below the chart's 1.28 minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(self-hosting): RDS CA text follows site.rds; name the chart that reads it

CodeRabbit review: the guide still said to delete an rdsCa block the template
no longer has, and with site.rds: true the chart creates rds-ca, so bringing
your own CA now sets site.rds: false. Troubleshooting names the first chart
for site.rds (0.7.87) and for global.rdsCa.bundle (0.7.85).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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