Skip to content

Worker Deployment 0.2.0

トラフィックを受け取るWorkerのバージョンを選びます。

公開パッケージの内容を取得して検証済みです。

Hostの対応や受け入れ判断は、パッケージの公開とは別です。このバージョンを使う前に、利用先のHostで確認してください。

他のバージョン: WorkerDeployment 0.1.0

使い方

重みはベーシスポイントで指定し、合計を10000にします。ロールバックは重みの変更で行い、変更不可のバージョンを書き換えません。

関連するForms: ModuleWorker 0.1.0 · WorkerVersion 0.3.0 · WorkerEndpoint 0.1.0 · WorkerCustomDomain 0.1.0

定義の説明(英語原文)

Selects which Worker Versions of one Module Worker serve traffic and in what proportion. Weights are basis points and must sum to exactly 10000 across entries; the sum is host-validated semantics because a schema cannot add weights. Rollback is re-weighting, never mutating a revision.

設定項目

項目名とスキーマ内の説明は、パッケージに含まれる英語の原文です。日本語の解説は定義に要件を追加するものではありません。

versions

必須 · array

Active Worker Versions and their traffic weights in basis points. Weights must sum to exactly 10000.

  • maxItems: 8
  • minItems: 1
  • uniqueItems: true

worker

必須 · object

Module Worker identity whose traffic this deployment governs.

  • additionalProperties: false

設定の例

パッケージに含まれるfixtures/desired.jsonをそのまま掲載しています。完全なHost APIリクエストやOpenTofuの設定ではありません。例のリソース参照とArtifactのダイジェストは、実際の値に置き換えてください。このJSONだけでリソースが作成されることはありません。

json
{
  "versions": [
    {
      "weight": 10000,
      "workerVersion": {
        "apiVersion": "edge.forms.takoform.com",
        "kind": "WorkerVersion",
        "name": "worker-version"
      }
    }
  ],
  "worker": {
    "apiVersion": "edge.forms.takoform.com",
    "kind": "ModuleWorker",
    "name": "module-worker"
  }
}

例の原文を見る

設定のスキーマ全文(英語原文)

入れ子の項目、選択肢、すべてのスキーマ制約を以下に掲載しています。Hostが検証する意味上の規則は、定義の説明にも記載されています。

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Selects which Worker Versions of one Module Worker serve traffic and in what proportion. Weights are basis points and must sum to exactly 10000 across entries; the sum is host-validated semantics because a schema cannot add weights. Rollback is re-weighting, never mutating a revision.",
  "properties": {
    "versions": {
      "description": "Active Worker Versions and their traffic weights in basis points. Weights must sum to exactly 10000.",
      "items": {
        "additionalProperties": false,
        "properties": {
          "weight": {
            "description": "Traffic share in basis points (1..10000).",
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          },
          "workerVersion": {
            "additionalProperties": false,
            "description": "Worker Version receiving this weight.",
            "properties": {
              "apiVersion": {
                "const": "edge.forms.takoform.com",
                "type": "string"
              },
              "kind": {
                "const": "WorkerVersion",
                "type": "string"
              },
              "name": {
                "maxLength": 63,
                "minLength": 1,
                "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$",
                "type": "string"
              }
            },
            "required": [
              "apiVersion",
              "kind",
              "name"
            ],
            "type": "object",
            "x-takoform-target-formrefs": [
              {
                "apiVersion": "edge.forms.takoform.com",
                "definitionVersion": "0.3.0",
                "kind": "WorkerVersion",
                "schemaDigest": "sha256:65870343bfab512fe5e7ae6faea8b3dbc48f9c9de0d4d9349dcbfd819f06d365"
              }
            ]
          }
        },
        "required": [
          "weight",
          "workerVersion"
        ],
        "type": "object"
      },
      "maxItems": 8,
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "worker": {
      "additionalProperties": false,
      "description": "Module Worker identity whose traffic this deployment governs.",
      "properties": {
        "apiVersion": {
          "const": "edge.forms.takoform.com",
          "type": "string"
        },
        "kind": {
          "const": "ModuleWorker",
          "type": "string"
        },
        "name": {
          "maxLength": 63,
          "minLength": 1,
          "pattern": "^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$",
          "type": "string"
        }
      },
      "required": [
        "apiVersion",
        "kind",
        "name"
      ],
      "type": "object",
      "x-takoform-target-formrefs": [
        {
          "apiVersion": "edge.forms.takoform.com",
          "definitionVersion": "0.1.0",
          "kind": "ModuleWorker",
          "schemaDigest": "sha256:049df2fb1eda53e4ccb0d646022a3ded8bc17c44eb433fa2e5ac0861efe42ac7"
        }
      ]
    }
  },
  "required": [
    "versions",
    "worker"
  ],
  "title": "Worker Deployment desired state",
  "type": "object"
}

ライフサイクル

役割: deployment

  • create
  • read
  • update
  • delete
  • import
  • observe

提供するInterface

ありません。

パッケージ参照

項目
KindWorkerDeployment
Package digestsha256:a752244c9f90caf18f9b5cec1b6b850fc318e6ec937d5b23eec33169f638c281
Schema digestsha256:3d5174bf2c3f351cf1468607689019e9eaa503a353eceb3095cf3d31bad62081
Tagforms/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2xn5zgwzlsirsxa3dppfwwk3tu/sha256-a752244c9f90caf18f9b5cec1b6b850fc318e6ec937d5b23eec33169f638c281
Source pathforms/releases/k-mvsgozjomzxxe3ltfz2gc23pmzxxe3jomnxw2l2xn5zgwzlsirsxa3dppfwwk3tu/sha256-a752244c9f90caf18f9b5cec1b6b850fc318e6ec937d5b23eec33169f638c281
署名セットe7f8a39311dd011b8467e97e7f300cabb9a6b06c

変更不可のパッケージを開く

4項目のFormRef
json
{
  "apiVersion": "edge.forms.takoform.com",
  "kind": "WorkerDeployment",
  "definitionVersion": "0.2.0",
  "schemaDigest": "sha256:3d5174bf2c3f351cf1468607689019e9eaa503a353eceb3095cf3d31bad62081"
}