diff --git a/Makefile b/Makefile index dc8ab5025..d43b05677 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ system-nexus-wit-install: nex-gen-install: printf $(COLOR) "Install nex-gen if missing..." - command -v $(NEX_GEN) >/dev/null || cargo install nex-gen + command -v $(NEX_GEN) >/dev/null || cargo install nex-gen --version ^0.1 ##### Clean ##### clean: diff --git a/openapi/openapiv2.json b/openapi/openapiv2.json index 97ff181c9..b62198fae 100644 --- a/openapi/openapiv2.json +++ b/openapi/openapiv2.json @@ -10848,6 +10848,102 @@ }, "description": "Target a worker polling on a Nexus task queue in a specific namespace." }, + "EnvironmentInfoArchitecture": { + "type": "string", + "enum": [ + "ARCHITECTURE_UNSPECIFIED", + "ARCHITECTURE_AMD64", + "ARCHITECTURE_ARM64" + ], + "default": "ARCHITECTURE_UNSPECIFIED" + }, + "EnvironmentInfoHostingEnvironment": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/HostingEnvironmentHostingEnvironmentType", + "description": "The type of hosting environment." + }, + "version": { + "type": "string", + "description": "The version of the hosting environment, if obtainable." + } + } + }, + "EnvironmentInfoLinuxPlatform": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "The Linux kernel or distribution version, if obtainable." + }, + "architecture": { + "$ref": "#/definitions/EnvironmentInfoArchitecture", + "description": "The architecture of the worker process." + }, + "libc": { + "$ref": "#/definitions/LinuxPlatformLibc", + "description": "The libc used by the worker process." + } + } + }, + "EnvironmentInfoMacOSPlatform": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "The macOS version, if obtainable." + }, + "architecture": { + "$ref": "#/definitions/EnvironmentInfoArchitecture", + "description": "The architecture of the worker process." + } + } + }, + "EnvironmentInfoPlatform": { + "type": "object", + "properties": { + "linux": { + "$ref": "#/definitions/EnvironmentInfoLinuxPlatform" + }, + "macos": { + "$ref": "#/definitions/EnvironmentInfoMacOSPlatform" + }, + "windows": { + "$ref": "#/definitions/EnvironmentInfoWindowsPlatform" + } + } + }, + "EnvironmentInfoRuntime": { + "type": "object", + "properties": { + "type": { + "$ref": "#/definitions/RuntimeRuntimeType", + "description": "The type of the runtime." + }, + "version": { + "type": "string", + "description": "The version of the runtime, if obtainable." + } + } + }, + "EnvironmentInfoWindowsPlatform": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "The Windows version, if obtainable." + }, + "architecture": { + "$ref": "#/definitions/EnvironmentInfoArchitecture", + "description": "The architecture of the worker process." + }, + "crt": { + "$ref": "#/definitions/WindowsPlatformCrt", + "description": "The C runtime used by the worker process, if obtainable." + } + } + }, "EventGroupMarkerInboundEvent": { "type": "object", "properties": { @@ -10867,6 +10963,23 @@ }, "description": "The identifier of an inbound Update (request.meta.update_id)\nwhose handler triggered implicit creation of this group Marker.\n\nUsed in place of `inbound_event_id` for Updates because the event ID of the\nUpdateAccepted history event is not known until the Workflow Task is\ncompleted and recorded by the server, which may be too late." }, + "HostingEnvironmentHostingEnvironmentType": { + "type": "string", + "enum": [ + "HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED", + "HOSTING_ENVIRONMENT_TYPE_DOCKER", + "HOSTING_ENVIRONMENT_TYPE_K8S", + "HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA", + "HOSTING_ENVIRONMENT_TYPE_AWS_ECS", + "HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN", + "HOSTING_ENVIRONMENT_TYPE_GOOGLE_APP_ENGINE", + "HOSTING_ENVIRONMENT_TYPE_AZURE_APP_SERVICE", + "HOSTING_ENVIRONMENT_TYPE_AZURE_FUNCTIONS", + "HOSTING_ENVIRONMENT_TYPE_AZURE_CONTAINER_APPS" + ], + "default": "HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED", + "description": "What kind of hosting environment we're running in. This list is about what can actually be\ndetected reliably and is unrelated to what SDKs can actually run in.\n\n - HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED: Should never actually be set, exists to follow convention of having a default.\nSDKs should just leave `hosting_environments` empty if none can be determined.\n - HOSTING_ENVIRONMENT_TYPE_DOCKER: Should always be in the list if we're running inside a docker container\n - HOSTING_ENVIRONMENT_TYPE_K8S: Should always be in the list if we're running inside any k8s environment\n - HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA: Detect via `AWS_LAMBDA_FUNCTION_NAME`\n - HOSTING_ENVIRONMENT_TYPE_AWS_ECS: Detect via `ECS_CONTAINER_METADATA_URI_V4` or `ECS_CONTAINER_METADATA_URI`\n - HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN: Detect via `K_SERVICE`\n - HOSTING_ENVIRONMENT_TYPE_GOOGLE_APP_ENGINE: Detect via `GAE_SERVICE`\n - HOSTING_ENVIRONMENT_TYPE_AZURE_APP_SERVICE: Detect via `WEBSITE_SITE_NAME`\n - HOSTING_ENVIRONMENT_TYPE_AZURE_FUNCTIONS: Detect via `FUNCTIONS_EXTENSION_VERSION`\n - HOSTING_ENVIRONMENT_TYPE_AZURE_CONTAINER_APPS: Detect via `CONTAINER_APP_NAME`" + }, "LinkActivity": { "type": "object", "properties": { @@ -10944,6 +11057,15 @@ } } }, + "LinuxPlatformLibc": { + "type": "string", + "enum": [ + "LIBC_UNSPECIFIED", + "LIBC_GLIBC", + "LIBC_MUSL" + ], + "default": "LIBC_UNSPECIFIED" + }, "ListWorkerDeploymentsResponseWorkerDeploymentSummary": { "type": "object", "properties": { @@ -11099,6 +11221,24 @@ }, "description": "UpdateWorkflowOptions represents updating workflow execution options after a workflow reset.\nKeep the parameters in sync with temporal.api.workflowservice.v1.UpdateWorkflowExecutionOptionsRequest." }, + "RuntimeRuntimeType": { + "type": "string", + "enum": [ + "RUNTIME_TYPE_UNSPECIFIED", + "RUNTIME_TYPE_JVM", + "RUNTIME_TYPE_CPYTHON", + "RUNTIME_TYPE_NODE", + "RUNTIME_TYPE_BUN", + "RUNTIME_TYPE_CRUBY", + "RUNTIME_TYPE_GO", + "RUNTIME_TYPE_DOTNET_FRAMEWORK", + "RUNTIME_TYPE_DOTNET_CORE", + "RUNTIME_TYPE_NATIVE", + "RUNTIME_TYPE_ROADRUNNER" + ], + "default": "RUNTIME_TYPE_UNSPECIFIED", + "description": " - RUNTIME_TYPE_UNSPECIFIED: Should never actually be set, exists to follow convention of having a default.\nSDKs should just leave `runtimes` empty if none can be determined." + }, "UpdateTaskQueueConfigRequestRateLimitUpdate": { "type": "object", "properties": { @@ -11144,6 +11284,17 @@ "default": "PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED", "description": " - PINNED_OVERRIDE_BEHAVIOR_UNSPECIFIED: Unspecified.\n - PINNED_OVERRIDE_BEHAVIOR_PINNED: Override workflow behavior to be Pinned." }, + "WindowsPlatformCrt": { + "type": "string", + "enum": [ + "CRT_UNSPECIFIED", + "CRT_UCRT", + "CRT_MSVCRT", + "CRT_MINGW", + "CRT_CYGWIN" + ], + "default": "CRT_UNSPECIFIED" + }, "WorkerConfigAutoscalingPollerBehavior": { "type": "object", "properties": { @@ -15599,6 +15750,31 @@ }, "description": "Target to route requests to." }, + "v1EnvironmentInfo": { + "type": "object", + "properties": { + "runtimes": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/EnvironmentInfoRuntime" + }, + "description": "The runtime(s) the SDK is operating in." + }, + "hostingEnvironments": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/EnvironmentInfoHostingEnvironment" + }, + "description": "The hosting environment(s) the SDK is operating in. Repeated to allow for layering (ex: Docker inside k8s)." + }, + "platform": { + "$ref": "#/definitions/EnvironmentInfoPlatform", + "description": "The platform the SDK is operating on." + } + } + }, "v1EventGroupMarker": { "type": "object", "properties": { @@ -20673,6 +20849,10 @@ "$ref": "#/definitions/v1StorageDriverInfo" }, "description": "Storage drivers in use by this SDK." + }, + "environment": { + "$ref": "#/definitions/v1EnvironmentInfo", + "description": "Information about the environment this SDK is running in." } }, "description": "Worker info message, contains information about the worker and its current state.\nAll information is provided by the worker itself." diff --git a/openapi/openapiv3.yaml b/openapi/openapiv3.yaml index f2081bd9b..5cdd0727f 100644 --- a/openapi/openapiv3.yaml +++ b/openapi/openapiv3.yaml @@ -12084,6 +12084,135 @@ components: type: string description: Nexus task queue to route requests to. description: Target a worker polling on a Nexus task queue in a specific namespace. + EnvironmentInfo: + type: object + properties: + runtimes: + type: array + items: + $ref: '#/components/schemas/EnvironmentInfo_Runtime' + description: The runtime(s) the SDK is operating in. + hostingEnvironments: + type: array + items: + $ref: '#/components/schemas/EnvironmentInfo_HostingEnvironment' + description: 'The hosting environment(s) the SDK is operating in. Repeated to allow for layering (ex: Docker inside k8s).' + platform: + allOf: + - $ref: '#/components/schemas/EnvironmentInfo_Platform' + description: The platform the SDK is operating on. + EnvironmentInfo_HostingEnvironment: + type: object + properties: + type: + enum: + - HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED + - HOSTING_ENVIRONMENT_TYPE_DOCKER + - HOSTING_ENVIRONMENT_TYPE_K8S + - HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA + - HOSTING_ENVIRONMENT_TYPE_AWS_ECS + - HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN + - HOSTING_ENVIRONMENT_TYPE_GOOGLE_APP_ENGINE + - HOSTING_ENVIRONMENT_TYPE_AZURE_APP_SERVICE + - HOSTING_ENVIRONMENT_TYPE_AZURE_FUNCTIONS + - HOSTING_ENVIRONMENT_TYPE_AZURE_CONTAINER_APPS + type: string + description: The type of hosting environment. + format: enum + version: + type: string + description: The version of the hosting environment, if obtainable. + EnvironmentInfo_LinuxPlatform: + type: object + properties: + version: + type: string + description: The Linux kernel or distribution version, if obtainable. + architecture: + enum: + - ARCHITECTURE_UNSPECIFIED + - ARCHITECTURE_AMD64 + - ARCHITECTURE_ARM64 + type: string + description: The architecture of the worker process. + format: enum + libc: + enum: + - LIBC_UNSPECIFIED + - LIBC_GLIBC + - LIBC_MUSL + type: string + description: The libc used by the worker process. + format: enum + EnvironmentInfo_MacOSPlatform: + type: object + properties: + version: + type: string + description: The macOS version, if obtainable. + architecture: + enum: + - ARCHITECTURE_UNSPECIFIED + - ARCHITECTURE_AMD64 + - ARCHITECTURE_ARM64 + type: string + description: The architecture of the worker process. + format: enum + EnvironmentInfo_Platform: + type: object + properties: + linux: + $ref: '#/components/schemas/EnvironmentInfo_LinuxPlatform' + macos: + $ref: '#/components/schemas/EnvironmentInfo_MacOSPlatform' + windows: + $ref: '#/components/schemas/EnvironmentInfo_WindowsPlatform' + EnvironmentInfo_Runtime: + type: object + properties: + type: + enum: + - RUNTIME_TYPE_UNSPECIFIED + - RUNTIME_TYPE_JVM + - RUNTIME_TYPE_CPYTHON + - RUNTIME_TYPE_NODE + - RUNTIME_TYPE_BUN + - RUNTIME_TYPE_CRUBY + - RUNTIME_TYPE_GO + - RUNTIME_TYPE_DOTNET_FRAMEWORK + - RUNTIME_TYPE_DOTNET_CORE + - RUNTIME_TYPE_NATIVE + - RUNTIME_TYPE_ROADRUNNER + type: string + description: The type of the runtime. + format: enum + version: + type: string + description: The version of the runtime, if obtainable. + EnvironmentInfo_WindowsPlatform: + type: object + properties: + version: + type: string + description: The Windows version, if obtainable. + architecture: + enum: + - ARCHITECTURE_UNSPECIFIED + - ARCHITECTURE_AMD64 + - ARCHITECTURE_ARM64 + type: string + description: The architecture of the worker process. + format: enum + crt: + enum: + - CRT_UNSPECIFIED + - CRT_UCRT + - CRT_MSVCRT + - CRT_MINGW + - CRT_CYGWIN + type: string + description: The C runtime used by the worker process, if obtainable. + format: enum EventGroupMarker: type: object properties: @@ -19111,6 +19240,10 @@ components: items: $ref: '#/components/schemas/StorageDriverInfo' description: Storage drivers in use by this SDK. + environment: + allOf: + - $ref: '#/components/schemas/EnvironmentInfo' + description: Information about the environment this SDK is running in. description: |- Worker info message, contains information about the worker and its current state. All information is provided by the worker itself. diff --git a/temporal/api/worker/v1/message.proto b/temporal/api/worker/v1/message.proto index a87142c78..05c9e5b45 100644 --- a/temporal/api/worker/v1/message.proto +++ b/temporal/api/worker/v1/message.proto @@ -130,6 +130,9 @@ message WorkerHeartbeat { // Storage drivers in use by this SDK. repeated StorageDriverInfo drivers = 24; + + // Information about the environment this SDK is running in. + EnvironmentInfo environment = 25; } // Detailed worker information. @@ -194,6 +197,120 @@ message StorageDriverInfo { string type = 1; } +message EnvironmentInfo { + message Runtime { + enum RuntimeType { + // Should never actually be set, exists to follow convention of having a default. + // SDKs should just leave `runtimes` empty if none can be determined. + RUNTIME_TYPE_UNSPECIFIED = 0; + RUNTIME_TYPE_JVM = 1; + RUNTIME_TYPE_CPYTHON = 2; + RUNTIME_TYPE_NODE = 3; + RUNTIME_TYPE_BUN = 4; + RUNTIME_TYPE_CRUBY = 5; + RUNTIME_TYPE_GO = 6; + RUNTIME_TYPE_DOTNET_FRAMEWORK = 7; + RUNTIME_TYPE_DOTNET_CORE = 8; + RUNTIME_TYPE_NATIVE = 9; + RUNTIME_TYPE_ROADRUNNER = 10; + } + // The type of the runtime. + RuntimeType type = 1; + // The version of the runtime, if obtainable. + string version = 2; + } + + message HostingEnvironment { + // What kind of hosting environment we're running in. This list is about what can actually be + // detected reliably and is unrelated to what SDKs can actually run in. + enum HostingEnvironmentType { + // Should never actually be set, exists to follow convention of having a default. + // SDKs should just leave `hosting_environments` empty if none can be determined. + HOSTING_ENVIRONMENT_TYPE_UNSPECIFIED = 0; + // Should always be in the list if we're running inside a docker container + HOSTING_ENVIRONMENT_TYPE_DOCKER = 1; + // Should always be in the list if we're running inside any k8s environment + HOSTING_ENVIRONMENT_TYPE_K8S = 2; + // Detect via `AWS_LAMBDA_FUNCTION_NAME` + HOSTING_ENVIRONMENT_TYPE_AWS_LAMBDA = 3; + // Detect via `ECS_CONTAINER_METADATA_URI_V4` or `ECS_CONTAINER_METADATA_URI` + HOSTING_ENVIRONMENT_TYPE_AWS_ECS = 4; + // Detect via `K_SERVICE` + HOSTING_ENVIRONMENT_TYPE_GOOGLE_CLOUD_RUN = 6; + // Detect via `GAE_SERVICE` + HOSTING_ENVIRONMENT_TYPE_GOOGLE_APP_ENGINE = 7; + // Detect via `WEBSITE_SITE_NAME` + HOSTING_ENVIRONMENT_TYPE_AZURE_APP_SERVICE = 8; + // Detect via `FUNCTIONS_EXTENSION_VERSION` + HOSTING_ENVIRONMENT_TYPE_AZURE_FUNCTIONS = 9; + // Detect via `CONTAINER_APP_NAME` + HOSTING_ENVIRONMENT_TYPE_AZURE_CONTAINER_APPS = 10; + } + // The type of hosting environment. + HostingEnvironmentType type = 1; + // The version of the hosting environment, if obtainable. + string version = 2; + } + + enum Architecture { + ARCHITECTURE_UNSPECIFIED = 0; + ARCHITECTURE_AMD64 = 1; + ARCHITECTURE_ARM64 = 2; + } + + message Platform { + oneof variant { + LinuxPlatform linux = 1; + MacOSPlatform macos = 2; + WindowsPlatform windows = 3; + } + } + + message LinuxPlatform { + enum Libc { + LIBC_UNSPECIFIED = 0; + LIBC_GLIBC = 1; + LIBC_MUSL = 2; + } + // The Linux kernel or distribution version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + // The libc used by the worker process. + Libc libc = 3; + } + + message MacOSPlatform { + // The macOS version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + } + + message WindowsPlatform { + enum Crt { + CRT_UNSPECIFIED = 0; + CRT_UCRT = 1; + CRT_MSVCRT = 2; + CRT_MINGW = 3; + CRT_CYGWIN = 4; + } + // The Windows version, if obtainable. + string version = 1; + // The architecture of the worker process. + Architecture architecture = 2; + // The C runtime used by the worker process, if obtainable. + Crt crt = 3; + } + + // The runtime(s) the SDK is operating in. + repeated Runtime runtimes = 1; + // The hosting environment(s) the SDK is operating in. Repeated to allow for layering (ex: Docker inside k8s). + repeated HostingEnvironment hosting_environments = 2; + // The platform the SDK is operating on. + Platform platform = 3; +} + // A command sent from the server to a worker. message WorkerCommand { oneof type {