Repository navigation
feat(quick-start): run the network layer as a single adapter in docker compose (#55, #66) - #88
Conversation
…r compose (#55, #66) One compose service, network-adapter, on 127.0.0.1:9201. The deployment mode, read at startup by bin/stack.sh from NETWORK_ADAPTER_DEPLOYMENT_MODE in .env (MODE overrides), picks the config it mounts: - single (default, make up): network-adapter.yaml, the consumer, network and provider tiers as four modules of one process; tier hops stay in the container. - multi (make up-multi): network.yaml, the network tier alone, with provider-adapter and consumer-adapter (profile multi) beside it. Only the network tier's config is mounted, so it never holds the other tiers' keys. - setup.py renders network-adapter.yaml from network-adapter.yaml.tmpl; routing-network-adapter-{consumer,provider}.yaml route tier hops to localhost:9201/_internal/<tier>. - stack.sh: safe .env parsing, running-mode detection from the mounted config, removal of a pre-merge network-adapter-layer container. - server_proxy.conf denies /publish and /_internal at the edge. - README, .env.example, Makefile and bootstrap-ubuntu.sh updated; Postman environment for the local adapter ports.
…ules; multi-adapter anchor (#55, #66) - network-adapter.yaml.tmpl: drop the extra httpClientConfig and use log level debug, so each module matches its tier template apart from name, path and routingConfig. - docker-compose.yml: x-multi-adapter anchor carries profiles: ["multi"] for provider-adapter and consumer-adapter.
- charts/adapter-service/SETUP.md: guidelines, then single and multi steps (Secrets, install, check), the openbao-secrets changes multi needs, switching, and a symptom table. Steps verified on k3d. - charts/adapter-service/README.md rewritten short: roles, modes, the three values the render really requires, the identity Secret, key rotation; install steps live in SETUP.md. - quick-start/README.md: "Two modes" rewritten as guidelines; single-mode log checks; publish example on 9201 (multi: 9200). - CHANGELOG and ADR-0001 follow #87 and #88: networkTierKeys with default Secret names, lint-values back to role network, the single template is an exact copy of the tier modules.
There was a problem hiding this comment.
under /adaptor create two sub folder single-adaptor and multi-adaptor and keep the files config accorgingly . keep routing same as now outside
| @@ -0,0 +1,307 @@ | |||
| # Single mode: consumer at /, /publish, /_internal/network/, /_internal/provider/ in one | |||
| # process. Signing is off: keep :9201 on 127.0.0.1. setup.py renders it (ADR-0001). | |||
There was a problem hiding this comment.
Add a comment use this for only single mode similarly in others
| # ---------------------------------------------------------------- the stack | ||
|
|
||
| up: ; @$(STACK) up | ||
| up-core: ; @$(STACK) up-core |
There was a problem hiding this comment.
change it to --up --single-adaptor and --up --multi-adaptor || across all and make it consistent
| - addRoute | ||
|
|
||
| # provider: answers from the upstream APIs itself (no router). | ||
| - name: provider |
There was a problem hiding this comment.
consistent module name as we have in the other config module names
…apter, module names (#55, #66) Addresses review 5627422258: - Templates move to config/adapters/single-adapter/ and multi-adapter/; routing files stay in config/adapters/. setup.py, docker-compose.yml, stack.sh and .gitignore follow the new paths. - Each template says which mode it is for. - bin/stack.sh up|up-core take --single-adapter / --multi-adapter. make keeps only up and up-core (mode from MODE, then .env, then single); up-multi and up-core-multi are removed. - Single template modules: consumer-adapter, network-adapter, oanProvider, oanProviderPublish, matching the multi templates. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
…#55, #66) Follows the #87 and #88 review fixes: - Roles consumer-adapter / network-adapter / provider-adapter (old names still work), deploymentMode single-adapter | multi-adapter, adapterKeys. - Chart configs under config/single-adapter/ and config/multi-adapter/; quick-start templates under config/adapters/single-adapter/ and multi-adapter/. - Module names consumer-adapter, network-adapter, oanProvider, oanProviderPublish. - quick-start: make up / make up-core, MODE=multi for multi. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
…55, #66) The previous commit (210e321) pushed only the template moves. This adds the setup.py, stack.sh, Makefile, docker-compose.yml, .gitignore and template changes it describes. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
|
Review 5627422258 addressed in 210e321 + 01c56c7 (docs in #89, 2a82193).
Checks: docker demo single → multi → single, publish/discover/select 200; the network container holds only its own key in multi. Refs #55 #66 · OpenAgriNet/network-adapter#55 · OpenAgriNet/engineering-tracker#171 |
| config/adapters/exp.yaml | ||
| config/adapters/network.yaml | ||
| config/adapters/provider.yaml | ||
| config/adapters/network-adapter.yaml |
There was a problem hiding this comment.
why we need since it is moved to multi adaptor
| @@ -0,0 +1,307 @@ | |||
| # Single mode only: consumer at /, /publish, /_internal/network/, /_internal/provider/ | |||
There was a problem hiding this comment.
add like this #Use only in single network mode deployment
| registry+discovery -> setup.py -> network-adapter (Network Adapter Layer) | ||
| -> gateway (public, 80/443) -> hyperdx (wants 16 GB) | ||
| up-core steps 1-3 only. Nothing public, no ClickHouse. | ||
| up --single-adapter as up, one network-adapter running all three tiers |
There was a problem hiding this comment.
remove as we not using
| up-core steps 1-3 only. Nothing public, no ClickHouse. | ||
| up --single-adapter as up, one network-adapter running all three tiers | ||
| up --multi-adapter as up, with the three adapters (provider, network, consumer) | ||
| up-core --single-adapter as up-core, in single mode |
There was a problem hiding this comment.
remove from here
There was a problem hiding this comment.
can we keep respective routing as well inside
… flags (#55, #66) Addresses review 5627709821: - Routing files move into config/adapters/multi-adapter/ and single-adapter/; the single network module reuses multi-adapter/routing-network.yaml. - .gitignore names the four rendered configs instead of whole folders. - Templates start with "Use only in single-adapter/multi-adapter deployment mode". - bin/stack.sh drops --single-adapter/--multi-adapter (mode comes from MODE or .env) and stops on an unexpected argument instead of ignoring it. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
#66) - SETUP.md, README and the 0.6.0 CHANGELOG use examples/consumer-adapter.yaml, network-adapter.yaml and provider-adapter.yaml (#87). - quick-start README: routing files live in config/adapters/multi-adapter/ and single-adapter/ (#88). Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
|
@manjudr a question on how quick-start picks the mode. Your view would help. What changed: # .env (default single)
NETWORK_ADAPTER_DEPLOYMENT_MODE=single # or multi
# or once, on the command line
MODE=multi make upWhy:
Why we can't use Question: is |
| PROFILES=(--profile reverse-proxy --profile observability) | ||
| # Every optional profile, named so `down` also stops profiled services | ||
| # (the gateway, hyperdx, provider- and consumer-adapter). | ||
| PROFILES=(--profile reverse-proxy --profile observability --profile multi) |
There was a problem hiding this comment.
no multi change to multi-adaptor
| # change here or a restart. | ||
| provider-adapter: | ||
| <<: *adapter | ||
| profiles: ["multi"] |
There was a problem hiding this comment.
no multi the name should be single adaptor and multi adaptor
…adapter (#55, #66) Addresses review 5628280636: - The compose profile multi becomes multi-adapter (provider-adapter, consumer-adapter, and every --profile in bin/stack.sh). - MODE and NETWORK_ADAPTER_DEPLOYMENT_MODE take single-adapter (default) or multi-adapter, matching the chart's deploymentMode. Old single/multi values are still accepted. - Hints in docker-compose.yml and setup.py say MODE=multi-adapter make up. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
…er (#55, #66) Follows #88: MODE=multi-adapter make up, NETWORK_ADAPTER_DEPLOYMENT_MODE= single-adapter and profile multi-adapter in the quick-start README, SETUP.md and ADR-0001. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
| # 3. python3 bin/setup.py keys, the three adapter entries, and | ||
| # the adapter configs they mount | ||
| # 4. docker compose up -d now the adapters | ||
| # 4. docker compose up -d network-adapter now the adapter (multi: MODE=multi-adapter make up) |
There was a problem hiding this comment.
is this use the env deployement mode
…r template names (#55, #66) Addresses review 5628386136: - multi-adapter templates become consumer-adapter, network-adapter and provider-adapter.yaml.tmpl, so both mode folders hold network-adapter.yaml. - docker-compose.yml mounts config/adapters/${NETWORK_ADAPTER_DEPLOYMENT_MODE}/ network-adapter.yaml, and .env.example sets COMPOSE_PROFILES=${NETWORK_ADAPTER_DEPLOYMENT_MODE}: plain `docker compose up -d` now follows the .env mode, like make up. NETWORK_ADAPTER_CONFIG is gone. - setup.py, stack.sh and .gitignore follow the new names. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
There was a problem hiding this comment.
what is different better mode and networadaptordeployment mode'
…de setting (#55, #66) MODE and NETWORK_ADAPTER_DEPLOYMENT_MODE set the same thing. stack.sh now reads NETWORK_ADAPTER_DEPLOYMENT_MODE from the shell, then .env, then defaults to single-adapter. COMPOSE_PROFILES gets the same default, so an .env without the mode no longer warns. Refs: #55, #66, OpenAgriNet/network-adapter#55, OpenAgriNet/engineering-tracker#171
kelvinprabhu
left a comment
There was a problem hiding this comment.
Done @manjudr
Refs #55, #66 · Refs OpenAgriNet/network-adapter#55 · Parent: OpenAgriNet/engineering-tracker#171
Objective
Run the network layer as a single adapter in docker compose by default, with multi still one command away.
Solution
network-adapterservice on127.0.0.1:9201.NETWORK_ADAPTER_DEPLOYMENT_MODEin.env(defaultsingle) picks its config at startup: all three tiers, or the network tier alone.make up(single) andmake up-multi(addsprovider-adapterandconsumer-adapter).Split from #75: Helm in #87, docs in #89.