Released docs. You are viewing the documentation published with v0.49.0. Development docs are available at Latest.
Package and run a Registry Discovery index
If you run the index that applications search, you maintain one project directory, package each
revision of it into a new directory, and restart Discovery on that package. You need the
discovery-project directory and the running discovery from Publish and consume a Registry
Discovery index, and a second shell at the
checkout root for the commands that run beside it.
Install the binaries
Section titled “Install the binaries”From v0.44.0, each release publishes discovery and discoveryctl for Linux amd64, Linux arm64,
and macOS arm64, with an installer. Choose a tag, normally the
latest release, and
authenticate the assets with the
verification guide.
Linux assets are executables named <binary>-<tag>-linux-<arch>. macOS assets are .tar.gz
bundles that carry the executable, its AWS-LC-FIPS libraries, and notices.
Install the pair from one tag with the release-pinned installer:
tag="vX.Y.Z"bash "discovery-${tag:?set tag to the release tag}-install.sh""${DISCOVERY_INSTALL_DIR:-$HOME/.local/bin}/discovery" --version"${DISCOVERY_INSTALL_DIR:-$HOME/.local/bin}/discoveryctl" --versionThe installer puts both binaries in ~/.local/bin. Set DISCOVERY_INSTALL_DIR to change that.
The version checks run the binaries by that path, so they work before the directory is on your
PATH. Neither path needs a Rust toolchain.
The release also publishes the image ghcr.io/registrystack/discovery:<tag> for linux/amd64.
Deploy it by the digest the release manifest records, not by the tag. It runs discovery as a
nonroot user and reads /etc/registry-discovery/runtime.yaml. Mount that file and the package
directory read-only. Discovery writes nothing.
Approve HTTPS origins
Section titled “Approve HTTPS origins”A provider gives you the HTTPS URL of its public description out of band. Check the project the way
production does, with --production:
discoveryctl check --project discovery-project --productiondiscoveryctl check refused the input.error[discovery.posture.loopback-catalog-url] discovery-project/origins.yaml:5:17 /origins/tutorial-evidence/catalogUrl the index advertises an address on the reader's own machine; it is accepted only when the process declares development next: Publish HTTPS URLs on non-loopback hosts. For a laptop or test run, start it with `rstack dev`, or declare development with REGISTRY_STACK_POSTURE=development or --posture development.1 error, 0 warnings in 3 filesIn production, write the provider’s URL as catalogUrl, one entry per provider, keyed by its own
id. The steps below keep the local origin so that you can package again on your
machine.
Add a file under discovery-project/mappings/ for each requirement applications resolve. A mapping
may list several alternatives; the types inside one alternative are required together, and the
application chooses one alternative. jurisdiction is optional, and a resolve request must match
it exactly when it is set.
Package a revision
Section titled “Package a revision”Stop the running discovery with Ctrl+C. In the second shell, start the publication server
again:
python3 products/discovery/tutorial/publication_server.py \ --descriptions products/discovery/fixtures/descriptionsA package is never replaced in place. In the shell where discovery ran, packaging into the
existing directory is refused:
discoveryctl package \ --project discovery-project \ --output discovery-project/package \ --posture developmentdiscovery-project/package already exists; `discoveryctl package` writes a package into a new directoryPackage into a new directory, and record your own revision label with it:
discoveryctl package \ --project discovery-project \ --output discovery-project/package-2 \ --posture development \ --revision 2packaged packageDigest=sha256:<package-digest> catalogRevision=sha256:7e0799f2c5fd24957e4d1372f757c40abef694110eb70fc260a0abdc312ca963 mappingRevision=sha256:332004ca3920c498539180946e8f2637e9998ba7e49cd98f31e19d6f818857acwarning[discovery.posture.loopback-catalog-url] discovery-project/package-2/discovery-index.json /origins/0/catalogUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.warning[discovery.posture.loopback-catalog-url] discovery-project/package-2/discovery-index.json /services/0/originUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.The two revisions are unchanged, because the descriptions and mappings mean the same. The package
digest is new: it is the SHA-256 of the package’s SHA256SUMS file, which covers the index, its
fetch times, and the REVISION file. A failed run leaves no directory behind. Stop the publication
server with Ctrl+C.
Check the index on its own, as Discovery will read it:
discoveryctl check --posture development --index discovery-project/package-2/discovery-index.jsonvalid index origins=1 services=1 mappings=1 catalogRevision=sha256:7e0799f2c5fd24957e4d1372f757c40abef694110eb70fc260a0abdc312ca963 mappingRevision=sha256:332004ca3920c498539180946e8f2637e9998ba7e49cd98f31e19d6f818857acwarning[discovery.posture.loopback-catalog-url] discovery-project/package-2/discovery-index.json /origins/0/catalogUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.warning[discovery.posture.loopback-catalog-url] discovery-project/package-2/discovery-index.json /services/0/originUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.0 errors, 2 warnings in 1 filePin the package
Section titled “Pin the package”Pin the package you reviewed, so that Discovery refuses any other. Add the pin to
discovery-project/runtime.yaml:
package: root: ${DISCOVERY_PACKAGE_ROOT} expectedDigest: ${DISCOVERY_PACKAGE_DIGEST}Set both values. In production, copy the digest from the packaged line; here, compute it from the
same file (shasum -a 256 on macOS, sha256sum on Linux):
export DISCOVERY_PACKAGE_ROOT="$PWD/discovery-project/package-2"export DISCOVERY_PACKAGE_DIGEST="sha256:$(shasum -a 256 "$DISCOVERY_PACKAGE_ROOT/SHA256SUMS" | cut -d ' ' -f 1)"Check the runtime file and its package under development:
discoveryctl check --runtime-config "$PWD/discovery-project/runtime.yaml" --environment --posture developmentwarning[discovery.posture.loopback-catalog-url] <package-index> /origins/0/catalogUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.warning[discovery.posture.loopback-catalog-url] <package-index> /services/0/originUrl the index advertises an address on the reader's own machine; production refuses it next: Publish HTTPS URLs on non-loopback hosts.0 errors, 2 warnings in 1 fileThe check verifies the package and reports the loopback catalog and origin URL warnings. A package that fails verification is reported as discovery.runtime.package-refused at /package/root and exits 1. A package file the check cannot read exits 3. If the package root lookup fails, both check and startup report discovery.runtime.package-refused at /package/root. Offline check skips a missing package directory so you can check the runtime before building the package. Startup requires the package.
Without --environment, the check reads the file without filling its ${NAME} expressions.
Restart on the new package
Section titled “Restart on the new package”Discovery checks the pin before it listens. Started on the old package, it refuses:
DISCOVERY_PACKAGE_ROOT="$PWD/discovery-project/package" \ discovery --runtime-config "$PWD/discovery-project/runtime.yaml" --posture developmentdiscovery: package.expectedDigest is sha256:<pinned-digest> but the package at package.root is sha256:<deployed-digest>; deploy the pinned package or update package.expectedDigestStart it on the pinned package:
discovery --runtime-config "$PWD/discovery-project/runtime.yaml" --posture developmentIn the second shell:
curl -s http://127.0.0.1:38080/ready{"developmentSettings":[{"code":"discovery.posture.loopback-catalog-url","pointer":"/origins/0/catalogUrl"},{"code":"discovery.posture.loopback-catalog-url","pointer":"/services/0/originUrl"}],"posture":"development","status":"ready"}Before it listens, Discovery recomputes every SHA256SUMS entry and refuses a changed, missing, or
extra file by name. It serves that index until it stops; a new revision always means a new package
and a restart.
Discovery defaults to production and refuses loopback catalog, endpoint and origin URLs in a production package.
Choose one posture across your stack. Production peers refuse responses marked as development.
Discovery has no audit journal. Its declared posture appears in startup logs and /ready, and development responses carry Registry-Posture: development.
The runtime file is the whole runtime configuration: the listener, the package root and pin, the
limits, and the log level. It holds no origin, mapping, credential, or trust setting. Discovery
serves plain HTTP without authentication on whatever address listener.bind names, the example
being 127.0.0.1:38080, so terminate TLS in front of it. Keep both paths absolute and free of
symbolic links.
Maintain the index
Section titled “Maintain the index”| Who | Keeps | Acts when | By |
|---|---|---|---|
| Provider | Its public description | Its endpoint, profile, or Evidence types change | Publishing the new bytes at the approved URL |
| Operator | origins.yaml, mappings, runtime.yaml, the deployed package | An origin or mapping changes, or a provider republishes | Check, package into a new directory, pin, restart |
| Application | Its saved selections and its own Evidence trust | A saved selection’s service, endpoint, roles, jurisdictions, capability, mapping, or origin changes; a new catalogue revision or originContentDigest alone does not | Re-deciding trust, then calling the provider directly |
A republish that changes only formatting moves originContentDigest but leaves catalogRevision and
every record identity alone. A change to an endpoint or a type changes the binding. originContentDigest
is the SHA-256 of the exact bytes the package build fetched, so it lets anyone compare the index with
what the provider publishes now. It is not a signature: it records which bytes were fetched, not who
wrote them. An index that changed in place would be one nobody reviewed, so a revision always means a
new package.
Discovery never trusts a provider for the application. The Registry Discovery overview explains that boundary.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause | Fix |
|---|---|---|
discoveryctl check refuses a file | It does not match its closed format | Make the edit each finding names at its line and column |
| Packaging cannot fetch an origin | The description is unavailable or the URL breaks the fetch policy | Restore the approved publication, then package into a new directory |
| Startup reports a digest mismatch | The package is incomplete, changed, or not the pinned one | Deploy the complete pinned package, or update package.expectedDigest |
Startup says the index predates apiVersion and kind | The package was built by an older discoveryctl | Package it again, then update the pin |
| Startup says the package contains a retired Relay service | The published registry-discovery-v1alpha1 profile still validates Relay descriptions, but the current runtime serves Evidence providers only | Remove Relay origins, package it again, then update the pin |
| Search returns no items | No indexed description matches every filter | Review the indexed descriptions and the identifiers you sent |
Check commands
Section titled “Check commands”Every file Registry Discovery reads has a command that checks it offline. Each prints the diagnostics, JSON output, and exit codes that Check a file before you deploy it describes.
| Format and files | Check command |
|---|---|
Discovery approved origins
| discoveryctl check --project <project> |
Discovery Evidence mapping
| discoveryctl check --project <project> |
Discovery runtime configuration
| discoveryctl check --runtime-config <file> |
Clean up
Section titled “Clean up”Stop Discovery with Ctrl+C, then remove the project and its packages:
rm -r discovery-projectCookies on Registry Stack
We use optional cookies to understand how you use the main Registry Stack website and this documentation. If you contact us, we may link this activity to your enquiry. You can change your choice at any time. Read the privacy policy.
Your browser asks sites not to track you, so optional tracking stays off.
We could not use or save that choice. Optional tracking remains off.