Aggregate
บทบาท
ขอบเขตของ Component: ระบบย่อยเริ่มต้น
Aggregate จัด
ขอบเขตspec.components: และsubsystems: ไว้:
spec: components: api: type: core/server:1.0.0 worker: type: core/worker:1.0.0คอมไพเลอร์default ที่api ยังapi ไม่default.api Aggregate ที่uses: และspec.components.<name> เปล่าๆ ขอบเขต
หลายsubsystems: ระบบ
การspec.components: และ spec.subsystems: ใช้default อย่างspec.subsystems.default.components.<name> การ
โมดูล Aggregate ที่นำกลับมาใช้ใหม่ได้
Aggregates ทำparameters ลงไป เพื่อexportedComponents: ซึ่งuses: คือuses target names a module’s component the module does not export (เป้า
ทำไมexportedComponents: ที่store: store) ใน
การexportedComponents: ชี้uses: ที่
การinject: ของspec.inject ของ
การappliesTo ของ Feature ข้อ.spec.subsystems.<subsystem>.features.<attachment> เพื่อ
ตำแหน่งในแค็ตตาล็อก
โมดูล Aggregate ที่aggregate/ ที่metadata.name สะกด
aggrega-catalog/└── aggregate/ └── {module-name}/ # the module's metadata.name, segment for segment └── {version}/ # the module's metadata.version └── aggregate.yaml # The module definitionชื่อ{publisher} ที่core สำหรับacme สำหรับcore/agenta อยู่aggregate/core/agenta/1.0.0/aggregate.yaml ชื่อaggregate/{module-name}/{version}/aggregate.yaml ทั้ง
OCI URI: hub.aggrega.ai/aggregate/{module-name}:{version} เป็นcore/agenta เผยhub.aggrega.ai/aggregate/core/agenta:1.0.0 และdb-module เผยhub.aggrega.ai/aggregate/db-module:1.0.0
รูปแบบโมดูล
โมดูลaggregate/child-database-module/1.0.0/aggregate.yaml เผยhub.aggrega.ai/aggregate/child-database-module:1.0.0):
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: child-database-module version: 1.0.0spec: components: internal-pg-primary: type: core/postgres:1.0.0
exportedComponents: # The Public Contract (Written once by the module author) primary_db: "internal-pg-primary"Aggregate แม่:
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: parent-app version: 1.0.0spec: aggregates: finance-db-subsystem: type: child-database-module:1.0.0
components: billing-api: type: core/python-worker:1.0.0 uses: databases: - finance-db-subsystem.primary_dbป้ายกำกับของโมดูล
เมื่อ Aggregate ถูกmetadata.labels บน envelope YAML เช่น aggregate.aggrega.ai/tier: infrastructure หรือ aggregate.aggrega.ai/compliance: pci-dss ป้าย
ข้อComponent ในaggregate.aggrega.ai/tier: infrastructure ส่วนcomponent.aggrega.ai/type: stateful-server) ป้ายlabels ของ
ดู architecture/06-data-taxonomy-and-composition.md §6 สำหรับsubsystems ดู vocabulary/data-pillars สำหรับparameters ที่
สัญญาพารามิเตอร์ที่ระบุชนิด
บล็อก spec.parameters: ของ Aggregate ประกาศtype ที่description ที่default ที่
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: web-app version: 1.0.0spec: parameters: region: type: string description: Cloud region the deployment targets enum: [us-east-1, us-west-2, eu-west-1, ap-northeast-1] default_locale: type: string description: Default UI locale presented to end users enum: [en-US, en-GB, fr-FR, ja-JP] default: en-US enable_debug: type: boolean description: Toggle verbose request logging default: false feature_flags: type: object description: Per-feature enablement map valuesType: { type: boolean } default: {} allowed_hosts: type: array description: Hostnames the ingress accepts items: { type: string, format: hostname } min: 1 default: ["web-app.example.com"]
components: web: type: core/web-server:1.0.0 values: default_locale: "{{ .parameters.default_locale }}" region: "{{ .parameters.region }}" debug: {{ .parameters.enable_debug }}เครื่องหมายtemplates/parameters-context.md
คำศัพท์ของสล็อตพารามิเตอร์
บล็อก parameters: ที่type, description, default, enum, min, max, pattern, minLength, maxLength, format, validate และ validateMessage (การitems (สำหรับproperties (สำหรับvaluesType (สำหรับrequired: true (เครื่องหมายitems, valuesType และproperties และvaluesType: { type: boolean } ไม่ใช่ valuesType: boolean ก่อนrequired: true ซึ่ง Release ไม่default ก็type ที่enum ขีดminLength และ maxLength นิพจน์pattern และ format บนmin และ max ได้แก่ ค่าproperties และitems ถูกvaluesType กำกับproperties ไม่vocabulary/compact-form-authoring.md สำหรับschema: สะกด
คีย์เวิร์ด
- ขีด
จำกัด ความ ยาว คือ ศูนย์ หรือ มากกว่า minLengthหรือmaxLengthที่เป็น ค่า ลบ บน การ ประกาศ ของ พารามิเตอร์ เอง จะ ถูก สคีมา ของ Aggregate ปฏิเสธ เมื่อ โหลด Aggregate โดย ระบุ พารามิเตอร์ และ คีย์ ภายใน สัญญา ที่ ซ้อน อยู่ ใต้ items,propertiesหรือvaluesTypeขีดจำกัด ความ ยาว ถูก อ่าน ตาม ที่ เขียน และ ไม่ ถูก จำกัด ด้วย ค่า ต่ำ สุด นั้น เมื่อ โหลด Aggregate ดัง นั้น ให้ เขียน เป็น ศูนย์ หรือ มากกว่า ที่ นั่น เช่น กัน: minLengthที่เป็น ค่า ลบ ไม่ บังคับ สิ่ง ใด และ maxLengthที่เป็น ค่า ลบ ปฏิเสธ ทุก ค่า minและmaxต้องจำกัด บนสิ่ง ใด สิ่ง หนึ่ง สล็อต บูลีน หรือ ออบเจ็กต์ ทั้ง คู่ ไม่ จำกัด สิ่ง ใด เลย minหรือmaxที่เขียน ไว้ ที่ นั่น จึง ถูก ปฏิเสธ เมื่อ โหลด Aggregate โดย ระบุ พารามิเตอร์ และ คีย์ - รูป
แบบ ต้อง คอมไพล์ ได้ patternทุกรายการ ถูก คอมไพล์ เป็น นิพจน์ ปกติ เมื่อ อ่าน สัญญา พารามิเตอร์ ทั้ง บน สล็อต เอง และ ภายใน สัญญา ที่ ซ้อน อยู่ ที่ ความ ลึก ใด ก็ได้ และ รูป แบบ ที่ คอมไพล์ ไม่ ได้ จะ ถูก ปฏิเสธ โดย ระบุ พารามิเตอร์ รูป แบบ และ เหตุผล สัญญา ถูก อ่าน สำหรับ ทุก การ บิลด์ การ pull และ การ ตรวจ สอบ ความ ถูก ต้อง ของ Release ที่ ไป ถึง Aggregate ไม่ ว่า จะ เป็น Aggregate ของ Release เอง หรือ โมดูล ที่ Aggregate นั้น นำ เข้า การ ตรวจ สอบ ค่า จาก นั้น จับ คู่ แต่ละ ค่าที่ ให้ มา กับ นิพจน์ ที่ คอมไพล์ แล้ว นิพจน์ เดียวกัน นั้น - ชื่อ
รูป แบบ ต้อง เป็น ชื่อ ที่ คอมไพเลอร์ ตรวจ สอบ formatระบุหนึ่ง ใน email,uri,hostname,ipv4,ipv6,uuid,date-timeและdateสะกดตาม ที่ JSON Schema สะกด ชื่อ อื่น ใด ได้แก่ ชื่อ ที่ สะกด ผิด เช่น emialหรือชื่อ ที่ JSON Schema ไม่ ได้ นิยาม เช่น passwordจะถูก ปฏิเสธ เมื่อ โหลด Aggregate โดย ระบุ พารามิเตอร์ และ แสดง รายการ ชื่อ ที่ รองรับ: บน สล็อต เอง โดย สคีมา ของ Aggregate และ ภายใน สัญญา ที่ ซ้อน อยู่ ที่ ความ ลึก ใด ก็ได้ เมื่อ อ่าน สัญญา พารามิเตอร์ สตริง ที่ ให้ มา ซึ่ง ไม่มี รูป แบบ ตาม ชื่อ ที่ ระบุ จะ ถูก ปฏิเสธ โดย ระบุ พารามิเตอร์ ค่า และ รูป แบบ สิ่ง ที่ แต่ละ ชื่อ ตรวจ สอบ อยู่ ใน vocabulary/compact-form-authoring.md
พารามิเตอร์ชนิดออบเจ็กต์และชนิดอาร์เรย์
สล็อต
spec: parameters: database_config: type: object description: Database connection configuration properties: host: { type: string, required: true } port: { type: integer, min: 1, max: 65535, default: 5432 } ssl_mode: { type: string, enum: [disable, require, verify-full], default: require } pool_size: { type: integer, min: 1, max: 100, default: 10 }
metric_labels: type: array description: Custom Prometheus labels to attach to scraped metrics items: type: object properties: name: { type: string, required: true } value: { type: string, required: true }Release ทำให้{{ .parameters.database_config.host }}, {{ .parameters.database_config.port }} เป็นต้น
การตรวจสอบความถูกต้องของสัญญาพารามิเตอร์
สัญญา
- การ
เติม — สล็อตค่า เริ่ม ต้น ที่ กำหนด default:ไว้และ ไม่มี ค่าที่ Release ระบุ จะ ได้ รับ ค่า เริ่ม ต้น ของ ตน พารามิเตอร์ แบบ ออบเจ็กต์ ซ้อน มี ความ หมาย ใน การ เขียน 3 กรณี สำหรับ สล็อต แม่ ที่ ละไว้ ที่ ระบุ เป็น ค่า ว่าง อย่าง ชัดเจน และ ที่ เขียน ไว้ เพียง บาง ส่วน: การ ละ สล็อต แม่ จะ เติม ค่า เริ่ม ต้น ของ สล็อต ลูก การ เขียน สล็อต แม่ เป็น {}คงค่า ว่าง ที่ ระบุ ไว้ (ระงับ ค่า เริ่ม ต้น ของ สล็อต ลูก) และ การ เขียน สล็อต แม่ เป็น แมป ที่ ไม่ ว่าง จะ เติม เฉพาะ สล็อต ลูก ที่ Release ไม่ ได้ ระบุ ดู templates/parameters-context.mdสำหรับตัวอย่าง YAML และ คู่มือ ตัดสิน ใจ “เมื่อ ใด ควร ใช้ แบบ ใด” - การ
ตรวจ — ค่าสอบ สัญญา แต่ละ ค่า ใน แมป ที่ รวม แล้ว ไม่ ว่า Release จะ ระบุ หรือ default:เป็นผู้ เติม จะ ถูก ตรวจ สอบ กับ ข้อ จำกัด type/enum/min/max/pattern/ โครงสร้างซ้อน ที่ ประกาศ ไว้ ความ ล้ม เหลว ใน การ ตรวจ สอบ หยุด การ บิลด์ พร้อม ข้อ ผิด พลาด ที่ ชัดเจน ซึ่ง ระบุ สล็อต ที่ ผิด ค่าที่ ระบุ และ ข้อ จำกัด ที่ ถูก ละเมิด พารามิเตอร์ ที่ จำเป็น แต่ ขาด และ ไม่มี default:ทำให้หยุด ใน ลักษณะ เดียวกัน พร้อม ชื่อ สล็อต - การ
แทน — คอมไพเลอร์ค่า ประเมิน ข้อความ ทั้งหมด ของ Aggregate เป็น เทมเพลต ก่อน อ่าน เป็น YAML และ แทนที่ ทุก การ อ้างอิง {{ .parameters.<slot> }}ซึ่งโดย ทั่วไป อยู่ ใน สตริง values:ของส่วน ประกอบ / ฟีเจอร์ / Aggregate ย่อย ด้วย ค่าที่ หา ค่า แล้ว {{อื่นใด ใน ข้อความ ก็ ถูก อ่าน เป็น ไวยากรณ์ เทมเพลต เช่น กัน ดัง นั้น ค่าที่ มี วงเล็บ ปีกกา คู่ ของ ตนเอง เช่น คำ นิยาม ที่ ส่ง ออก จาก แพลตฟอร์ม flow ต้อง เขียน แต่ละ {{เป็น{{"{{"}}ตามที่ ข้อความที่ อธิบายมี วงเล็บ ปีกกา คู่ ของ ตัว เอง ไว้ หลัง รอบ นี้ พื้น ผิว เทมเพลต ของ ค่า จะ ใช้ ค่า ตาม ตัว อักษร ที่ แทน ค่า แล้ว และ ไม่ รับ .parametersในบริบท เทมเพลต
แมปdirectory: และ subDirectory: ที่.parameters.<slot> โดยตรงvalues ของ Aggregate แมปvalues: ที่.parameters สดtemplates/expansion-matrix.md แถวpath-template-variables.md สำหรับ
สำหรับvocabulary/data-pillars.md § “พารามิเตอร์” และ § “รายการtemplates/parameters-context.md
เส้นเชื่อม uses คือการเรียกที่ Aggregate ประกาศ
เส้นuses คือ
การcore/caller-allowlist ของuses ชี้core/egress-allowlist ให้uses ของ
การแนบของการเชื่อมต่อเอง: features ในรายการ uses
การuses: แบบtarget, inject และ values แล้วfeatures: แต่ละfeaturesSchema ของ
spec: parameters: openai_key_secret: { type: string } components: router: type: core/gateway/litellm # its `models` socket declares a `credential` slot values: { model: gpt } # the alias it publishes as its model uses: models: gpt: target: gpt features: credential: type: core/referenced-secret values: origin: "{{ .parameters.openai_key_secret }}" key: api-key plain: target: plain # this connection carries no attachment gpt: type: core/ai-model/openai values: { model: gpt-4o-mini } plain: type: core/ai-model/ollama values: { model: llama3.1 }การtype (จำเป็น) description ที่values สำหรับ Feature ไม่มี uses และinject: การinject เอกสาร
เฉพาะfeaturesSchema ของselector ที่required ที่
การuses: ของ Feature ที่features: เมื่อfeaturesSchema ของ
ชื่อ<alias>.<slot> คือ alias ที่gpt.credential ข้างfeatures: ของ.attachment_name (ดู ชื่อ
จากvalues ของvalues และ infra ของ
- ไม่
อยู่ ใน .featuresของ Recipe ฝั่งผู้ เสาบริโภค หลัก นั้น มี เฉพาะ การ แนบ ที่ เขียน บน บล็อก ของ ส่วน ประกอบ เอง ดัง นั้น Recipe ที่ ค้นหา การ แนบ ของ ตน ตาม ชนิด ผ่าน .featuresจะไม่ ได้ รับ ข้อมูล รับรอง ของ การ เชื่อม ต่อ เลย Recipe อ่าน การ แนบ ของ การ เชื่อม ต่อ จาก การ เชื่อม ต่อ นั้น เอง ที่ .context.uses.<alias>.features.<slot>ในรูป ทรง ที่ .featuresถือ รวมถึง providesที่หา การค่า แล้ว ของ การ แนบ (ดู แนบ )ของ การ เชื่อม ต่อ - อยู่
บน เอาต์พุตฝั่ง ผู้ บริโภค เท่านั้น ที่ เรนเดอร์ ของ เป้า หมาย เหมือน เดิม ไม่ ว่าการ เชื่อม ต่อ ที่มา ถึง จะ มี อะไร
สำเนาuses: ของtype และ description แต่values ใด
Release ปรับinfra ได้ หรือ
การปิดส่วนประกอบหรือโมดูล: active:
อินสแตนซ์active: ที่
spec: parameters: enable_cache: type: boolean default: false components: api: type: core/server:1.0.0 redis: type: core/redis:1.0.0 active: "{{ .parameters.enable_cache }}" aggregates: reporting: type: my-catalog/reporting-module:1.0.0 active: falseเขียน.parameters ที่
สิ่งuses: ของ
ส่วนapi ประกาศuses: ไปredis และ redis ถูกapi ว่างuses: ของ
สวิตช์active: โดยdefault: ใน spec.parameters เพื่อactive: แทนactive: toggle does not resolve to true or false (สวิตช์ active: หา
ส่วน
คำอธิบายประกอบบนระบบย่อยและส่วนประกอบ
ระบบannotations: คำmappings.features.annotations ของ Manifest ประกาศmaps.values ของmaps.infra จะ
รูปทรงของค่า
คีย์
- คีย์
ที่ — ขอบเขตไม่มี ไม่ ประกาศ ค่า สำหรับ คำ อธิบาย ประกอบ นี้ ระบบ ย่อย ที่ ซ้อน อยู่ และ ส่วน ประกอบ ที่ อยู่ ภายใน สืบทอด การ ผูก ใดๆ จาก ขอบเขต บรรพบุรุษ - สตริง
สเกลาร์ — ค่าเดียว การ ผูก ของ Manifest ต้อง ประกาศ เพียง หนึ่ง เส้น ทาง โดย รวม และ สเกลาร์ จะ ส่ง ไป ยัง เส้น ทาง นั้น - ออบเจ็กต์
ที่ — แมปมี โครงสร้าง ของ คีย์ ย่อย กับ ค่า ย่อย คีย์ ย่อย แต่ละ ตัว ของ ออบเจ็กต์ ส่ง ผ่าน mapsของการ ผูก ใน Manifest ไป ยัง ฟิลด์ สคีมา ของ Feature ที่ สอดคล้อง กัน ณ เสา หลัก ที่ ประกาศ - YAML
nullแบบชัดเจน — ขอบเขตลบ การ ผูก ที่ สืบทอด มา ทุก รายการ สำหรับ คีย์ นี้ ออก จาก ทรี ย่อย ของ ตน ส่วน ประกอบ พี่ น้อง และ ระบบ ย่อย พี่ น้อง ยัง คง การ สืบทอด ของ ตน มี เพียง ขอบเขต ที่ เลือก ไม่ รับ เท่านั้น ที่ สูญ เสีย การ ผูก
spec: subsystems: data: annotations: feature.myco/db-pool: "shared-pool" # scalar value — propagates to api and worker components: api: type: core/server:1.0.0 # inherits feature.myco/db-pool: "shared-pool" worker: type: core/server:1.0.0 annotations: feature.myco/db-pool: null # opts out for this component only special: type: core/server:1.0.0 annotations: feature.myco/db-pool: "vip-pool" # closer-level overrideค่าที่มีโครงสร้างสำหรับ Features ที่มีหลายฟิลด์
Feature ที่values ส่วนinfra อยู่
spec: subsystems: data: annotations: feature.myco/db-pool: db_name: "prod-db" read_replicas: 5 components: api: type: core/server:1.0.0 annotations: feature.myco/db-pool: db_name: "api-override" # closer-level override at subkey granularity # read_replicas not listed → inherits 5 from parent analytics: type: core/server:1.0.0 annotations: feature.myco/db-pool: read_replicas: null # per-subkey opt-outค่าที่null แบบtype ที่
ความเป็นอิสระรายคีย์
คีย์annotations.feature.myco/db-pool: null เลือก
คำอธิบายประกอบของส่วนประกอบระดับบนสุด
ส่วนspec.components แทนที่annotations: ของ
สำหรับ
รูปแบบ YAML anchor (บล็อก defs:)
สคีมาdefs: ระดับ&anchor) และ*anchor) เท่านั้น คอมไพเลอร์defs: ที่
apiVersion: aggrega.ai/v1beta1kind: Aggregatemetadata: name: anchored-app version: 1.0.0defs: - &default_log_level "info"spec: components: primary: type: core/compute/api-server:1.0.0 values: log_level: *default_log_level secondary: type: core/compute/python:1.0.0 values: log_level: *default_log_levelanchor ถูก*default_log_level จึง"info" เมื่อdefs: เป็น