Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update argument lists for tasks. #299

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions assets/schemas/dapr.io/dapr/cli/run-file.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"type": "object",
"properties": {
"appChannelAddress": {
"description": "The network address the application listens on (default \"127.0.0.1\").",
"type": "string"
},
"appDirPath": {
"description": "The path to the application directory, relative to this file.",
"type": "string"
Expand Down Expand Up @@ -116,6 +120,11 @@
"type": "integer",
"minimum": 0
},
"appLogDestination": {
"description": "Where application output should be written.",
"type": "string",
"enum": ["console", "file", "fileAndConsole"]
},
"appMaxConcurrency": {
"description": "Controls the concurrency level of the application.",
"type": "integer",
Expand Down Expand Up @@ -144,9 +153,10 @@
"type": "integer",
"minimum": 0
},
"runtimePath": {
"description": "The path to the Dapr runtime (i.e. daprd).",
"type": "string"
"daprdLogDestination": {
"description": "Where daprd output should be written.",
"type": "string",
"enum": ["console", "file", "fileAndConsole"]
},
"enableApiLogging": {
"description": "Log API calls at INFO verbosity.",
Expand Down Expand Up @@ -177,7 +187,19 @@
"type": "string"
},
"resourcesPath": {
"description": "Path for resources directory.",
"description": "(Deprecated in v1.11.) Path for resources directory.",
"type": "string",
"deprecated": true
},
"resourcesPaths": {
"description": "Paths for resources directories.",
"type": "array",
"additionalProperties": {
"type": "string"
}
},
"runtimePath": {
"description": "The path to the Dapr runtime (i.e. daprd).",
"type": "string"
}
}
Expand Down
35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@
{
"type": "dapr",
"properties": {
"appChannelAddress": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.appChannelAddress.description%"
},
"appHealthCheckPath": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.appHealthCheckPath.description%"
Expand Down Expand Up @@ -428,6 +432,15 @@
"description": "%vscode-dapr.tasks.dapr.properties.httpReadBufferSize.description%",
"default": -1
},
"internalGrpcPort": {
"type": "integer",
"description": "%vscode-dapr.tasks.dapr.properties.internalGrpcPort.description%",
"default": 50001
},
"listenAddresses": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.listenAddresses.description%"
},
"logLevel": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.logLevel.description%",
Expand Down Expand Up @@ -456,6 +469,17 @@
"description": "%vscode-dapr.tasks.dapr.properties.profilePort.description%",
"default": -1
},
"resourcesPath": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.resourcesPath.description%"
},
"resourcesPaths": {
"type": "array",
"description": "%vscode-dapr.tasks.dapr.properties.resourcesPaths.description%",
"additionalItems": {
"type": "string"
}
},
"runFile": {
"type": "string",
"description": "%vscode-dapr.tasks.dapr.properties.runFile.description%"
Expand All @@ -474,6 +498,10 @@
"description": "%vscode-dapr.tasks.daprd.properties.allowedOrigins.description%",
"default": "*"
},
"appChannelAddress": {
"type": "string",
"description": "%vscode-dapr.tasks.daprd.properties.appChannelAddress.description%"
},
"appHealthCheckPath": {
"type": "string",
"description": "%vscode-dapr.tasks.daprd.properties.appHealthCheckPath.description%"
Expand Down Expand Up @@ -647,6 +675,13 @@
"type": "string",
"description": "%vscode-dapr.tasks.daprd.properties.resourcesPath.description%"
},
"resourcesPaths": {
"type": "array",
"description": "%vscode-dapr.tasks.daprd.properties.resourcesPaths.description%",
"additionalItems": {
"type": "string"
}
},
"sentryAddress": {
"type": "string",
"description": "%vscode-dapr.tasks.daprd.properties.sentryAddress.description%"
Expand Down
13 changes: 10 additions & 3 deletions package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

"vscode-dapr.view-containers.dapr-explorer.title": "Dapr",

"vscode-dapr.tasks.dapr.properties.appChannelAddress.description": "The network address the application listens on (defaults \"127.0.0.1\").",
"vscode-dapr.tasks.dapr.properties.appHealthCheckPath.description": "Path used for health checks; HTTP only.",
"vscode-dapr.tasks.dapr.properties.appHealthProbeInterval.description": "Interval to probe for the health of the app in seconds.",
"vscode-dapr.tasks.dapr.properties.appHealthProbeTimeout.description": "Timeout for app health probes in milliseconds.",
Expand All @@ -52,7 +53,7 @@
"vscode-dapr.tasks.dapr.properties.appSsl.description": "Enable HTTPS when Dapr invokes the application.",
"vscode-dapr.tasks.dapr.properties.args.description": "Additional arguments passed to the Dapr command.",
"vscode-dapr.tasks.dapr.properties.command.description": "The command and arguments used to start your application.",
"vscode-dapr.tasks.dapr.properties.componentsPath.description": "The path for components directory (default \"<user>/.dapr/components\").",
"vscode-dapr.tasks.dapr.properties.componentsPath.description": "(Deprecated in v1.10.) The path for components directory (default \"<user>/.dapr/components\").",
"vscode-dapr.tasks.dapr.properties.config.description": "The path to the Dapr configuration file.",
"vscode-dapr.tasks.dapr.properties.cwd.description": "The directory in which to start Dapr.",
"vscode-dapr.tasks.dapr.properties.enableApiLogging.description": "Log API calls at INFO verbosity. Valid values are: true or false.",
Expand All @@ -62,14 +63,19 @@
"vscode-dapr.tasks.dapr.properties.httpMaxRequestSize.description": "Max size of request body in MB.",
"vscode-dapr.tasks.dapr.properties.httpPort.description": "The HTTP port for Dapr to listen on.",
"vscode-dapr.tasks.dapr.properties.httpReadBufferSize.description": "HTTP header read buffer in KB.",
"vscode-dapr.tasks.dapr.properties.internalGrpcPort.description": "The gRPC port for the Dapr Internal API to listen on.",
"vscode-dapr.tasks.dapr.properties.listenAddresses.description": "One or more addresses for the Dapr API to listen on, CSV limited.",
"vscode-dapr.tasks.dapr.properties.logLevel.description": "Sets the log verbosity.",
"vscode-dapr.tasks.dapr.properties.metricsPort.description": "The port of metrics on dapr.",
"vscode-dapr.tasks.dapr.properties.placementHostAddress.description": "The host on which the placement service resides.",
"vscode-dapr.tasks.dapr.properties.profilePort.description": "The port for the profile server to listen on.",
"vscode-dapr.tasks.dapr.properties.resourcesPath.description": "(Deprecated in v1.11.) The path for resources directory (default \"<user>/.dapr/components\").",
"vscode-dapr.tasks.dapr.properties.resourcesPaths.description": "The paths for resources directory (default \"<user>/.dapr/components\").",
"vscode-dapr.tasks.dapr.properties.runFile.description": "Path to the run template file for the list of apps to run.",
"vscode-dapr.tasks.dapr.properties.unixDomainSocket.description": "Path to a unix domain socket dir. If specified, Dapr API servers will use Unix Domain Sockets.",

"vscode-dapr.tasks.daprd.properties.allowedOrigins.description": "Allowed HTTP origins.",
"vscode-dapr.tasks.daprd.properties.appChannelAddress.description": "The network address the application listens on (defaults \"127.0.0.1\").",
"vscode-dapr.tasks.daprd.properties.appHealthCheckPath.description": "Path used for health checks; HTTP only.",
"vscode-dapr.tasks.daprd.properties.appHealthProbeInterval.description": "Interval to probe for the health of the app in seconds.",
"vscode-dapr.tasks.daprd.properties.appHealthProbeTimeout.description": "Timeout for app health probes in milliseconds.",
Expand All @@ -80,7 +86,7 @@
"vscode-dapr.tasks.daprd.properties.appProtocol.description": "Protocol for the application.",
"vscode-dapr.tasks.daprd.properties.appSsl.description": "Sets the URI scheme of the app to https and attempts an SSL connection.",
"vscode-dapr.tasks.daprd.properties.args.description": "Additional arguments passed to the Dapr command.",
"vscode-dapr.tasks.daprd.properties.componentsPath.description": "Path for the components directory. (Standalone mode only.)",
"vscode-dapr.tasks.daprd.properties.componentsPath.description": "(Deprecated in v1.10.) Path for the components directory. (Standalone mode only.)",
"vscode-dapr.tasks.daprd.properties.config.description": "Path to the configuration file, or the name of a configuration object.",
"vscode-dapr.tasks.daprd.properties.controlPlaneAddress.description": "Address for the Dapr control plane.",
"vscode-dapr.tasks.daprd.properties.enableApiLogging.description": "Log API calls at INFO verbosity. Valid values are: true or false.",
Expand All @@ -102,7 +108,8 @@
"vscode-dapr.tasks.daprd.properties.placementHostAddress.description": "Address for the Dapr placement service.",
"vscode-dapr.tasks.daprd.properties.profilePort.description": "The port for the profile server.",
"vscode-dapr.tasks.daprd.properties.publicPort.description": "Public port for Dapr Health and Metadata to listen on.",
"vscode-dapr.tasks.daprd.properties.resourcesPath.description": "Path for resources directory. If empty, resources will not be loaded. Self-hosted mode only.",
"vscode-dapr.tasks.daprd.properties.resourcesPath.description": "(Deprecated in v1.11.) Path for resources directory. If empty, resources will not be loaded. Self-hosted mode only.",
"vscode-dapr.tasks.daprd.properties.resourcesPaths.description": "Paths for resources directory. If empty, resources will not be loaded. Self-hosted mode only.",
"vscode-dapr.tasks.daprd.properties.sentryAddress.description": "Address for the Sentry CA service.",
"vscode-dapr.tasks.daprd.properties.unixDomainSocket.description": "Path to a unix domain socket dir. If specified, Dapr API servers will use Unix Domain Sockets.",

Expand Down
10 changes: 10 additions & 0 deletions src/tasks/daprCommandTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { IActionContext } from '@microsoft/vscode-azext-utils';
import { DaprInstallationManager } from '../services/daprInstallationManager';

export interface DaprTaskDefinition extends TaskDefinition {
appChannelAddress?: string;
appHealthCheckPath?: string;
appHealthProbeInterval?: number;
appHealthProbeTimeout?: number;
Expand All @@ -30,10 +31,14 @@ export interface DaprTaskDefinition extends TaskDefinition {
httpMaxRequestSize?: number;
httpPort?: number;
httpReadBufferSize?: number;
internalGrpcPort?: number;
listenAddresses?: string;
logLevel?: 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'panic';
metricsPort?: number;
placementHostAddress?: string;
profilePort?: number;
resourcesPath?: string;
resourcesPaths?: string[];
runFile?: string;
type: 'dapr';
unixDomainSocket?: string;
Expand All @@ -53,6 +58,7 @@ export default class DaprCommandTaskProvider extends CommandTaskProvider {
const command =
CommandLineBuilder
.create(daprPathProvider(), 'run')
.withNamedArg('--app-channel-address', daprDefinition.appChannelAddress)
.withNamedArg('--app-health-check-path', daprDefinition.appHealthCheckPath)
.withNamedArg('--app-health-probe-interval', daprDefinition.appHealthProbeInterval)
.withNamedArg('--app-health-probe-timeout', daprDefinition.appHealthProbeTimeout)
Expand All @@ -68,13 +74,17 @@ export default class DaprCommandTaskProvider extends CommandTaskProvider {
.withNamedArg('--dapr-http-max-request-size', daprDefinition.httpMaxRequestSize)
.withNamedArg('--dapr-http-port', daprDefinition.httpPort)
.withNamedArg('--dapr-http-read-buffer-size', daprDefinition.httpReadBufferSize)
.withNamedArg('--dapr-internal-grpc-port', daprDefinition.internalGrpcPort)
.withNamedArg('--dapr-listen-addresses', daprDefinition.listenAddresses)
.withNamedArg('--enable-api-logging', daprDefinition.enableApiLogging, { assignValue: true })
.withNamedArg('--enable-app-health-check', daprDefinition.enableHealthCheck, { assignValue: true })
.withNamedArg('--enable-profiling', daprDefinition.enableProfiling, { assignValue: true })
.withNamedArg('--log-level', daprDefinition.logLevel)
.withNamedArg('--metrics-port', daprDefinition.metricsPort)
.withNamedArg('--placement-host-address', daprDefinition.placementHostAddress)
.withNamedArg('--profile-port', daprDefinition.profilePort)
.withNamedArg('--resources-path', daprDefinition.resourcesPath)
.withArrayArgs('--resources-path', daprDefinition.resourcesPaths)
.withNamedArg('--run-file', daprDefinition.runFile)
.withNamedArg('--unix-domain-socket', daprDefinition.unixDomainSocket)
.withArgs(daprDefinition.args)
Expand Down
4 changes: 4 additions & 0 deletions src/tasks/daprdCommandTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type DaprdLogLevel = 'debug' | 'info' | 'warn' | 'error' | 'fatal' | 'panic';

export interface DaprdTaskDefinition extends TaskDefinition {
allowedOrigins?: string;
appChannelAddress?: string;
appHealthCheckPath?: string;
appHealthProbeInterval?: number;
appHealthProbeTimeout?: number;
Expand Down Expand Up @@ -49,6 +50,7 @@ export interface DaprdTaskDefinition extends TaskDefinition {
profilePort?: number;
publicPort?: number;
resourcesPath?: string;
resourcesPaths?: string[];
sentryAddress?: string;
type: 'daprd';
unixDomainSocket?: string;
Expand All @@ -73,6 +75,7 @@ export default class DaprdCommandTaskProvider extends CommandTaskProvider {
CommandLineBuilder
.create(daprdPathProvider())
.withNamedArg('--allowed-origins', daprDefinition.allowedOrigins)
.withNamedArg('--app-channel-address', daprDefinition.appChannelAddress)
.withNamedArg('--app-health-check-path', daprDefinition.appHealthCheckPath)
.withNamedArg('--app-health-probe-interval', daprDefinition.appHealthProbeInterval)
.withNamedArg('--app-health-probe-timeout', daprDefinition.appHealthProbeTimeout)
Expand Down Expand Up @@ -106,6 +109,7 @@ export default class DaprdCommandTaskProvider extends CommandTaskProvider {
.withNamedArg('--placement-host-address', daprDefinition.placementHostAddress ?? `${process.env.DAPR_PLACEMENT_HOST_ADDRESS ?? 'localhost'}:${environmentProvider.isWindows ? 6050 : 50005}` /* NOTE: The placement address is actually required for daprd. */)
.withNamedArg('--profile-port', daprDefinition.profilePort)
.withNamedArg('--resources-path', daprDefinition.resourcesPath)
.withArrayArgs('--resources-path', daprDefinition.resourcesPaths)
.withNamedArg('--sentry-address', daprDefinition.sentryAddress)
.withNamedArg('--unix-domain-socket', daprDefinition.unixDomainSocket)
.withArgs(daprDefinition.args)
Expand Down