Skip to content

English

Sources of truth (code)

D1 provision_jobs ↔ placement

ColumnValuesMeaning
infra_modecreate_new_server | use_existingMirrors placement.create_new_server.
dedicated1 or NULL1 when placement.dedicated is true (dedicated stack: three-server model per product docs).
regionsg | us | euFrom decidePlacement.
trace_idtrace_*Funnel and POST /internal/trace-events correlation.

ProvisionQueueMessage (queue or workflow_dispatch body inputs)

FieldType in TSSource
job_idstringprovision_jobs.job_id
tenant_idstringTenant canonical id
regionstringplacement.region
create_new_serverstringString(placement.create_new_server)"true" or "false"
target_server_idstringplacement.target_server_id ?? ''
subdomain_slugstringRequest / checkout metadata
canonical_hostnamestringDerived tenant hostname
dedicatedstring (optional)placement.dedicated ? 'true' : 'false'
trace_idstring (optional)Same as job

Note: GitHub’s workflow_dispatch API expects inputs to match workflow input types. If your dispatcher sends JSON strings for booleans, ensure the workflow still evaluates correctly (boolean create_new_server, string dedicated compared with "true" in YAML).

GitHub Actions provision-tenant.yml inputs (subset)

Workflow inputTypical sourcePulumi / resolve behavior
job_idjob_idTrace and callbacks
tenant_idtenant_idDNS, dedicated stack name
regionregionShared stack name when not dedicated
target_server_idtarget_server_idIf set: GET /internal/nodes/:node_id for host
create_new_servercreate_new_serverIf true and no target: run pulumi up in cloned prego-pulumi
subdomain_slug, canonical_hostnameSameCloudflare tenant DNS job
dedicateddedicatedIf string true: Pulumi stack dedicated-{sanitized_tenant_id}; else stack {region}
trace_idtrace_idPOST /internal/trace-events

Pulumi stack selection (from workflow)

  • Dedicated: stack = dedicated-${safe_id} where safe_id is derived from tenant_id (alphanumeric/hyphen, truncated).
  • Shared: stack = region (e.g. sg).
  • Secrets: workflow uses HCLOUD_TOKEN_SG and PULUMI_ACCESS_TOKEN in the Pulumi up step (adjust per org if you add per-region tokens).

Post-Pulumi: node registration

When create_new_server is true and Pulumi succeeds, the workflow posts POST /internal/nodes with a generated node_id (see workflow Register new node step). Align naming with Hetzner node ID mapping so metrics agents use the same node_id.

Internal placement compute (read-only)

To preview the same PlacementResult as production without enqueueing a job or calling Zuplo, use POST /internal/placement/compute on the Control Plane Worker (Bearer). See Internal placement API.


한국어

요약

  • Control Plane의 decidePlacement 결과가 provision_jobsProvisionQueueMessage로 옮겨지고, GitHub Actions provision-tenant 워크플로 입력으로 전달됩니다.
  • 신규 서버가 필요하면 워크플로에서 prego-pulumi 저장소를 클론한 뒤 pulumi up을 실행하며, dedicated 여부에 따라 스택 이름이 갈립니다 (dedicated-* vs 리전명).
  • 생성 후 POST /internal/nodes 로 노드가 등록되므로, 메트릭 푸시에 쓰는 node_id와 운영 매핑표를 일치시켜야 합니다.

관련 문서: 내부 Placement API, 완료 정의(DoD), 테넌트 프로비저닝 플로

Help