Registry & Hub

Find and inspect blocks in the Hub, pull and push them through OCI registries, set up credentials, and mirror registries for air-gapped environments.

Polycrate distributes blocks as OCI artifacts through any OCI-compatible registry – cargo.ayedo.cloud, Harbor, GitLab Container Registry, GHCR, AWS ECR or Azure ACR. The Hub is the searchable catalog on top.

Component Role
Hub (polycrate hub) Catalog of published blocks: names, versions, block.poly, README.md, CHANGELOG.poly and examples.poly. Reads the public Hub API at https://app.ayedo.cloud – no login required.
OCI registry Stores the packaged blocks. polycrate block pull and polycrate block push always talk directly to the registry named in the block path.
flowchart LR
    Hub[polycrate hub list / inspect] -. finds .-> Reg((OCI registry))
    Dev[polycrate block push] --> Reg
    Reg --> Pull[polycrate block pull]
    Pull --> WS[Workspace: blocks/ + workspace.poly]

Find blocks in the Hub

Without --no-pager, polycrate hub list opens an interactive list (arrow keys or j/k, type to filter, Enter for details, q to quit):

polycrate hub list
polycrate hub list --filter postgres
polycrate hub list --kind k8sapp --project ayedo
polycrate hub list --filter k8s --no-pager --limit 50
Flag Effect
-f, --filter Filter by block name
-k, --kind Filter by block kind, e.g. k8sapp, linuxapp, k8scluster, generic
-p, --project Filter by organization prefix, e.g. ayedo
-l, --limit Maximum number of results (default 100)
--no-pager Print a plain table instead of the TUI (for scripts and CI)

Inspect blocks

Without a version, polycrate hub inspect lists the available versions. With a version it prints block.poly; --readme, --changelog and --examples require a specific version:

polycrate hub inspect ayedo/k8s/cloudnative-pg
polycrate hub inspect ayedo/k8s/cloudnative-pg:<version> --no-pager
polycrate hub inspect ayedo/k8s/cloudnative-pg:<version> --readme --no-pager
polycrate hub inspect ayedo/k8s/cloudnative-pg:<version> --changelog --no-pager
polycrate hub inspect ayedo/k8s/cloudnative-pg:<version> --examples --no-pager

Test public blocks in a separate staging workspace before using them in production, and read CHANGELOG.poly before every version bump.

Bring blocks into your workspace

Add an instance and pull

Add the instance with its full registry path and version to workspace.poly:

# workspace.poly
blocks:
  - name: postgres
    from: cargo.ayedo.cloud/ayedo/k8s/cloudnative-pg:<version>
    config:
      namespace: databases

Then pull the block:

polycrate block pull cargo.ayedo.cloud/ayedo/k8s/cloudnative-pg:<version>

block pull (short form: polycrate pull) always requires BLOCK:VERSION. It

  • sets from: on every instance whose registry path matches to the given version, and
  • unpacks the block into blocks/<registry>/<org>/<category>/<name>/, e.g. blocks/cargo.ayedo.cloud/ayedo/k8s/cloudnative-pg/.

To upgrade a block, run the same command with the new version.

Pull missing blocks automatically

# Pull missing registry blocks during a run
polycrate run postgres install --blocks-auto-pull

# Pull every block the workspace references via from:
polycrate workspace update

Compare local content with the registry

polycrate block verify compares a local block with the registry image by content checksum without touching the block directory:

polycrate block verify postgres
polycrate block verify postgres --diff

Publish your own blocks

polycrate block push BLOCK (short form: polycrate push) packages a block and uploads it to its registry. BLOCK is the full registry name, the instance name or an unambiguous short name. Requirements:

  1. The block has a registry path – name: in block.poly (or the instance's from:) reads e.g. registry.acme.corp/acme/k8s/webapp. polycrate block init <name> creates blocks with this fully qualified name.
  2. version: in block.poly holds the target version (SemVer). The OCI tag is derived from it – do not pass a :tag.
  3. CHANGELOG.poly contains an entry for exactly this version with message and email.
  4. examples.poly sits next to block.poly and contains at least one named example.
polycrate block push registry.acme.corp/acme/k8s/webapp

For versioned releases, use the block release flow instead of editing versions by hand. It writes the changelog entry, sets version:, validates and pushes in one run:

polycrate release --block webapp update 1.5.0 \
  --set type=feat \
  --set message="Configurable health check path" \
  --set email=platform@acme.example \
  --changelog-item "New config value healthcheck.path"

polycrate release block-finalize webapp 1.5.0

→ Spec-Driven Development

Exclude files from a push

By default, block push excludes the .specs directory. Add patterns (.dockerignore syntax) with --exclude or permanently in ~/.polycrate/polycrate.yml under registry.block_push_exclude:

# --exclude replaces the default – list .specs again if you need it
polycrate block push registry.acme.corp/acme/k8s/webapp \
  --exclude .specs --exclude "*.log" --exclude test/fixtures

Precedence: --exclude > registry.block_push_exclude > default .specs. block verify uses the same patterns. → Configuration

Authentication

Pull and push use the Docker credentials in ~/.docker/config.json (including credential helpers). Log in once:

docker login registry.acme.corp
docker login cargo.ayedo.cloud   # only for non-public projects

In CI/CD, use a robot account:

echo "$REGISTRY_PASSWORD" | docker login registry.acme.corp -u "$REGISTRY_USER" --password-stdin
polycrate block push registry.acme.corp/acme/k8s/webapp

If ~/.docker/config.json exists, Polycrate also mounts it into the action container so playbooks use the same login.

Air gap: registry proxy

Without direct access to external registries, rewrite block sources in workspace.poly to an internal mirror (e.g. a Harbor proxy cache). List more specific patterns first:

# workspace.poly
registry:
  endpoint: registry.acme.corp
  proxy:
    - from: cargo.ayedo.cloud/ayedo/k8s
      to: registry.acme.corp/cargo-proxy/ayedo/k8s
    - from: cargo.ayedo.cloud/ayedo
      to: registry.acme.corp/cargo-proxy/ayedo

Mirror credentials belong encrypted in secrets.poly (registry.username, registry.password) or in docker login – never in workspace.poly. Offline bundles and the complete procedure are covered in Air-Gap Delivery.

Common errors

Error Cause and fix
block pull requires a version Add the version: polycrate block pull <registry>/<path>:<version>
authentication required / denied Run docker login <registry> and check project permissions
has no registry path on push name: in block.poly or from: must include a registry host
has no entry in "CHANGELOG.poly" Add a changelog entry for the version, e.g. with polycrate release --block <name> update <version>
is missing "examples.poly" Create examples.poly with at least one example next to block.poly
Version not in the Hub polycrate hub inspect <block> lists the available versions

See also