Trang này được dịch bằng máy. Đọc bản gốc tiếng Anh.

Recipe

worker-cloud-run

The generic background-worker primitive as one Cloud Run worker pool running infra.replicas instances of the Release's image, rendered by vendoring a Terraform module kept beside this Recipe. Reach for it in a Google Cloud project with a VPC network; for terraform/worker-ecs or cloudformation/worker-ecs in an AWS account, and helm/worker on Kubernetes. A worker pool is Cloud Run's resource for continuous background work: it has no endpoint or URL, the container declares no port, and it runs a fixed instance count with no autoscaling. The project, region, VPC network and service account are the operator's, each required under infra.overrides; a subnet and network tags are optional. Only the worker pool is emitted — no service account, IAM binding, network, subnet or firewall rule. Private addresses are reached by Direct VPC egress. Each env entry an edge's inject block, or the component's own, dictates becomes a container variable under that name, its value written whole, so a Terraform reference a neighbour publishes is evaluated by the engine; concurrency and queue_depth_hint arrive by default as WORKER_CONCURRENCY and WORKER_QUEUE_DEPTH_HINT. No edge may dictate those while they are the defaults, or a name Cloud Run reserves or refuses. File, arg and other entries are refused by name: the worker pool writes no file, and no command line is rendered. The container runs at the smallest worker pool size meeting infra.compute.cpu and infra.compute.memory, so the Component's defaults run at 1 vCPU and 512 MiB. GoogleCloudPlatform/cloud-run/google is not sourced: at v0.34.2, its newest version, it declares no worker pool; only the hashicorp/google provider's resource does.

Nguồn gốc

Chính thứcĐược ký bởi một danh tính ký mà danh mục này công nhận là nhà phát hành chính thức.
Digest nội dung
sha256:d94bdf28817e3c8a3d39b7e0d3b3e88efb79079ab259132aff7a12ad9f1898e6
Đã xuất bản
2026-11-10T10:29:02Z
Danh tính ký
https://token.actions.githubusercontent.com/https://github.com/aggrega-ai/aggrega-hub/.github/workflows/catalog-publish-sign.yml@refs/heads/main

Chữ ký

  • Chính thứcapplication/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:de8cd4f0a94297ea7a56fd2dce574860901dd5925d7f6c8972b578624a3ce945

Tham chiếu ở phiên bản này

oci://hub.aggrega.ai/recipe/terraform/worker-cloud-run:1.0.0
Đích
—
Triển khai
core/compute/worker:1.0.0

Cung cấp

Các mẫu con trỏ xác định mà công thức này nối cho bên tiêu thụ.

Chưa khai báo mẫu provides nào.

Workload

Chưa khai báo mẫu khối lượng công việc nào.

Giá trị cục bộ

TênMẫu
cpu_millicores{{- $c := toString (optional (optional .infra "compute" dict) "cpu" "") -}} {{- if regexMatch `^[0-9]+m worker-cloud-run 1.0.0 · Danh mục Aggrega $c -}}{{ atoi (trimSuffix "m" $c) }} {{- else if regexMatch `^[0-9]+(\.[0-9]{1,3})? worker-cloud-run 1.0.0 · Danh mục Aggrega $c -}} {{- $p := splitList "." $c -}}{{- $f := 0 -}} {{- if eq (len $p) 2 }}{{ $f = atoi (substr 0 3 (printf "%s000" (index $p 1))) }}{{ end -}} {{- add (mul (atoi (index $p 0)) 1000) $f -}} {{- end -}}
memory_mib{{- $m := toString (optional (optional .infra "compute" dict) "memory" "") -}} {{- if regexMatch `^[0-9]+Mi worker-cloud-run 1.0.0 · Danh mục Aggrega $m -}}{{ atoi (trimSuffix "Mi" $m) }} {{- else if regexMatch `^[0-9]+Gi worker-cloud-run 1.0.0 · Danh mục Aggrega $m -}}{{ mul (atoi (trimSuffix "Gi" $m)) 1024 }} {{- end -}}
size{{- $found := "" -}} {{- if and .locals.cpu_millicores .locals.memory_mib -}} {{- $mc := atoi .locals.cpu_millicores -}}{{- $mib := atoi .locals.memory_mib -}} {{- range list (list 1 512 4096) (list 2 512 8192) (list 4 2048 16384) (list 6 4096 24576) (list 8 4096 32768) -}} {{- if and (not $found) (ge (mul (index . 0) 1000) $mc) (ge (index . 2) $mib) -}} {{- $found = printf "%d/%d" (index . 0) (max (index . 1) $mib) -}} {{- end -}} {{- end -}} {{- end -}} {{- $found -}}
size_cpu{{ if .locals.size }}{{ index (splitList "/" .locals.size) 0 }}{{ end }}
size_memory{{ if .locals.size }}{{ index (splitList "/" .locals.size) 1 }}Mi{{ end }}

Ánh xạ values

Chưa khai báo ánh xạ values nào.

Quan hệ

Các cạnh có kiểu đi tới và đi từ các thực thể đã xuất bản khác. Một tham chiếu không có đích đã xuất bản được hiển thị là một cạnh bị đứt thay vì một liên kết.

Sử dụng

Được sử dụng bởi

Không có gì trong danh mục phụ thuộc vào thực thể này.

Tài liệu tham khảo khái niệm Recipe →

Danh mục Aggrega — chỉ mục mở gồm các thành phần, tính năng, công thức và các plugin kết xuất chúng.

Được xây dựng bằng hệ thống thiết kế dùng chung của Aggrega.

Quyền riêng tư