ไฟล์ของการบิลด์
หน้า
aggrega draft --example quickstart-webจาก
cd quickstart-webcd 1aggrega build --release release.yaml --auto-pullexport QUICKSTART_DB_PASSWORD=choose-a-passworddocker compose -p quickstart-web -f dist/compose/docker-compose.yaml up -d --wait# then open http://127.0.0.1:8080/ in your browserไฟล์ห้าประเภท แต่ละประเภทมีผู้เขียนหนึ่งคน
การ
- Component ระบุ
ว่า ส่วน ประกอบ ชนิด หนึ่ง คือ อะไร ได้แก่ ค่าที่ นัก พัฒนา ตั้ง ได้ การ ตั้ง ค่า โครงสร้าง พื้น ฐาน ที่ ผู้ ดำเนิน การ ตั้ง ได้ สิ่ง ที่ มัน เผย แพร่ ให้ ส่วน ประกอบ ที่ เชื่อม ต่อ กับ มัน และ ซ็อกเก็ต ที่ มัน เชื่อม ต่อ ผ่าน แค็ตตาล็อก ไลบรารี มาตรฐาน มี Components ที่ แอปพลิเคชัน ส่วน ใหญ่ ต้องการ เช่น core/datastore/postgresและcore/compute/serverพื้นที่ทำงาน จึง มัก ไม่ เขียน เลย - Aggregate เป็น
ของ นัก พัฒนา คือ แอปพลิเคชัน มี ส่วน ประกอบ ใด บ้าง และ แต่ละ ส่วน เชื่อม ต่อ กับ อะไร - Recipe เปลี่ยน
ส่วน ประกอบ ชนิด หนึ่ง ให้ เป็น ไฟล์ สำหรับ เครื่อง มือ หนึ่ง เช่น บริการ Compose chart ของ Helm หรือ โมดูล Terraform - Manifest เลือก
ว่า Recipe ใด ทำให้ ส่วน ประกอบ แต่ละ ชนิด เป็น จริง สำหรับ เป้า หมาย หนึ่ง - Release ระบุ Aggregate และ Manifest และ
ให้การ ตั้ง ค่า ของ สภาพ แวดล้อม หนึ่ง เป็น สิ่ง ที่ คุณ บิลด์: aggrega build --release release.yaml
การ
Aggregate: ส่วนประกอบและการเชื่อมต่อของส่วนประกอบ
ขั้น1/aggregate.yaml โดย
spec: components: web: type: core/compute/server features: db_password: type: core/secret-value values: key: PGPASSWORD origin: "${QUICKSTART_DB_PASSWORD}" uses: database: db: target: db inject: env: - in: PGHOST from: host - in: PGPORT from: port - in: PGUSER from: user - in: PGDATABASE from: database
db: type: core/datastore/postgres features: password: type: core/secret-value values: key: POSTGRES_PASSWORD origin: "${QUICKSTART_DB_PASSWORD}"ไม่มีweb เชื่อมdb ผ่านdatabase ของinject บอกfrom: ระบุin: ระบุ
การเชื่อมต่อคือสตริงที่ส่งผ่าน
Recipe ของhost port user และ database ให้การhost ถือ
Manifest และ Release
Manifest จาก 1/manifest.yaml ผูก
spec: mappings: components: type: core/compute/server:1.1.0: compose/server:2.0.0 core/datastore/postgres:1.0.0: compose/postgres:1.0.0 features: type: core/secret-value:1.0.0: compose/dotenv-secret:1.0.0Release จาก 1/release.yaml ระบุ Aggregate และ Manifest และ
spec: aggregate: quickstart-web manifest: quickstart-web-compose components: web: infra: image: hub.aggrega.ai/tools/quickstart-web:1.1.0@sha256:… port: 8080 published_port: 8080 db: {}ขั้น
พารามิเตอร์: Aggregate เดียว หลายสภาพแวดล้อม
ค่าที่
spec: parameters: report_schedule: type: string default: "" components: report: type: core/compute/task values: schedule: "{{ .parameters.report_schedule }}"และ Release ทำให้
spec: parameters: report_schedule: "30 2 * * 1-5"การvalues ของparameters: { $import: ./env/prod-values.yaml }