extends และ implements
การสืบทอดผ่าน extends
เอนทิตีComponent, Feature) รองรับextends ซึ่ง
หน้าextends Release และ Manifest ก็entities/release.md และ entities/manifest.md
extends ของ Component ประกอบโครงสร้างและสืบทอดเสาหลักทั้งก้อน
สำหรับ Component extends ประกอบ metadata.labels, metadata.annotations, spec.featuresSchema (สล็อตspec.usesSchema (ซ็อกเก็ตspec.inject (รายการvalues, infra, provides — ไม่schema: inherited และschema: ของ
สคีมา Component ที่schema: บน Component ที่extends: การschema: ไปschema: inherited บน Component ที่extends:
ผล
- ชุด
คีย์ Component ที่ถูก กำหนด โดย ฐาน ขยาย ไม่ ประกาศ คีย์ เสา หลัก จึง ซ่อน ทิ้ง หรือ เปลี่ยน ชนิด ของ คีย์ ที่ ฐาน ประกาศ ไม่ ได้ และ ไม่ เพิ่ม คีย์ ของ ตนเอง อินสแตนซ์ ของ ฐาน และ อินสแตนซ์ ของ สิ่ง ใด ก็ตาม ที่ ขยาย ฐาน นั้น ถูก ตรวจ สอบ ความ ถูก ต้อง กับ สัญญา เสา หลัก เดียวกัน - การ
ทำให้ เข้ม ขึ้น ย้าย ไป ที่ assertions:ส่วนที่ ทำให้ เฉพาะ ซึ่ง ต้อง รับ น้อย กว่า ที่ เสา หลัก ที่ สืบทอด รับ ระบุ ไว้ เป็น predicate บน ตัว เอง ไม่ใช่ เป็น ลีฟ สคีมา ที่ แคบ ลง หาก ฐาน core/base-serverประกาศtls_enabled: { type: boolean, default: true }ส่วนที่ ทำให้ เฉพาะ ซึ่ง ต้อง ใช้ TLS อย่าง ไม่มี เงื่อนไข เขียน ว่า:
apiVersion: aggrega.ai/v1beta1kind: Componentmetadata: name: core/tls-only-server version: 1.0.0 labels: component.aggrega.ai/type: "server"spec: extends: core/base-server schema: inherited # values, infra and provides are the base's, verbatim assertions: tls-is-mandatory: | {{- if not .values.tls_enabled -}} {{- fail "this component requires tls_enabled: true" -}} {{- end -}}กฎentities/component.md “การ
extends ของ Feature ประกอบเสาหลักของตน
สำหรับ Feature schema: ของfeature.aggrega.ai/kind: secret — ใช้
คอมไพเลอร์
การผูกอินเทอร์เฟซผ่าน implements
Recipes และ FeatureRecipes ผูกimplements: ที่spec การ
- ตรง
ทุก —ประการ implements: core/api-server:1.0.0— จับคู่ เวอร์ชัน เฉพาะ หนึ่ง เวอร์ชัน ของ ชนิด Component - ช่วง
ที่ —เข้า กัน ได้ ระดับ เมเจอร์ implements: core/api-server:^1.0.0— จับคู่ ทุก เวอร์ชัน ที่ เข้า เงื่อนไข >=1.0.0, <2.0.0(เข้ากัน ได้ ระดับ เมเจอร์ ตาม SemVer) ใช้ เมื่อ Recipe รองรับ ช่วง ที่ เข้า กัน ได้ แทน เวอร์ชัน ที่ ปัก หมุด เพียง เวอร์ชัน เดียว - ไม่
ระบุ —เวอร์ชัน implements: core/api-server— จับคู่ ทุก เวอร์ชัน ของ ชนิด Component ใช้ เมื่อ Recipe ให้ บริการ ทุก เวอร์ชัน ของ ชนิด นั้น
implements: ไม่implements: ของ Recipe ที่implements: ของ Recipe ไม่implements: ของ Recipe นั้น เมื่อcomponents.type ไป
การimplements: คือcore/postgres มี Recipe หนึ่งhelm และcompose ได้ แต่ละ Recipe ประกาศimplements: เดียวกัน และ Manifest ที่ Release บิลด์
Recipe ที่เขียนกับฐานให้บริการทุกสิ่งที่ขยายฐานนั้น
implements: ระบุextends ไม่
มี
- Recipe ตรง
กัน การตรวจ สอบ ความ สอดคล้อง ระหว่าง คีย์ ชนิด ของ การ แมป ใน Manifest กับ implements:ของ Recipe ที่แมป หรือ ฐานยอมรับ การ แมป เมื่อ Recipe อิมพลีเมนต์ ชนิด ที่ แมป เอง ใด ที่ ชนิด นั้น ขยาย รูป แบบ เวอร์ชัน สาม แบบ ข้าง ต้น ใช้ กับ ฐาน เหมือน ที่ ใช้ กับ ชนิด เอง: Recipe ที่ ประกาศ implements: core/base-server:^1.0.0เป็นไป ตาม ส่วน ที่ ทำให้ เฉพาะ ซึ่ง ฐาน คือ เวอร์ชัน 1.4.0และไม่ เป็น ไป ตาม ส่วน ที่ ฐาน คือ 2.0.0 - Manifest ยัง
ต้อง การแมป ชนิด ของ ส่วน ที่ ทำให้ เฉพาะ เอง เลือก Recipe ใช้ คีย์ การ แมป ที่ ตรง ทุก ประการ อินสแตนซ์ ของ enterprise/labelled-serverต้องมี รายการ mappings.components.typeของตนเอง และ ไม่ สืบทอด รายการ ที่ เขียน ไว้ สำหรับ core/base-serverส่วนที่ ทำให้ เฉพาะ ซึ่ง ไม่มี รายการ ของ ตนเอง จะ หยุด ด้วย การ วินิจฉัย อินสแตนซ์ ที่ ไม่ ได้ แมป แม้ ฐาน จะ ถูก แมป แล้ว
ดัง
# The wrapper extends core/base-server and authors no pillars.# core/helm/base-server declares: implements: core/base-serverspec: mappings: components: type: enterprise/labelled-server:1.0.0: core/helm/base-server:1.0.0เมื่อextends ของaggrega pull ทำ: ฐานextends: ที่ Release ไป
ข้อ
สำหรับexamples/extends-wrapper/
การใช้เวอร์ชันข้ามเอนทิตี
เอนทิตีmetadata.version ที่MAJOR.MINOR.PATCH ตาม architecture/02-ecosystem-philosophy.md) เวอร์ชัน10-status.md จัด:<version> ที่
| เอนทิตี | รูป | สถานะ |
|---|---|---|
| Component | การimplements: ของ Recipe | available — รูป^MAJOR.MINOR.PATCH) และ |
| Feature | การimplements: ของ FeatureRecipe | เหมือน Component |
| Recipe | การ | available — รูป |
| FeatureRecipe | การ | เหมือน Recipe |
| Aggregate | การaggregates[].type ของ | available — รูป |
| Plugin | การrecipe.spec.capability → spec.provider.capabilities | available — ความhelm:<version>, helm:^<version>) เลือกoci://<repository> ที่metadata.version และ |
| Manifest | ที่มาmanifest_version) | available (อ่าน |
| Release | ที่มาrelease_version) บวก.metadata.release_version) | เหมือน Manifest |
รูปtype ของtype ของaggregates[].type ของplugin ของimplements: อ่านrecipe.spec.capability เปล่าๆ เทียบspec.provider.capabilities ของ
การmappings.{components,features} แบบname และ type โดยentities/manifest.md ตัวspec.implements ไม่spec.capability ของ Recipe ที่
รูปmetadata.version ของ Manifest และ metadata.version ของ Release ถูกmanifest_version และ release_version ไม่มี.metadata.release_version ด้วย ไม่มี
การ
การส่งผ่านข้ามเสาหลักผ่านบริดจ์สคีมา: การเชื่อมเจตนาเข้ากับโครงสร้างพื้นฐาน
Aggrega แสดงvalues ขณะinfra สคีมา Aggregate.yaml บังคับinfra ไม่มีfeatures ของadditionalProperties: false จะschema: ของ Component และvalues
สำหรับ
รูปvalues ของschema: และvaluesMapping: ของ Recipe ที่infra: ที่extends: ฐาน
# Domain 2: The Platform Catalog (the schema-bridge Component)apiVersion: aggrega.ai/v1beta1kind: Componentmetadata: name: core/high-perf-postgres version: 1.0.0 labels: component.aggrega.ai/type: "stateful-server"spec: schema: values: # Expose the dial safely to the Developer with a typed contract. required_iops: { type: integer, min: 1000, max: 100000, required: true } infra: # Operator-owned sizing the Recipe below reads alongside the dial. storage: { size: { type: string, default: 100Gi } } compute: { instance_class: { type: string, default: db.m5.large } }# Domain 2: The Platform Catalog (the Recipe pipes the dial into provider infra)apiVersion: aggrega.ai/v1beta1kind: Recipemetadata: name: aws-rds-high-perf-postgres version: 1.0.0spec: implements: core/high-perf-postgres:^1.0.0 capability: terraform source: ./modules/rds valuesMapping: | # The Recipe pipes the developer's values.required_iops into the provider's infra-side knob. iops: {{ .values.required_iops }} allocated_storage: "{{ .infra.storage.size }}" instance_class: "{{ .infra.compute.instance_class }}"# Domain 1: The Developer Intent (remains capability-agnostic)components: trading-db: type: core/high-perf-postgres:1.0.0 values: required_iops: 10000 # Developer dictates the hardware constraint safelyการAggregate.yaml ของparameters ที่Release เฉพาะvalues: โดยvaluesMapping: ของ Recipe ส่ง
1. เจตนาparameters ที่
spec: parameters: env_iops: type: integer min: 1000 max: 100000 description: Provisioned IOPS for the trading-db instance components: trading-db: type: core/high-perf-postgres:1.0.0 values: required_iops: {{ .parameters.env_iops }} # Hoisted to the environment2. Releases ของ GitOps (ฝ่ายparameters ในRelease เฉพาะ
- สภาพ
แวดล้อม Dev ( release-dev.yaml):env_iops: 1000 - สภาพ
แวดล้อม Prod ( release-prod.yaml):env_iops: 25000
ลำดับ
- การ
ตรวจ แต่ละสอบ ความ ถูก ต้อง ของ สัญญา พารามิเตอร์ ค่า พารามิเตอร์ ที่ Release จัดหา ตรวจ สอบ ความ ถูก ต้อง กับ การ ประกาศ parameters:ที่ระบุ ชนิด ของ Aggregate ค่า Prod 25000ผ่าน (อยู่ใน min: 1000, max: 100000) ค่า500จะหยุด พร้อม ข้อ ผิด พลาด ที่ ชัดเจน - การ
แทน คอมไพเลอร์ค่า อ่าน ค่า พารามิเตอร์ ของ Releaseฝั่ง Prod และแทน ค่า 25000ลงในสตริง YAML ของ Aggregateที่values.required_iopsแมปพารามิเตอร์ ที่ ผสาน แล้ว ยัง คง อยู่ ตลอด การ เรนเดอร์ เพื่อ ให้ พื้น ผิว เทมเพลต เส้น ทาง อ่าน .parameters.<slot>ได้โดยตรง พื้น ผิว เทมเพลต ค่า ใช้ ค่า ตาม ตัว อักษร หลัง การ แทน ค่าที่ เขียน ไว้ แล้ว ใน บล็อก values:ของ Aggregate แมปอ่าน ได้ จน ทุก ช่วง การ เรนเดอร์ เสร็จ สิ้น และ เข้า ถึง ได้ จาก การ คอมไพล์ ที่ แมป ถูก หา ค่า ไว้ ให้ เท่านั้น - การ
ตรวจ การสอบ ความ ถูก ต้อง ของ สคีมา ประกาศ schema:ของ Component ตรวจสอบ ความ ถูก ต้อง ของ แมป values:ที่ได้ values.required_iops: 25000เป็นไป ตาม min: 1000, max: 100000ของสคีมา - การ
เรนเดอร์ valuesMapping ของ Recipe เทมเพลตvaluesMapping:ของ Recipe ที่ผูก ไว้ ส่ง ผ่าน values.required_iopsเข้าสู่ เอาต์พุต รูป แบบ infraของผู้ ให้ บริการ ( iops: 25000) ปลั๊กอินผู้ ให้ บริการ Wasm สร้าง การ กำหนด ค่า ฐาน ข้อมูล เชิง กายภาพ ที่ ถูก ต้อง นัก พัฒนา ได้การ ควบคุม ฮาร์ดแวร์ ที่ ชัด แจ้ง ฝ่าย ปฏิบัติ การ ได้การ ปรับ ขนาด เฉพาะ สภาพ แวดล้อม และ Aggregateยังคง ไม่ ขึ้น กับ ความ สามารถ ใด