콘텐츠로 이동

Temporal 통합

Wippy는 내구성 있는 워크플로우 실행, 자동 리플레이, 재시작을 견디는 장기 실행 프로세스를 위해 Temporal.io와 통합됩니다.

temporal.client 엔트리 kind는 Temporal 서버에 대한 연결을 정의합니다.

- name: temporal_client
kind: temporal.client
address: "localhost:7233"
namespace: "default"
lifecycle:
auto_start: true
필드설명
addressTemporal 서버 주소 (host:port)
필드기본값설명
namespace”default”Temporal 네임스페이스
tq_prefix""모든 작업에 대한 태스크 큐 이름 접두사
connection_timeout”10s”연결 타임아웃
keep_alive_time”30s”Keep-alive 간격
keep_alive_timeout”10s”Keep-alive 타임아웃
- name: temporal_client
kind: temporal.client
address: "localhost:7233"
auth:
type: none

다음 방법 중 하나로 API 키 제공:

# 직접 값
- name: temporal_client
kind: temporal.client
address: "your-namespace.tmprl.cloud:7233"
namespace: "your-namespace"
auth:
type: api_key
api_key: "your-api-key"
# 환경 변수에서
- name: temporal_client
kind: temporal.client
address: "your-namespace.tmprl.cloud:7233"
namespace: "your-namespace"
auth:
type: api_key
api_key_env: "TEMPORAL_API_KEY"
# 파일에서
- name: temporal_client
kind: temporal.client
address: "your-namespace.tmprl.cloud:7233"
namespace: "your-namespace"
auth:
type: api_key
api_key_file: "/etc/secrets/temporal-api-key"

_env로 끝나는 필드는 시스템에 정의되어야 하는 환경 변수를 참조합니다. 환경 스토리지와 변수 설정은 환경 시스템을 참조하세요.

- name: temporal_client
kind: temporal.client
address: "temporal.example.com:7233"
namespace: "production"
auth:
type: mtls
cert_file: "/path/to/client.pem"
key_file: "/path/to/client.key"
tls:
enabled: true
ca_file: "/path/to/ca.pem"

인증서와 키는 PEM 문자열이나 환경에서도 제공 가능:

auth:
type: mtls
cert_pem: |
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
key_pem_env: "TEMPORAL_CLIENT_KEY"
tls:
enabled: true
ca_file: "/path/to/ca.pem"
server_name: "temporal.example.com" # 서버 이름 검증 오버라이드
insecure_skip_verify: false # 검증 건너뛰기 (개발 전용)
health_check:
enabled: true
interval: "30s"

temporal.worker 엔트리 kind는 워크플로우와 액티비티를 실행하는 워커를 정의합니다.

- name: worker
kind: temporal.worker
client: app:temporal_client
task_queue: "my-app-queue"
lifecycle:
auto_start: true
depends_on:
- app:temporal_client
필드설명
clienttemporal.client 엔트리 참조
task_queue태스크 큐 이름

워커 동작 세부 조정:

- name: worker
kind: temporal.worker
client: app:temporal_client
task_queue: "my-app-queue"
worker_options:
# 동시성
max_concurrent_activity_execution_size: 1000
max_concurrent_workflow_task_execution_size: 1000
max_concurrent_local_activity_execution_size: 1000
max_concurrent_session_execution_size: 1000
# 폴러
max_concurrent_activity_task_pollers: 20
max_concurrent_workflow_task_pollers: 20
# 레이트 제한
worker_activities_per_second: 0 # 0 = 무제한
worker_local_activities_per_second: 0
task_queue_activities_per_second: 0
# 타임아웃
sticky_schedule_to_start_timeout: "5s"
worker_stop_timeout: "0s"
deadlock_detection_timeout: "0s"
# 기능 플래그
enable_logging_in_replay: false
enable_session_worker: false
disable_workflow_worker: false
local_activity_worker_only: false
disable_eager_activities: false
# 버전닝
deployment_name: ""
build_id: ""
build_id_env: "BUILD_ID" # 환경 변수에서 읽기
use_versioning: false
default_versioning_behavior: "pinned" # 또는 "auto_upgrade"

_env로 끝나는 필드는 환경 시스템 엔트리를 통해 정의된 환경 변수를 참조합니다.

default_versioning_behavioruse_versioning이 활성화된 경우 새 워크플로 실행이 워커 빌드 ID를 선택하는 방식을 제어합니다:

동작
pinned워크플로는 실행 전체에 걸쳐 시작했던 빌드 ID에 고정됩니다
auto_upgrade워크플로는 각 태스크 이후 호환되는 최신 빌드 ID에서 재개될 수 있습니다

build_id_envbuild_id가 비어 있을 때 지정된 환경 변수에서 빌드 ID를 읽습니다.

enable_session_worker: true는 워커가 Temporal Sessions를 실행하도록 합니다: 단일 워커에 고정된 일련의 액티비티입니다 (액티비티들이 임시 디렉토리나 열려 있는 연결 같은 로컬 상태를 공유할 때 유용합니다). max_concurrent_session_execution_size는 워커의 동시 세션 수를 제한합니다.

옵션기본값
max_concurrent_activity_execution_size1000
max_concurrent_workflow_task_execution_size1000
max_concurrent_local_activity_execution_size1000
max_concurrent_session_execution_size1000
max_concurrent_activity_task_pollers20
max_concurrent_workflow_task_pollers20
sticky_schedule_to_start_timeout5s
version: "1.0"
namespace: app
entries:
- name: temporal_client
kind: temporal.client
address: "localhost:7233"
namespace: "default"
lifecycle:
auto_start: true
- name: worker
kind: temporal.worker
client: app:temporal_client
task_queue: "orders"
lifecycle:
auto_start: true
depends_on:
- app:temporal_client
- name: order_workflow
kind: workflow.lua
source: file://order_workflow.lua
method: main
modules:
- funcs
- time
meta:
temporal:
workflow:
worker: app:worker
- name: charge_payment
kind: function.lua
source: file://payment.lua
method: charge
modules:
- http_client
- json
meta:
temporal:
activity:
worker: app:worker