Цю сторінку перекладено машинно. Читати англійський оригінал.

FeatureRecipe

compose-bridge-fr

Network bridge for compose, between the networks of one compose file (each boundary's aggrega.ai/namespace, else the file's own network). Runs once per boundary attachment (executionScope: boundary) and renders one nginx-stream gateway named "aggrega-gw" into the boundary's own compose file. Its templates compute everything from the boundary's uses edges, so no address is hand-authored: an edge is bridged when both of its ends are assembled into the gateway's own file and sit on different networks there. Each bridged edge gets a `server { listen <port>; proxy_pass <target> }` block, the gateway joins the networks of every bridged end, and each consumer's variables delivered from the target's address are rewritten to reach it through the gateway.

Походження

ОфіційнийПідписано ідентичністю підписувача, яку цей каталог визнає офіційним видавцем.
Дайджест вмісту
sha256:5bc7cdb28e1b67707600e7aad52ad8aaf84bc95791511fa480f3f13abfc8a8f5
Опубліковано
2026-11-10T10:14:38Z
Ідентичність підписувача
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Підпис

  • Офіційнийapplication/vnd.dev.sigstore.bundle.v0.3+json

    https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

    sha256:3f7f613d05ea1ddb450e6141d45b28314497fc5d3c0f27d80f2dd7595d6df4d8

Посилання на цю версію

oci://hub.aggrega.ai/featurerecipe/compose/compose-bridge-fr:1.0.0
Ціль
—
Реалізує
core/compose-bridge:1.0.0

Надає

Детерміновані шаблони вказівників, які цей рецепт під’єднує для споживачів.

НазваШаблон
servers{{ .locals.servers }}
rewrites{{ .locals.rewrites }}

Відображення ін’єкцій

{{- $rewrites := fromJson (index .features .attachment_name).provides.rewrites -}} {{- with get $rewrites .context.instance_id -}}{{ toJson . }}{{- end -}}

Workload

Шаблон робочого навантаження не оголошено.

Локальні значення

НазваШаблон
servers{{- $hostField := .infra.providesField -}} {{- $portBase := int .infra.portBase -}} {{- $own := .boundary.assembly_path -}} {{- $byKey := dict -}} {{- $keys := list -}} {{- range $e := .boundary.internal_uses_edges -}} {{- $srcPath := toString (get $e "source_assembly_path") -}} {{- $tgtPath := toString (get $e "target_assembly_path") -}} {{- $srcNet := or (toString (get $e "source_namespace")) $srcPath -}} {{- $tgtNet := or (toString (get $e "target_namespace")) $tgtPath -}} {{- if and (eq $srcPath $own) (eq $tgtPath $own) (ne $srcNet $tgtNet) -}} {{- $key := printf "%s\x00%s\x00%s" (toString (get $e "source")) (toString (get $e "target")) (toString (get $e "socket")) -}} {{- $keys = append $keys $key -}} {{- $_ := set $byKey $key $e -}} {{- end -}} {{- end -}} {{- $keys = sortAlpha $keys -}} {{- $used := dict -}} {{- $rows := list -}} {{- range $key := $keys -}} {{- $e := get $byKey $key -}} {{- $provides := get $e "provides" | default dict -}} {{- $targetPort := atoi (toString (get $provides "port")) -}} {{- $listen := $targetPort -}} {{- if hasKey $used (toString $listen) -}} {{- $listen = $portBase -}} {{- range $keys -}} {{- if hasKey $used (toString $listen) -}} {{- $listen = add $listen 1 -}} {{- end -}} {{- end -}} {{- end -}} {{- $_ := set $used (toString $listen) true -}} {{- $env := get (get $e "inject" | default dict) "env" | default dict -}} {{- $hostVars := list -}} {{- $portVars := list -}} {{- range $in, $from := $env -}} {{- if eq (toString $from) $hostField -}} {{- $hostVars = append $hostVars $in -}} {{- else if eq (toString $from) "port" -}} {{- $portVars = append $portVars $in -}} {{- end -}} {{- end -}} {{- $consumer := get (get $.boundary.components (toString (get $e "source"))) "instance_id" -}} {{- $rows = append $rows (dict "source" (get $e "source") "target" (get $e "target") "consumer" $consumer "upstream" (printf "%s:%d" (toString (get $provides $hostField)) $targetPort) "listen" $listen "host_variables" $hostVars "port_variables" $portVars) -}} {{- end -}} {{- toJson $rows -}}
rewrites{{- $out := dict -}} {{- range $row := fromJson .locals.servers -}} {{- if $row.host_variables -}} {{- $consumer := get $out $row.consumer | default dict -}} {{- if $row.port_variables -}} {{- range $row.host_variables -}} {{- $_ := set $consumer . "aggrega-gw" -}} {{- end -}} {{- range $row.port_variables -}} {{- $_ := set $consumer . (printf "%d" (int $row.listen)) -}} {{- end -}} {{- else -}} {{- range $row.host_variables -}} {{- $_ := set $consumer . (printf "aggrega-gw:%d" (int $row.listen)) -}} {{- end -}} {{- end -}} {{- $_ := set $out $row.consumer $consumer -}} {{- end -}} {{- end -}} {{- toJson $out -}}

Відображення значень

Відображення значень не оголошено.

Зв’язки

Типізовані ребра до інших опублікованих сутностей і від них. Відсилання без опублікованої цілі відображається як розірване ребро, а не як посилання.

Використовує

Використовується в

Ніщо в каталозі не залежить від цієї сутності.

Довідка про поняття FeatureRecipe →

Каталог Aggrega — відкритий індекс компонентів, функцій, рецептів і плагінів, які їх рендерять.

Створено на основі спільної дизайн-системи Aggrega.

Конфіденційність