Repository navigation
feat(quick-start): enable the catalog crawler for publishing catalogues - #93
Open
kelvinprabhu wants to merge 9 commits into
Conversation
- network-adapter.yaml.tmpl (single-adapter and multi-adapter): add the registry and crawler plugin blocks. Catalogs go to this process's /publish in single mode and to provider-adapter:9200/publish in multi mode, published as the provider identity to the discovery subscriber id. - setup.py: ensure_binding(publish_url) writes the publish action on the Agmarknet binding, adding or repointing it on an existing row; defaults to a commit-pinned pipeline URL, AGMARKNET_PUBLISH_PIPELINE_URL overrides. - ProviderSchema.json admits the publish action (same as registry chart 0.5.0). - docker-compose.yml: create the catalogcrawler run-log database on discovery-postgres, make network-adapter wait for it, and pass the Mandi pipeline inputs (MANDI_*, APP_NETWORK_ID) from the AGMARKNET_* values. - README Appendix O and .env.example document it, including the steps for an existing stack and the image requirement. Ported from #69 onto the single-adapter quick-start. Refs #77
- setup.py: put() beside post(), sharing one write(); the publish update is its own ensure_publish_action(), and a non-SUCCESSFUL answer now stops setup, as registry-seed does. - The pinned pipeline URL is the module constant MANDI_PUBLISH_PIPELINE_URL. - Crawler blocks in both network-adapter templates keep short comments and point to README Appendix O. Refs #77
…files Mirror the Helm charts: the crawler's participantId and receiverId are in the network-adapter templates rather than filled by setup.py. - single-adapter: participantId __PROVIDER_SUBSCRIBER_ID__ (the provider tier's identity, already rendered by setup.py). - multi-adapter: participantId provider.oan.dev. - receiverId discovery.oan.dev in both. - setup.py drops __PROVIDER_PUBLISH_ID__ and __DISCOVERY_PUBLISH_ID__. Refs #77
ProviderSchema.json is the chart copy from #96: publish joins the Action enum and MappingPath also accepts an https <...>/publish/<source>.yaml pipeline URL, while method, path and mappings stay required for every action. setup.py now writes the publish action as POST /publish, both on a new binding and when it adds or repoints the action on an existing one. Refs #77
The crawler's run log moves off discovery-postgres to a crawler-postgres container with its own user and volume. POSTGRES_DB creates catalogcrawler on every fresh volume, so an existing stack no longer needs a manual createdb, and the network adapter no longer holds discovery's credentials or waits on its database. discovery-postgres and the top-level configs block are back as on development. The crawler stays in the network adapter's config; the adapter now waits for crawler-postgres to be healthy. README Appendix O and the destroy listing cover the new container and how to inspect the run log. Refs #77
kelvinprabhu
commented
Oct 28, 2026
Comment on lines
+221
to
+223
| # The publish pipeline the network adapter's catalog crawler runs (README, | ||
| # Appendix O). Optional: bin/setup.py defaults to a commit-pinned URL. Pin any | ||
| # override to a commit SHA, with its mappings/ folder beside it. |
Collaborator
Author
There was a problem hiding this comment.
simple comments
Comment on lines
+364
to
+366
| POSTGRES_USER: crawler | ||
| POSTGRES_PASSWORD: crawler | ||
| POSTGRES_DB: catalogcrawler |
Collaborator
Author
There was a problem hiding this comment.
is it safe to have it here ...
| MANDI_TOKEN_SECRET: ${AGMARKNET_PASSWORD} | ||
| # The catalog's provider id, and the network it is visible to. | ||
| MANDI_PARTICIPANT_ID: ${AGMARKNET_PARTICIPANT_ID} | ||
| APP_NETWORK_ID: ${BECKN_NETWORK_ID} |
Collaborator
Author
There was a problem hiding this comment.
Why network id
Comment on lines
697
to
699
| AGMARKNET_ACCESS_NAME: ${AGMARKNET_ACCESS_NAME} | ||
| AGMARKNET_PASSWORD: ${AGMARKNET_PASSWORD} | ||
| MOCKAGMARKNET_TOKEN: ${MOCKAGMARKNET_TOKEN:-local-mandi-token} |
Collaborator
Author
There was a problem hiding this comment.
these are same as MANDI_API_URI: ${AGMARKNET_BASE_URL}
MANDI_TOKEN_USER: ${AGMARKNET_ACCESS_NAME}
MANDI_TOKEN_SECRET ||. use them only no new addiction
Comment on lines
+1193
to
+1211
|
|
||
| ## Appendix O — Scheduled catalog publishing (the crawler) | ||
|
|
||
| The network adapter also runs the `catalogcrawler` plugin, in both modes. On | ||
| every tick (`catalogIntervalSeconds`, 60 s here) it lists the registry's | ||
| bindings, keeps the ones with a `publish` action, and runs each pipeline that | ||
| is due: fetch the upstream, build the catalogs, POST each to `/publish`, which | ||
| signs it as the provider and routes it to discovery. | ||
|
|
||
| | Piece | Where | | ||
| |---|---| | ||
| | `registry` and `crawler` plugin blocks | `config/adapters/{single,multi}-adapter/network-adapter.yaml.tmpl` | | ||
| | `publish` action on the Agmarknet binding | `bin/setup.py`, pinned to a commit; override with `AGMARKNET_PUBLISH_PIPELINE_URL` | | ||
| | Schema that admits `publish` | `config/registry/schemas/ProviderSchema.json` | | ||
| | Run log database `catalogcrawler` | `crawler-postgres`, its own container and volume; the network adapter waits for it | | ||
| | Pipeline inputs `MANDI_*`, `APP_NETWORK_ID` | `network-adapter` environment, mapped from `AGMARKNET_*` | | ||
|
|
||
| Catalogs go to `http://localhost:9201/publish` in single mode and to | ||
| `http://provider-adapter:9200/publish` in multi mode. |
Collaborator
Author
There was a problem hiding this comment.
posible keep it short and simple
…alog crawler's publish pipeline
Review on #93: no new environment for the crawler's publish pipeline, and no publish URL or changed code in setup.py. - network-adapter.yaml.tmpl (both modes): the pipeline's non-secret inputs (baseUrl, participantId, networkId) as crawler config overrides, rendered from AGMARKNET_BASE_URL, AGMARKNET_PARTICIPANT_ID and BECKN_NETWORK_ID; publish once a day, OnDemand catalogs only (mode: onDemand) - docker-compose.yml: drop MANDI_* and APP_NETWORK_ID from network-adapter; the pipeline reads AGMARKNET_ACCESS_NAME and AGMARKNET_PASSWORD, which it already gets (OpenAgriNet/network-adapter feat/mandi-publish-agmarknet-env-names) - setup.py: existing code back as on development; new put() and ensure_publish_action() add the publish action to the Agmarknet binding only when AGMARKNET_PUBLISH_PIPELINE_URL is set - bin/crawler-check.sh: shows the crawler ticking and its runs; --rerun clears the run log so the next tick runs the pipeline, --watch follows its log - .env.example: AGMARKNET_PUBLISH_PIPELINE_URL, pinned to a commit - README Appendix O: shorter Refs #77
kelvinprabhu
commented
Oct 28, 2026
| receiverId: "discovery.oan.dev" | ||
| publishPipelines: "true" | ||
| publishEnabled: "true" | ||
| catalogIntervalSeconds: "60" |
Collaborator
Author
There was a problem hiding this comment.
make it 6hr crawl
| # networkId is required: the network the catalogs are visible to. | ||
| publish.mandi-price.baseUrl: "__AGMARKNET_BASE_URL__" | ||
| publish.mandi-price.participantId: "__AGMARKNET_PARTICIPANT_ID__" | ||
| publish.mandi-price.networkId: "__BECKN_NETWORK_ID__" |
Collaborator
Author
There was a problem hiding this comment.
its optinal it there then only
kelvinprabhu
added a commit
that referenced
this pull request
Oct 28, 2026
…nDemand only Matches the quick-start (#93). - network-adapter-config.yaml, network-config.yaml: catalogIntervalSeconds 21600; publish.mandi-price.mode onDemand on the daily schedule - README: the pipeline reads the provider's Agmarknet credentials (AGMARKNET_ACCESS_NAME, AGMARKNET_PASSWORD) by their own names (OpenAgriNet/network-adapter feat/mandi-publish-agmarknet-env-names) Refs #77
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #77 · Refs OpenAgriNet/network-adapter#54
Objective
Run the network adapter's catalog crawler in docker compose so catalogues are published, in both deployment modes.
Solution
config/adapters/{single,multi}-adapter/network-adapter.yaml.tmpl:registryandcrawlerplugin blocks. Catalogs go tolocalhost:9201/publish(single) orprovider-adapter:9200/publish(multi), as the provider identity, to the discovery subscriber id.bin/setup.py:ensure_binding(publish_url)writes thepublishaction on the Agmarknet binding and adds or repoints it on an existing row. Default pipeline URL pinned to network-adapter37f5a09;AGMARKNET_PUBLISH_PIPELINE_URLoverrides.config/registry/schemas/ProviderSchema.json: same as the registry chart in feat(registry,registry-seed): admit and seed the catalog crawler's publish action #96:publishjoins theActionenum andMappingPathalso accepts an https<...>/publish/<source>.yamlpipeline URL; every action still needsmethod,path,mappings.setup.pywrites the publish action asPOST /publish.docker-compose.yml: newcrawler-postgres(own user and volume,POSTGRES_DB=catalogcrawler, no published port) for the crawler's run log;network-adapterwaits for it to be healthy. No dependency on discovery's database. Mandi pipeline inputs (MANDI_*,APP_NETWORK_ID) mapped fromAGMARKNET_*..env.example, including the steps for an existing stack and how to inspect the run log;make destroylists the new volume.