Repository navigation
55/66-run-a-single-adapter-through-the-helm-charts-and-run-a-single-adapter-at-the-network-layer-in-docker-compose - #75
Conversation
…-adapter stack Run the consumer, network and provider tiers as modules of ONE adapter (network-layer-adapter) with in-process (inproc://) tier hops, next to the existing three-adapter stack, which is unchanged. - docker-compose.unified-network-layer.yml: full stack with the three adapters replaced by network-layer-adapter (port 9210 on 127.0.0.1) - docker-compose.unified-network-layer-http.yml: optional overlay that sends tier hops over http://localhost instead (any image, HTTP=1) - config/adapters/unified-network-layer/: overrides.yaml (module names, paths, routing file, extended schema, appName, port) plus routing-inproc.yaml (default) and routing-http.yaml - bin/setup.py: builds unified-network-layer.yaml from the three tier templates plus overrides.yaml, so tier changes reach both modes; each module keeps its own tier identity; PyYAML imported lazily - bin/stack.sh, Makefile: make up-/down-unified-network-layer [HTTP=1], failing early when the inproc image is missing - bin/unified-network-layer-up.sh: build the inproc adapter image, start the stack and smoke-test publish, discover and select - .env.example: UNIFIED_NETWORK_LAYER_ADAPTER_PORT and _IMAGE - README: "Unified network layer" section - .gitignore: rendered config, local demo/bench scripts, Apple-silicon override, .bench/ results, local Postman exports
…er-module routing
Tier hops in the unified network layer (the unified single adapter) now go
over loopback HTTP to the container's own listener instead of inproc://, so
any adapter image works and the config has the same shape as the
multi-adapter stack -- split across containers, only the hosts change.
- Routing: one file per module, as in the multi-adapter stack
- consumer: single-network-layer-consumer-routing.yaml
(discover -> localhost:9200/network, select/init/confirm/status ->
localhost:9200/provider)
- network: reuses the multi-adapter routing-network.yaml unchanged
(discover, publish -> discovery-service)
- provider-publish: single-network-layer-publish-routing.yaml
(-> localhost:9200/network/publish)
- overrides.yaml: routingConfig per module; setup.py fails if a module
with a router has none
- Remove routing-inproc.yaml, routing-http.yaml, the -http compose overlay
and HTTP=1
- .env/.env.example: drop UNIFIED_NETWORK_LAYER_ADAPTER_PORT/_IMAGE; the
stack uses ADAPTER_IMAGE like multi mode
- Service and container renamed to network-layer-adapter (appName and
OTEL service name match); host port 127.0.0.1:9200
- make up stops network-layer-adapter first, and the unified paths stop the
multi adapters first, since both publish 9200
- bin/unified-network-layer-up.sh: no image build; starts the stack and
smoke-tests publish, discover and select
- README: unified network layer section updated
- unified-network-layer-up.sh: self-contained publish/discover/select smoke test instead of the untracked poc-flow.py; stop hiding setup errors; confirm the rendered config exists before starting - setup.py: missing PyYAML is fatal when rendering the unified network layer (UNIFIED_NETWORK_LAYER=1), still a skip for multi mode - stack.sh: PyYAML preflight and a rendered-config file check before starting network-layer-adapter, so compose never creates a directory at the bind-mount path - bootstrap-ubuntu.sh and README: install/list PyYAML; drop untracked tools from the README - docker-compose.unified-network-layer.yml: -f on profile commands; correct stale comments (routing files, adapter count, mocks) It covers the 6 changed files: README.md, bin/bootstrap-ubuntu.sh, bin/setup.py, bin/stack.sh, bin/unified-network-layer-up.sh and docker-compose.unified-network-layer.yml.
…) alongside the multi-adapter roles role: network-layer runs the consumer, network and provider tiers as modules of one adapter process, removing the cross-pod hops between tiers. The existing consumer/network/provider roles are unchanged. Each environment picks a mode with adapters.singleNetworkAdapter: true|false (README "Choosing a mode"). adapter-service: - _network-layer.tpl: generate adapter.yaml and routing at render time from config/<tier>-config.yaml and config/routing-<tier>.yaml (one source of truth for both modes); tier hops rewritten to loopback http://localhost:<targetPort>/<tier>; per-tier __<TIER>_*__ placeholders - configmap: network-layer branch, private-key placeholder check on the parsed config, `config` override skips the generator - deployment: per-tier key Secrets (keys-<tier>, 0400), init substitution per tier, networkLayer.extraSubstitutions; optional terminationGracePeriodSeconds, topologySpreadConstraints, preStop sleep, GOMEMLIMIT, registry-cache Redis password - ingress: network-layer allows only /consumer... and /provider/<action> (never /network or /provider/publish), Prefix/Exact pathType only, no regex paths or nginx use-regex/rewrite-target - generated config honours logLevel, http.timeout.*, otel.* and otel.serviceName - hpa: autoscaling.behavior passthrough - values: networkLayer block (keys, httpClient pool, registryCache); probes.* replaced by startupProbe/livenessProbe/readinessProbe (breaking) - ci/network-layer-values.yaml, examples/network-layer.yaml, NOTES, README openbao-secrets: - reflect consumer/network/provider adapter keys and provider-upstream into the network-layer-adapter namespace
…ated configurations
…ified configuration and routing
…routing templates
- Renamed role from `network-layer` to `single-network-layer` across configuration files and templates. - Updated routing and configuration references to reflect the new single-network-layer structure. - Adjusted Helm chart values and examples to align with the single-network-layer role. - Modified ingress rules to restrict access to appropriate paths for the single-network-layer. - Updated deployment scripts and configuration management to support the new role structure. - Ensured backward compatibility by updating references in the documentation and examples.
Please confirm: Module Paths and NamingCan we finalize the following module paths and naming conventions for the single network layer adapter so the Helm chart, quick-start, and documentation remain consistent? 1. Module paths — one process, one listener on Request flow Keeping the consumer at 2. Naming conventions
Are we aligned on these paths and naming conventions? If there are no objections, I'll retain them and remove outdated |
…documentation for unsigned requests
…URL substitution and increment chart version to 0.1.1
- Introduced a new JSON configuration file for the OpenAgriNet local environment. - Defined key-value pairs for various services including discovery, registry, and keycloak hosts. - Included participant IDs, capability bindings, and mapping URLs relevant to the weather observation capability. - Ensured all configurations are enabled and documented for clarity.
… and routing - Introduced a new single network layer adapter role that consolidates consumer, network, and provider tiers into a single process. - Added configuration files for the single network layer adapter, including resource requests, limits, and autoscaling settings. - Implemented routing rules for the consumer and provider modules to facilitate internal communication via loopback HTTP. - Created example YAML files for deploying the single network layer adapter. - Enhanced the existing templates to support the new adapter role and ensure proper key management and routing.
…-layer - Updated deployment and ingress templates to reflect the new network-adapter-layer role. - Changed Helm chart values and configurations to support the network-adapter-layer. - Modified quick-start documentation and scripts to align with the new naming and structure. - Adjusted routing configurations for the network-adapter-layer. - Updated Docker Compose files to use the network-adapter-layer service.
…twork-adapter-layer
…red container name make smoke right after make restart failed select with "connection refused": restart also restarts the registry, and smoke only waited for the adapter's /health. It now also waits for sunbird-registry-service to be healthy. The compose header notes the one container_name that differs from its service (network-adapter-layer -> network-adapter).
…clear Install shows the default single topology first (namespace network-adapter-layer) and multi with one namespace per tier; the topology table gives release, namespace and full caller addresses; both READMEs say when to use which; NOTES state the installed topology and the full in-cluster address.
…t mode (#55, #66) - helmfile value networkAdapterTopology -> networkAdapterDeploymentMode (README snippet: $mode, guard message) - "topology" -> "deployment mode" in the text this PR added: chart README (section "Choosing a deployment mode", anchor link), CHANGELOGs, Chart.yaml, values, example and CI headers, NOTES ("mode" line), openbao-secrets values, .env.example, stack.sh, docker-compose.yml - topologySpreadConstraints/topologyKey and the existing "routing is topology" notes are unchanged Refs #55 Refs #66
…tion Implementation plan for running one adapter, and review Fixes #65
…n from network-adapter values (#55, #66) - examples/network-adapter.yaml, ci/network-adapter-values.yaml: remove the autoscaling block (fixed replicaCount: 3; the chart default stays off) - networkAdapterLayer.extraSubstitutions back to {}; the example says to set __VISTAAR_TOKEN_URL__ per environment - CHANGELOG and CI header no longer mention the HPA Refs #55 Refs #66
, #66) The single adapter takes the multi network tier's port, which is also the chart's default service port, instead of the multi provider's 9200. - adapter-service: config http.port 9201; example and CI service port and targetPort 9201; README single-mode addresses - quick-start: compose 127.0.0.1:${NETWORK_ADAPTER_LAYER_PORT:-9201}:9201, .env.example, template listener, routing files (localhost:9201), server_proxy.conf and stack.sh comments, README tables - api-collection: single-mode environment hosts on 9201 Refs #55 Refs #66
…through-the-helm-charts refactor(adapter-service): drop autoscaling and token-URL substitutio…
manjudr
left a comment
There was a problem hiding this comment.
Re-reviewed at edc8654. I rendered and diffed rather than only reading: scripts/lint-charts.sh is green, helm template with ci/network-adapter-values.yaml produces the four modules with the right generated routing, all 19 placeholders substitute, docker compose config -q passes on both the network and multi profiles, and the three existing roles render identically to merge-base apart from the chart version, the config checksum and the new probes.
Every one of the 16 code comments is addressed.
| Comment | Where it landed |
|---|---|
| Autoscaling off by default / does it work | enabled: false in both the example and CI values, with a note that it needs metrics-server |
/network/, /provider/ off the public tree |
now /_internal/network/, /_internal/provider/ in the chart config and the quick-start template |
/provider/publish to top level |
/publish, matching multi mode |
Say in-file that consumer-at-/ is load-bearing |
network-adapter-config.yaml:72-76 |
| Inert values | dropped from the example and CI values, with a pointer to the config file |
| Five dead helpers | deleted; zero include sites remain |
| Patch bump hides a breaking change | 0.5.2 → 0.6.0 |
| Liveness with no startup probe | startupProbe on, failureThreshold: 36 → a 180s first-boot budget |
merge guard, ingress never rendered in CI |
` |
Both .gitignores |
root one out of the diff, quick-start down to one real line |
SETUP.md stale branch and Compose version |
file removed; README.md:65 states Compose v2.20+, README.md:72 clones development |
| Why both openbao namespaces | answered at values.yaml:60-67 |
What is smoke |
removed; no references left |
| Flat path scheme | public surface is /<action>, /publish, /health; server_proxy.conf uncomments the /publish deny and adds location ^~ /_internal { deny all; }; the registry baseUrl decision is recorded at .env.example:151-158 |
I also checked the invariant this config sets for itself — that each module is its tier's module — by parsing both files and diffing module by module. Three of the four are exact apart from the per-tier key placeholders, the router filename and httpClientConfig. The fourth has one gap; inline comment below.
Still to do before this merges:
- Commit hygiene. All ten commits since 14 Oct carry a ticket number. The 24 before it do not (
b42f82d Refactor code structure for improved readability and maintainability,40a273b chore: add /dev_docs to .gitignore, and others). Unless this is squash-merged they land ondevelopmentas-is. Squash-merge is fine by me — say which you prefer. - The flat-path caveat is in the wrong place. It is written up at
charts/adapter-service/README.md:31-37, and the content is right. I asked for it in the PR description, which still lists only the in-process-transport item under "Not in this PR". - The description says
Closes #55only. Commits also sayFixes #65andFixes #66, so merging closes two issues the description does not name. List all three. api-collection/OpenAgriNet.network-adapter.local-environment.jsonis a second environment file beside the existingOpenAgriNet.local-environment.json, thoughba54a2dis titled "one Postman collection for both modes". Fold it in or say why it has to stay separate.quick-start/bin/bootstrap-ubuntu.sh:113still clones-b feat/4-docker-compose— the same bug fixed inSETUP.mdand the README. Pre-existing ondevelopmentand out of this PR's scope, but it is the surviving copy and worth picking up here.- Nothing on any thread. Eight are still unresolved even though the code is fixed, so the PR reads as unaddressed at a glance. Reply and resolve as you go.
Two notes, neither blocking: both network-adapter config files end without a trailing newline, and preStopSleepSeconds: 10 in the CI values needs Kubernetes 1.30 or later — the example values say so, but nothing fails the render on an older cluster.
- network module: restore schemaValidator verbatim from the network tier file (chart config and quick-start template); narrow the header claim to the modules that validate schema - bootstrap-ubuntu.sh and README Step V1: clone/fetch from development - ci/network-adapter-values.yaml: note preStopSleepSeconds needs k8s 1.30+ Refs #55 Refs #66
…ter (#55, #66) Single mode listens on 9201, the multi network tier's port, and the two modes never run together, so NETWORK_ADAPTER_LAYER_PORT duplicated NETWORK_ADAPTER_PORT. Drop it; container ports stay literal. - .env.example: remove NETWORK_ADAPTER_LAYER_PORT - docker-compose.yml: "127.0.0.1:${NETWORK_ADAPTER_PORT}:9201" - README Step 3 and the single-mode Postman environment name NETWORK_ADAPTER_PORT Refs #55 Refs #66
ameersohel45
left a comment
There was a problem hiding this comment.
Three identities in single mode
The one container still signs as three participants (consumer, network, provider), with three keys, three keyIds and three registry rows. setup.py fills in all three tiers' keys for network-adapter.yaml. That clashes with #82's one entry and one key, and both PRs rewrite the same render loop in setup.py, so they will conflict.
There was a problem hiding this comment.
Single and multi consumer validate differently
quick-start/config/adapters/network-adapter.yaml.tmpl:124 turns extendedSchema_enabled on for the consumer module, but the multi consumer.yaml.tmpl:95 keeps it off on purpose (it fetches each resource's @context per request). So the same request is validated differently depending on the mode. Should this be "false" to match multi?
|
1. Three Secrets → one |
|
2. Namespace name |
|
3. No real single/multi knob |
|
4. Separate folders per mode, no generated routing |
|
5. Probe keys |
|
6. CI values duplicate the example |
|
7. Retest |
Agreed on the direction. #82 is quick-start only and targets NetworkofNetwork, so on development the chart still has three tier identities. Once #82 lands, the quick-start single adapter picks up the one identity with no template change; only the setup.py render loop needs a small merge. For the chart, I'd collapse networkAdapterLayer.keys and the openbao copies to one Secret in a follow-up, when #82's single identity reaches development, so single and multi stay consistent. |
the CI file turns on ingress with annotations: null to test the path guard |
…orkAdapterDeploymentMode (#55, #66) Drop the network-adapter-layer role. Role network now reads networkAdapterDeploymentMode (single | multi, default single): single runs the consumer, network and provider tiers as modules of one adapter (the former network-adapter-layer behaviour); multi is the network tier alone. provider and consumer ignore the value; any other value fails the render. adapter-service: - Roles are provider | network | consumer again; the single-mode checks (config, generated routing, tier Secrets, ingress path guard, private-key and port guards) key off role network + mode single. - Single installs as release network-adapter in namespace network-adapter, the same as the multi network tier; switching modes upgrades that release in place. - examples/network.yaml and ci/lint-values.yaml set multi; examples/network-adapter.yaml and ci/network-adapter-values.yaml use role network + single. - BREAKING: an existing role network release without networkAdapterDeploymentMode: multi becomes single on upgrade. - README: new "Multi mode" section, including removing the consumer and provider keys from network-adapter. openbao-secrets: - consumer-adapter-keys, provider-adapter-keys and provider-upstream mirror into network-adapter (single mode) instead of network-adapter-layer. ADR-0001 updated for the role, namespace, secrets and mode.
…cks its config at startup (#55, #66) - docker-compose: merge network-adapter-layer into network-adapter, always on. It mounts config/adapters/${NETWORK_ADAPTER_CONFIG}.yaml: network-adapter.yaml (all three tiers, the default) or network.yaml (the network tier alone). provider- and consumer-adapter stay behind profile multi. Drop COMPOSE_PROFILES=network. - stack.sh: read NETWORK_ADAPTER_DEPLOYMENT_MODE from .env at startup (absent key, quotes, inline comments and CR handled; MODE overrides) and map it to NETWORK_ADAPTER_CONFIG. `up` starts the requested mode; other commands keep the running one, detected from the config network-adapter mounts. Remove a pre-merge network-adapter-layer container before starting. - Only the chosen config is mounted, so in multi the network container never holds the consumer or provider keys. - README and .env.example: modes, switching, upgrade and multi notes.
Closes #55
Closes #66
Refs OpenAgriNet/network-adapter#55
Parent: OpenAgriNet/engineering-tracker#171
Objective
Run the consumer, network and provider tiers as one adapter process, the Network Adapter, and make it the default (
single). The three-adapter setup stays as the optionalmultimode, unchanged. Available in both quick-start (Docker Compose) and Helm (charts/adapter-service). Decision record:docs/adr/0001-single-network-adapter-deployment-mode.md.Existing vs proposed
Existing (only the multi-adapter architecture): three containers or pods, a network hop and a DNS lookup between tiers, three of every Kubernetes object.
Proposed (
singleas the default, the separate adapters kept as the optionalmulti): one container or pod on:9201(the multi network tier's port), tier hops onlocalhost:9201inside it. One Deployment, Service, PDB and ConfigMap.flowchart LR app[App] --> C subgraph NA["network-adapter :9201 (one service)"] C["consumer /:action"] N["network /_internal/network/*"] P["provider /_internal/provider/*"] PP["provider-publish /publish"] C -- discover --> N C -- select --> P PP -- publish --> N end N --> D[(discovery)] P --> U[(upstream APIs)] cat[Catalogue publisher] --> PPEach module keeps its own tier identity (keys,
keyId, registry row), so nothing changes in the registry. The paths are flat and the same as multi:/discover,/publish,/<action>,/health; only host and port change. The network and provider tiers sit under/_internal/, which only the process itself calls;/publishand/_internalare never exposed (Helm Ingress guard, quick-startserver_proxy.confdeny).Choosing the mode
make up-core/make upmake up-core-multi/make up-multinetworkmultinetwork-adapter, namespacenetwork-adapter-layer,-f examples/network-adapter.yamlconsumer-,network-,provider-adapter, one namespace eachnetworkAdapterDeploymentMode: singlenetworkAdapterDeploymentMode: multi:9201Switching in quick-start is running the other target; it removes the running mode's adapters first. In Helm, install the other mode next to the current one, repoint the app, then remove the old releases.
File structure
+new,~changed.How documentation is done
docs/adr/0001-…quick-start/README.mdcharts/adapter-service/README.mdcharts/adapter-service/CHANGELOG.md,openbao-secrets/CHANGELOG.mdNOTES.txt,values.yamlheader,examples/network-adapter.yamlheaderNot in this PR (forward looking)
localhostbetween modules (prototyped on network-adapter feat/55). Measure first: thelocalhosthop was already sub-millisecond on Docker.