diff --git a/.vscodeignore b/.vscodeignore index 5ff3c19..9ca64b5 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -7,3 +7,5 @@ src/** .gitignore tsconfig.json vsc-extension-quickstart.md +out/tools/** +tools/** diff --git a/package.json b/package.json index 76e0ccc..61063b9 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,29 @@ "when": "view == azure.batch.explorer && viewItem == azure.batch.resource" } ] - } + }, + "jsonValidation": [ + { + "fileMatch": "*.job.json", + "url": "./schema/job.schema.json" + }, + { + "fileMatch": "*.pool.json", + "url": "./schema/pool.schema.json" + }, + { + "fileMatch": "*.jobtemplate.json", + "url": "./schema/jobtemplate.schema.json" + }, + { + "fileMatch": "*.pooltemplate.json", + "url": "./schema/pooltemplate.schema.json" + }, + { + "fileMatch": "*.applicationtemplate.json", + "url": "./schema/applicationtemplate.schema.json" + } + ] }, "scripts": { "vscode:prepublish": "tsc -p ./", diff --git a/schema/applicationtemplate.schema.json b/schema/applicationtemplate.schema.json new file mode 100644 index 0000000..93c42fe --- /dev/null +++ b/schema/applicationtemplate.schema.json @@ -0,0 +1,2065 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "applicationtemplate", + "description": "An Azure Batch application template", + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplate", + "definitions": { + "BatchApplicationTemplate": { + "properties": { + "templateMetadata": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateMetadata", + "title": "Additional information about the template itself.", + "description": "Additional information about the template itself." + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateParameter" + }, + "title": "The parameters whose values may be supplied each time the template is used.", + "description": "The parameters whose values may be supplied each time the template is used." + }, + "jobManagerTask": { + "$ref": "#/definitions/JobManagerTask", + "title": "Details of a Job Manager task to be launched when the job is started.", + "description": "Details of a Job Manager task to be launched when the job is started." + }, + "jobPreparationTask": { + "$ref": "#/definitions/JobPreparationTask", + "title": "The Job Preparation task.", + "description": "The Job Preparation task." + }, + "jobReleaseTask": { + "$ref": "#/definitions/JobReleaseTask", + "title": "The Job Release task.", + "description": "The Job Release task." + }, + "commonEnvironmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).", + "description": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks)." + }, + "onAllTasksComplete": { + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "The action the Batch service should take when all tasks in the job are in the completed state.", + "$ref": "#/definitions/OnAllTasksComplete" + }, + "onTaskFailure": { + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "$ref": "#/definitions/OnTaskFailure" + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the job as metadata.", + "description": "A list of name-value pairs associated with the job as metadata." + }, + "usesTaskDependencies": { + "title": "The flag that determines if this job will use tasks with dependencies.", + "description": "The flag that determines if this job will use tasks with dependencies.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskFactory": { + "type": "object", + "title": "A specification for the tasks to be added to the job.", + "$ref": "#/definitions/TaskFactory", + "description": "A specification for the tasks to be added to the job." + } + } + }, + "BatchApplicationTemplateMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A simple description of the functionality provided by the template.", + "description": "A simple description of the functionality provided by the template." + }, + "author": { + "type": "string", + "title": "The name or email address of the template author.", + "description": "The name or email address of the template author." + }, + "dateUpdated": { + "type": "string", + "title": "A human readable message (a date or a version number) for when the template was last modified.", + "description": "A human readable message (a date or a version number) for when the template was last modified." + } + } + }, + "BatchApplicationTemplateParameter": { + "properties": { + "type": { + "type": "string", + "enum": [ + "int", + "string", + "bool" + ], + "title": "The data type of the parameter.", + "description": "The data type of the parameter." + }, + "defaultValue": { + "title": "The default value of the parameter.", + "description": "The default value of the parameter." + }, + "metadata": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateParameterMetadata", + "title": "Additional data about the parameter.", + "description": "Additional data about the parameter." + } + }, + "required": [ + "type" + ] + }, + "BatchApplicationTemplateParameterMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A description of the parameter, suitable for display in a user interface.", + "description": "A description of the parameter, suitable for display in a user interface." + } + }, + "title": "Additional data about an Azure Batch template parameter." + }, + "JobAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the job within the account.", + "description": "A string that uniquely identifies the job within the account." + }, + "displayName": { + "type": "string", + "title": "The display name for the job.", + "description": "The display name for the job." + }, + "priority": { + "format": "int32", + "title": "The priority of the job.", + "description": "The priority of the job.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "constraints": { + "$ref": "#/definitions/JobConstraints" + }, + "jobManagerTask": { + "$ref": "#/definitions/JobManagerTask", + "title": "Details of a Job Manager task to be launched when the job is started.", + "description": "Details of a Job Manager task to be launched when the job is started." + }, + "jobPreparationTask": { + "$ref": "#/definitions/JobPreparationTask", + "title": "The Job Preparation task.", + "description": "The Job Preparation task." + }, + "jobReleaseTask": { + "$ref": "#/definitions/JobReleaseTask", + "title": "The Job Release task.", + "description": "The Job Release task." + }, + "commonEnvironmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).", + "description": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks)." + }, + "poolInfo": { + "$ref": "#/definitions/PoolInformation", + "title": "The pool on which the Batch service runs the job's tasks.", + "description": "The pool on which the Batch service runs the job's tasks." + }, + "onAllTasksComplete": { + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "The action the Batch service should take when all tasks in the job are in the completed state.", + "$ref": "#/definitions/OnAllTasksComplete" + }, + "onTaskFailure": { + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "$ref": "#/definitions/OnTaskFailure" + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the job as metadata.", + "description": "A list of name-value pairs associated with the job as metadata." + }, + "usesTaskDependencies": { + "title": "The flag that determines if this job will use tasks with dependencies.", + "description": "The flag that determines if this job will use tasks with dependencies.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskFactory": { + "type": "object", + "title": "A specification for the tasks to be added to the job.", + "$ref": "#/definitions/TaskFactory", + "description": "A specification for the tasks to be added to the job." + }, + "applicationTemplateInfo": { + "type": "object", + "title": "An application template from which to create the job.", + "$ref": "#/definitions/ApplicationTemplateInfo", + "description": "An application template from which to create the job." + } + }, + "required": [ + "id", + "poolInfo" + ], + "title": "An Azure Batch job to add." + }, + "JobConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the job may run, measured from the time the job is created.", + "description": "The maximum elapsed time that the job may run, measured from the time the job is created." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "The execution constraints for a job." + }, + "JobManagerTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Manager taskwithin the job.", + "description": "A string that uniquely identifies the Job Manager taskwithin the job." + }, + "displayName": { + "type": "string", + "title": "The display name of the Job Manager task.", + "description": "The display name of the Job Manager task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Manager task.", + "description": "The command line of the Job Manager task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Manager task.", + "description": "A list of environment variable settings for the Job Manager task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Manager task.", + "description": "Constraints that apply to the Job Manager task." + }, + "killJobOnCompletion": { + "title": "Whether completion of the Job Manager task signifies completion of the entire job.", + "description": "Whether completion of the Job Manager task signifies completion of the entire job.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Manager task runs.", + "description": "The user identity under which the Job Manager task runs." + }, + "runExclusive": { + "title": "Whether the Job Manager task requires exclusive use of the compute node where it runs.", + "description": "Whether the Job Manager task requires exclusive use of the compute node where it runs.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "allowLowPriorityNode": { + "title": "Whether the Job Manager task may run on a low-priority compute node.", + "description": "Whether the Job Manager task may run on a low-priority compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "Specifies details of a Job Manager task." + }, + "ResourceFile": { + "properties": { + "blobSource": { + "type": "string", + "title": "The URL of the file within Azure Blob Storage.", + "description": "The URL of the file within Azure Blob Storage." + }, + "filePath": { + "type": "string", + "title": "The location on the compute node to which to download the file, relative to the task's working directory.", + "description": "The location on the compute node to which to download the file, relative to the task's working directory." + }, + "fileMode": { + "type": "string", + "title": "The file permission mode attribute in octal format.", + "description": "The file permission mode attribute in octal format." + }, + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line.", + "description": "A source for files to be downloaded before running the task command line." + } + }, + "required": [], + "title": "A file to be downloaded from Azure blob storage to a compute node.", + "oneOf": [ + { + "required": [ + "source" + ] + }, + { + "required": [ + "blobSource" + ] + } + ] + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files.", + "description": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download.", + "description": "A prefix with which to filter the files to download." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFile": { + "properties": { + "filePattern": { + "type": "string", + "title": "A pattern indicating which file(s) to upload.", + "description": "A pattern indicating which file(s) to upload." + }, + "destination": { + "title": "The destination for the output file(s).", + "$ref": "#/definitions/OutputFileDestination", + "description": "The destination for the output file(s)." + }, + "uploadOptions": { + "title": "Additional options for the upload operation, including under what conditions to perform the upload.", + "$ref": "#/definitions/OutputFileUploadOptions", + "description": "Additional options for the upload operation, including under what conditions to perform the upload." + } + }, + "required": [ + "filePattern", + "destination", + "uploadOptions" + ], + "title": "A specification for uploading files from an Azure Batch node to another location after the Batch service has finished executing the task process." + }, + "OutputFileDestination": { + "properties": { + "container": { + "title": "A location in Azure blob storage to which files are uploaded.", + "$ref": "#/definitions/OutputFileBlobContainerDestination", + "description": "A location in Azure blob storage to which files are uploaded." + }, + "autoStorage": { + "type": "object", + "$ref": "#/definitions/OutputFileAutoStorageDestination", + "title": "A destination in the linked storage account to which to persist output files.", + "description": "A destination in the linked storage account to which to persist output files." + } + }, + "title": "The destination to which a file should be uploaded." + }, + "OutputFileBlobContainerDestination": { + "properties": { + "path": { + "type": "string", + "title": "The destination blob or virtual directory within the Azure Storage container.", + "description": "The destination blob or virtual directory within the Azure Storage container." + }, + "containerUrl": { + "type": "string", + "title": "The URL of the container within Azure Blob Storage to which to upload the file(s).", + "description": "The URL of the container within Azure Blob Storage to which to upload the file(s)." + } + }, + "required": [ + "containerUrl" + ], + "title": "Specifies a file upload destination within an Azure blob storage container." + }, + "OutputFileAutoStorageDestination": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account to which to save files.", + "description": "The file group in the linked storage account to which to save files." + }, + "path": { + "type": "string", + "title": "The path within the file group to which output files will be uploaded.", + "description": "The path within the file group to which output files will be uploaded." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFileUploadOptions": { + "properties": { + "uploadCondition": { + "title": "The conditions under which the task output file or set of files should be uploaded.", + "description": "The conditions under which the task output file or set of files should be uploaded.", + "$ref": "#/definitions/OutputFileUploadCondition" + } + }, + "required": [ + "uploadCondition" + ], + "title": "Details about an output file upload operation, including under what conditions to perform the upload." + }, + "OutputFileUploadCondition": { + "type": "string", + "title": "The conditions under which a task output file or set of files should be uploaded.", + "description": "taskSuccess: Upload the file(s) only after the task process exits with an exit code of 0. taskFailure: Upload the file(s) only after the task process exits with a nonzero exit code. taskCompletion: Upload the file(s) after the task process exits, no matter what the exit code was.", + "enum": [ + "taskSuccess", + "taskFailure", + "taskCompletion" + ], + "x-ms-enum": { + "name": "OutputFileUploadCondition", + "modelAsString": false + } + }, + "EnvironmentSetting": { + "properties": { + "name": { + "type": "string", + "title": "The name of the environment variable.", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "title": "The value of the environment variable.", + "description": "The value of the environment variable." + } + }, + "required": [ + "name" + ], + "title": "An environment variable to be set on a task process." + }, + "TaskConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it.", + "description": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "Execution constraints to apply to a task." + }, + "UserIdentity": { + "properties": { + "username": { + "type": "string", + "x-ms-client-name": "userName", + "title": "The name of the user identity under which the task is run.", + "description": "The name of the user identity under which the task is run." + }, + "autoUser": { + "$ref": "#/definitions/AutoUserSpecification", + "title": "The auto user under which the task is run.", + "description": "The auto user under which the task is run." + } + }, + "title": "The definition of the user identity under which the task is run.", + "description": "Specify either the userName or autoUser property, but not both." + }, + "AutoUserSpecification": { + "properties": { + "scope": { + "type": "string", + "title": "The scope for the auto user", + "description": "The scope for the auto user", + "enum": [ + "task", + "pool" + ], + "x-ms-enum": { + "name": "AutoUserScope", + "modelAsString": false + } + }, + "elevationLevel": { + "title": "The elevation level of the auto user.", + "description": "The elevation level of the auto user.", + "$ref": "#/definitions/ElevationLevel" + } + }, + "title": "Specifies the parameters for the auto user that runs a task on the Batch service." + }, + "ElevationLevel": { + "type": "string", + "title": "The elevation level of the user.", + "description": "nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.", + "enum": [ + "nonAdmin", + "admin" + ], + "x-ms-enum": { + "name": "ElevationLevel", + "modelAsString": false + } + }, + "ApplicationPackageReference": { + "properties": { + "applicationId": { + "type": "string", + "title": "The ID of the application to deploy.", + "description": "The ID of the application to deploy." + }, + "version": { + "type": "string", + "title": "The version of the application to deploy. If omitted, the default version is deployed.", + "description": "The version of the application to deploy. If omitted, the default version is deployed." + } + }, + "required": [ + "applicationId" + ], + "title": "A reference to an application package to be deployed to compute nodes." + }, + "AuthenticationTokenSettings": { + "properties": { + "access": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "job" + ], + "x-ms-enum": { + "name": "AccessScope", + "modelAsString": false + } + }, + "title": "The Batch resources to which the token grants access.", + "description": "The Batch resources to which the token grants access." + } + }, + "title": "The settings for an authentication token that the task can use to perform Batch service operations." + }, + "JobPreparationTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Preparation task within the job.", + "description": "A string that uniquely identifies the Job Preparation task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Preparation task.", + "description": "The command line of the Job Preparation task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Preparation task.", + "description": "A list of environment variable settings for the Job Preparation task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Preparation task.", + "description": "Constraints that apply to the Job Preparation task." + }, + "waitForSuccess": { + "title": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.", + "description": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Preparation task runs.", + "description": "The user identity under which the Job Preparation task runs." + }, + "rerunOnNodeRebootAfterSuccess": { + "title": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots.", + "description": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Preparation task to run before any tasks of the job on any given compute node." + }, + "JobReleaseTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Release task within the job.", + "description": "A string that uniquely identifies the Job Release task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Release task.", + "description": "The command line of the Job Release task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Release task.", + "description": "A list of environment variable settings for the Job Release task." + }, + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).", + "description": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request)." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Release task runs.", + "description": "The user identity under which the Job Release task runs." + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Release task to run on job completion on any compute node where the job has run." + }, + "PoolInformation": { + "properties": { + "poolId": { + "type": "string", + "title": "The ID of an existing pool. All the tasks of the job will run on the specified pool.", + "description": "The ID of an existing pool. All the tasks of the job will run on the specified pool." + }, + "autoPoolSpecification": { + "$ref": "#/definitions/AutoPoolSpecification", + "title": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted.", + "description": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + } + }, + "title": "Specifies how a job should be assigned to a pool.", + "oneOf": [ + { + "required": [ + "poolId" + ] + }, + { + "required": [ + "autoPoolSpecification" + ] + } + ] + }, + "AutoPoolSpecification": { + "properties": { + "autoPoolIdPrefix": { + "type": "string", + "title": "A prefix to be added to the unique identifier when a pool is automatically created.", + "description": "A prefix to be added to the unique identifier when a pool is automatically created." + }, + "poolLifetimeOption": { + "type": "string", + "title": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "description": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "enum": [ + "jobSchedule", + "job" + ], + "x-ms-enum": { + "name": "PoolLifetimeOption", + "modelAsString": false + } + }, + "keepAlive": { + "title": "Whether to keep an auto pool alive after its lifetime expires.", + "description": "Whether to keep an auto pool alive after its lifetime expires.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "pool": { + "$ref": "#/definitions/PoolSpecification", + "title": "The pool specification for the auto pool.", + "description": "The pool specification for the auto pool." + } + }, + "required": [ + "poolLifetimeOption" + ], + "title": "Specifies characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + }, + "PoolSpecification": { + "properties": { + "displayName": { + "type": "string", + "title": "The display name for the pool.", + "description": "The display name for the pool." + }, + "vmSize": { + "type": "string", + "title": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size.", + "description": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size." + }, + "cloudServiceConfiguration": { + "$ref": "#/definitions/CloudServiceConfiguration", + "title": "The cloud service configuration for the pool.", + "description": "The cloud service configuration for the pool." + }, + "virtualMachineConfiguration": { + "$ref": "#/definitions/VirtualMachineConfiguration", + "title": "The virtual machine configuration for the pool.", + "description": "The virtual machine configuration for the pool." + }, + "maxTasksPerNode": { + "format": "int32", + "title": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "description": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskSchedulingPolicy": { + "$ref": "#/definitions/TaskSchedulingPolicy" + }, + "resizeTimeout": { + "type": "string", + "format": "duration", + "title": "The timeout for allocation of compute nodes to the pool.", + "description": "The timeout for allocation of compute nodes to the pool." + }, + "targetDedicatedNodes": { + "format": "int32", + "title": "The desired number of dedicated compute nodes in the pool.", + "description": "The desired number of dedicated compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "targetLowPriorityNodes": { + "format": "int32", + "title": "The desired number of low-priority compute nodes in the pool.", + "description": "The desired number of low-priority compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "enableAutoScale": { + "title": "Whether the pool size should automatically adjust over time.", + "description": "Whether the pool size should automatically adjust over time.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "autoScaleFormula": { + "type": "string", + "title": "The formula for the desired number of compute nodes in the pool.", + "description": "The formula for the desired number of compute nodes in the pool." + }, + "autoScaleEvaluationInterval": { + "type": "string", + "format": "duration", + "title": "The time interval at which to automatically adjust the pool size according to the autoscale formula.", + "description": "The time interval at which to automatically adjust the pool size according to the autoscale formula." + }, + "enableInterNodeCommunication": { + "title": "Whether the pool permits direct communication between nodes.", + "description": "Whether the pool permits direct communication between nodes.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "networkConfiguration": { + "$ref": "#/definitions/NetworkConfiguration", + "title": "The network configuration for the pool.", + "description": "The network configuration for the pool." + }, + "startTask": { + "$ref": "#/definitions/StartTask", + "title": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted.", + "description": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted." + }, + "certificateReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/CertificateReference" + }, + "title": "A list of certificates to be installed on each compute node in the pool.", + "description": "A list of certificates to be installed on each compute node in the pool." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "The list of application packages to be installed on each compute node in the pool.", + "description": "The list of application packages to be installed on each compute node in the pool." + }, + "applicationLicenses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of application licenses the Batch service will make available on each compute node in the pool.", + "description": "The list of application licenses the Batch service will make available on each compute node in the pool." + }, + "userAccounts": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccount" + }, + "title": "The list of user accounts to be created on each node in the pool.", + "description": "The list of user accounts to be created on each node in the pool." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the pool as metadata.", + "description": "A list of name-value pairs associated with the pool as metadata." + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool.", + "description": "A collection of packages to be added from external package managers to each node in the pool." + } + }, + "required": [ + "vmSize" + ], + "title": "Specification for creating a new pool.", + "oneOf": [ + { + "required": [ + "cloudServiceConfiguration" + ] + }, + { + "required": [ + "virtualMachineConfiguration" + ] + } + ], + "dependencies": { + "autoScaleFormula": [ + "enableAutoScale" + ], + "autoScaleEvaluationInterval": [ + "enableAutoScale" + ] + } + }, + "CloudServiceConfiguration": { + "properties": { + "osFamily": { + "type": "string", + "title": "The Azure Guest OS family to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS family to be installed on the virtual machines in the pool." + }, + "targetOSVersion": { + "type": "string", + "title": "The Azure Guest OS version to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS version to be installed on the virtual machines in the pool." + }, + "currentOSVersion": { + "type": "string", + "title": "The Azure Guest OS Version currently installed on the virtual machines in the pool.", + "description": "The Azure Guest OS Version currently installed on the virtual machines in the pool." + } + }, + "required": [ + "osFamily" + ], + "title": "The configuration for nodes in a pool based on the Azure Cloud Services platform." + }, + "VirtualMachineConfiguration": { + "properties": { + "imageReference": { + "$ref": "#/definitions/ImageReference", + "title": "A reference to the Azure Virtual Machines Marketplace image to use.", + "description": "A reference to the Azure Virtual Machines Marketplace image to use." + }, + "osDisk": { + "$ref": "#/definitions/OSDisk", + "title": "A reference to the OS disk image to use.", + "description": "A reference to the OS disk image to use." + }, + "nodeAgentSKUId": { + "type": "string", + "title": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool.", + "description": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool." + }, + "windowsConfiguration": { + "$ref": "#/definitions/WindowsConfiguration", + "title": "Windows operating system settings on the virtual machine.", + "description": "Windows operating system settings on the virtual machine." + } + }, + "required": [ + "nodeAgentSKUId" + ], + "title": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "oneOf": [ + { + "required": [ + "imageReference" + ] + }, + { + "required": [ + "osDisk" + ] + } + ] + }, + "ImageReference": { + "properties": { + "publisher": { + "type": "string", + "title": "The publisher of the Azure Virtual Machines Marketplace image.", + "description": "The publisher of the Azure Virtual Machines Marketplace image." + }, + "offer": { + "type": "string", + "title": "The offer type of the Azure Virtual Machines Marketplace image.", + "description": "The offer type of the Azure Virtual Machines Marketplace image." + }, + "sku": { + "type": "string", + "title": "The SKU of the Azure Virtual Machines Marketplace image.", + "description": "The SKU of the Azure Virtual Machines Marketplace image." + }, + "version": { + "type": "string", + "title": "The version of the Azure Virtual Machines Marketplace image.", + "description": "The version of the Azure Virtual Machines Marketplace image." + } + }, + "required": [ + "publisher", + "offer", + "sku" + ], + "title": "A reference to an Azure Virtual Machines Marketplace image. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation." + }, + "OSDisk": { + "properties": { + "imageUris": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The collection of Virtual Hard Disk (VHD) URIs.", + "description": "The collection of Virtual Hard Disk (VHD) URIs." + }, + "caching": { + "type": "string", + "title": "The type of caching to enable for the OS disk.", + "description": "The type of caching to enable for the OS disk.", + "enum": [ + "none", + "readOnly", + "readWrite" + ], + "x-ms-enum": { + "name": "CachingType", + "modelAsString": false + } + } + }, + "required": [ + "imageUris" + ], + "title": "A reference to an OS disk image." + }, + "WindowsConfiguration": { + "properties": { + "enableAutomaticUpdates": { + "title": "Whether automatic updates are enabled on the virtual machine.", + "description": "Whether automatic updates are enabled on the virtual machine.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "Windows operating system settings to apply to the virtual machine." + }, + "TaskSchedulingPolicy": { + "properties": { + "nodeFillType": { + "type": "string", + "title": "How tasks should be distributed across compute nodes.", + "enum": [ + "spread", + "pack" + ], + "x-ms-enum": { + "name": "ComputeNodeFillType", + "modelAsString": false + }, + "description": "How tasks should be distributed across compute nodes." + } + }, + "required": [ + "nodeFillType" + ], + "title": "Specifies how tasks should be distributed across compute nodes." + }, + "NetworkConfiguration": { + "properties": { + "subnetId": { + "type": "string", + "title": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "description": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "externalDocs": { + "url": "https://azure.microsoft.com/en-us/documentation/articles/role-based-access-built-in-roles/#classic-virtual-machine-contributor", + "description": "Setting up RBAC for Azure Batch VNETs" + } + } + }, + "description": "The network configuration for a pool." + }, + "StartTask": { + "properties": { + "commandLine": { + "type": "string", + "title": "The command line of the start task.", + "description": "The command line of the start task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the start task.", + "description": "A list of environment variable settings for the start task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the start task runs.", + "description": "The user identity under which the start task runs." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times the task may be retried.", + "description": "The maximum number of times the task may be retried.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "waitForSuccess": { + "title": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "description": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "commandLine" + ], + "title": "A task which is run when a compute node joins a pool in the Azure Batch service, or when the compute node is rebooted or reimaged." + }, + "CertificateReference": { + "properties": { + "thumbprint": { + "type": "string", + "title": "The thumbprint of the certificate.", + "description": "The thumbprint of the certificate." + }, + "thumbprintAlgorithm": { + "type": "string", + "title": "The algorithm with which the thumbprint is associated. This must be sha1.", + "description": "The algorithm with which the thumbprint is associated. This must be sha1." + }, + "storeLocation": { + "type": "string", + "title": "The location of the certificate store on the compute node into which to install the certificate.", + "description": "The location of the certificate store on the compute node into which to install the certificate.", + "enum": [ + "currentUser", + "localMachine" + ], + "x-ms-enum": { + "name": "CertificateStoreLocation", + "modelAsString": false + } + }, + "storeName": { + "type": "string", + "title": "The name of the certificate store on the compute node into which to install the certificate.", + "description": "The name of the certificate store on the compute node into which to install the certificate." + }, + "visibility": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "startTask", + "task", + "remoteUser" + ], + "x-ms-enum": { + "name": "CertificateVisibility", + "modelAsString": false + } + }, + "title": "Which user accounts on the compute node should have access to the private data of the certificate.", + "description": "Which user accounts on the compute node should have access to the private data of the certificate." + } + }, + "required": [ + "thumbprint", + "thumbprintAlgorithm" + ], + "title": "A reference to a certificate to be installed on compute nodes in a pool." + }, + "UserAccount": { + "properties": { + "name": { + "type": "string", + "title": "The name of the user account.", + "description": "The name of the user account." + }, + "password": { + "type": "string", + "title": "The password for the user account.", + "description": "The password for the user account." + }, + "elevationLevel": { + "title": "The elevation level of the user account.", + "description": "The elevation level of the user account.", + "$ref": "#/definitions/ElevationLevel" + }, + "linuxUserConfiguration": { + "title": "The Linux-specific user configuration for the user account.", + "description": "The Linux-specific user configuration for the user account.", + "$ref": "#/definitions/LinuxUserConfiguration" + } + }, + "required": [ + "name", + "password" + ], + "title": "Properties used to create a user used to execute tasks on an Azure Batch node." + }, + "LinuxUserConfiguration": { + "properties": { + "uid": { + "format": "int32", + "title": "The user ID of the user account.", + "description": "The user ID of the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "gid": { + "format": "int32", + "title": "The group ID for the user account.", + "description": "The group ID for the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "sshPrivateKey": { + "type": "string", + "title": "The SSH private key for the user account.", + "description": "The SSH private key for the user account." + } + }, + "title": "Properties used to create a user account on a Linux node." + }, + "MetadataItem": { + "properties": { + "name": { + "type": "string", + "title": "The name of the metadata item.", + "description": "The name of the metadata item." + }, + "value": { + "type": "string", + "title": "The value of the metadata item.", + "description": "The value of the metadata item." + } + }, + "required": [ + "name", + "value" + ], + "title": "A name-value pair associated with a Batch service resource.", + "description": "The Batch service does not assign any meaning to this metadata; it is solely for the use of user code." + }, + "PackageReference": { + "properties": { + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage", + "description": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository.", + "description": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed.", + "description": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "title": "Whether Chocolatey will install packages without a checksum for validation.", + "description": "Whether Chocolatey will install packages without a checksum for validation.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages).", + "description": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": [ + "type", + "id" + ] + }, + "OnAllTasksComplete": { + "type": "string", + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'.", + "enum": [ + "noAction", + "terminateJob" + ], + "x-ms-enum": { + "name": "OnAllTasksComplete", + "modelAsString": false + } + }, + "OnTaskFailure": { + "type": "string", + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. This may still result in no action being taken, if that is what the task specifies.", + "enum": [ + "noAction", + "performExitOptionsJobAction" + ], + "x-ms-enum": { + "name": "OnTaskFailure", + "modelAsString": false + } + }, + "TaskFactory": { + "properties": { + "type": { + "type": "string", + "title": "The type of task factory - taskCollection, parametricSweep or taskPerFile", + "description": "The type of task factory - taskCollection, parametricSweep or taskPerFile" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskAddParameter" + }, + "title": "The tasks that make up the job.", + "description": "The tasks that make up the job." + }, + "parameterSets": { + "type": "array", + "items": { + "$ref": "#/definitions/ParametricSweepParameterSet" + }, + "title": "The parameter or parameters whose values will be varied over the parametric sweep.", + "description": "The parameter or parameters whose values will be varied over the parametric sweep." + }, + "repeatTask": { + "type": "object", + "$ref": "#/definitions/RepeatTask", + "title": "The task that is to be repeated for each value.", + "description": "The task that is to be repeated for each value." + }, + "source": { + "type": "object", + "$ref": "#/definitions/TaskPerFileSource", + "title": "The source of the files for which to create tasks.", + "description": "The source of the files for which to create tasks." + } + } + }, + "TaskAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the task within the job.", + "description": "A string that uniquely identifies the task within the job." + }, + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "dependsOn": { + "$ref": "#/definitions/TaskDependencies", + "title": "The tasks that this task depends on.", + "description": "The tasks that this task depends on." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "An Azure Batch task to add." + }, + "ExitConditions": { + "properties": { + "exitCodes": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeMapping" + }, + "title": "A list of individual task exit codes and how the Batch service should respond to them.", + "description": "A list of individual task exit codes and how the Batch service should respond to them." + }, + "exitCodeRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeRangeMapping" + }, + "title": "A list of task exit code ranges and how the Batch service should respond to them.", + "description": "A list of task exit code ranges and how the Batch service should respond to them." + }, + "preProcessingError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails to start due to an error.", + "description": "How the Batch service should respond if the task fails to start due to an error." + }, + "fileUploadError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if a file upload error occurs.", + "description": "How the Batch service should respond if a file upload error occurs." + }, + "default": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties.", + "description": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties." + } + }, + "title": "Specifies how the Batch service should respond when the task completes." + }, + "ExitCodeMapping": { + "properties": { + "code": { + "format": "int32", + "title": "A process exit code.", + "description": "A process exit code.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with this exit code.", + "description": "How the Batch service should respond if the task exits with this exit code." + } + }, + "title": "How the Batch service should respond if a task exits with a particular exit code.", + "required": [ + "code", + "exitOptions" + ] + }, + "ExitOptions": { + "properties": { + "jobAction": { + "type": "string", + "title": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "description": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "enum": [ + "none", + "disable", + "terminate" + ], + "x-ms-enum": { + "name": "JobAction", + "modelAsString": false + } + }, + "dependencyAction": { + "type": "string", + "title": "An action that the Batch service performs on tasks that depend on this task.", + "description": "An action that the Batch service performs on tasks that depend on this task.", + "enum": [ + "satisfy", + "block" + ], + "x-ms-enum": { + "name": "DependencyAction", + "modelAsString": false + } + } + }, + "title": "Specifies how the Batch service responds to a particular exit condition." + }, + "ExitCodeRangeMapping": { + "properties": { + "start": { + "format": "int32", + "title": "The first exit code in the range.", + "description": "The first exit code in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "format": "int32", + "title": "The last exit code in the range.", + "description": "The last exit code in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive).", + "description": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive)." + } + }, + "title": "A range of exit codes and how the Batch service should respond to exit codes within that range.", + "required": [ + "start", + "end", + "exitOptions" + ] + }, + "AffinityInformation": { + "properties": { + "affinityId": { + "type": "string", + "title": "An opaque string representing the location of a compute node or a task that has run previously.", + "description": "An opaque string representing the location of a compute node or a task that has run previously." + } + }, + "required": [ + "affinityId" + ], + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start a task." + }, + "MultiInstanceSettings": { + "properties": { + "numberOfInstances": { + "format": "int32", + "title": "The number of compute nodes required by the task.", + "description": "The number of compute nodes required by the task.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "coordinationCommandLine": { + "type": "string", + "title": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command.", + "description": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command." + }, + "commonResourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download before running the coordination command line.", + "description": "A list of files that the Batch service will download before running the coordination command line." + } + }, + "required": [ + "numberOfInstances" + ], + "title": "Settings which specify how to run a multi-instance task.", + "description": "Multi-instance tasks are commonly used to support MPI tasks." + }, + "TaskDependencies": { + "properties": { + "taskIds": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled.", + "description": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled." + }, + "taskIdRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskIdRange" + }, + "title": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled.", + "description": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled." + } + }, + "title": "Specifies any dependencies of a task. Any task that is explicitly specified or within a dependency range must complete before the dependant task will be scheduled." + }, + "TaskIdRange": { + "properties": { + "start": { + "format": "int32", + "title": "The first task ID in the range.", + "description": "The first task ID in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "format": "int32", + "title": "The last task ID in the range.", + "description": "The last task ID in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "A range of task IDs that a task can depend on. All tasks with IDs in the range must complete successfully before the dependent task can be scheduled.", + "description": "The start and end of the range are inclusive. For example, if a range has start 9 and end 12, then it represents tasks '9', '10', '11' and '12'.", + "required": [ + "start", + "end" + ] + }, + "ParametricSweepParameterSet": { + "properties": { + "start": { + "title": "The start of the parametric sweep range.", + "description": "The start of the parametric sweep range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "title": "The end of the parametric sweep range.", + "description": "The end of the parametric sweep range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "step": { + "title": "The increment step between values of the parameter.", + "description": "The increment step between values of the parameter.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "start", + "end" + ] + }, + "RepeatTask": { + "properties": { + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "title": "An Azure Batch task to add.", + "required": [ + "commandLine" + ] + }, + "TaskPerFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to take files.", + "description": "The file group in the linked storage account from which to take files." + }, + "containerUrl": { + "type": "string", + "title": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS).", + "description": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS)." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files from which to create tasks.", + "description": "A prefix with which to filter the files from which to create tasks." + } + } + }, + "ApplicationTemplateInfo": { + "properties": { + "filePath": { + "type": "string", + "title": "The path to the application template file.", + "description": "The path to the application template file." + }, + "parameters": { + "type": "object", + "title": "The values to assign to the application template parameters.", + "description": "The values to assign to the application template parameters." + } + } + } + } +} \ No newline at end of file diff --git a/schema/job.schema.json b/schema/job.schema.json new file mode 100644 index 0000000..0d8decd --- /dev/null +++ b/schema/job.schema.json @@ -0,0 +1,1690 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "job", + "description": "An Azure Batch job", + "type": "object", + "$ref": "#/definitions/JobAddParameter", + "definitions": { + "JobAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the job within the account.", + "description": "A string that uniquely identifies the job within the account." + }, + "displayName": { + "type": "string", + "title": "The display name for the job.", + "description": "The display name for the job." + }, + "priority": { + "type": "integer", + "format": "int32", + "title": "The priority of the job.", + "description": "The priority of the job." + }, + "constraints": { + "$ref": "#/definitions/JobConstraints" + }, + "jobManagerTask": { + "$ref": "#/definitions/JobManagerTask", + "title": "Details of a Job Manager task to be launched when the job is started.", + "description": "Details of a Job Manager task to be launched when the job is started." + }, + "jobPreparationTask": { + "$ref": "#/definitions/JobPreparationTask", + "title": "The Job Preparation task.", + "description": "The Job Preparation task." + }, + "jobReleaseTask": { + "$ref": "#/definitions/JobReleaseTask", + "title": "The Job Release task.", + "description": "The Job Release task." + }, + "commonEnvironmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).", + "description": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks)." + }, + "poolInfo": { + "$ref": "#/definitions/PoolInformation", + "title": "The pool on which the Batch service runs the job's tasks.", + "description": "The pool on which the Batch service runs the job's tasks." + }, + "onAllTasksComplete": { + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "The action the Batch service should take when all tasks in the job are in the completed state.", + "$ref": "#/definitions/OnAllTasksComplete" + }, + "onTaskFailure": { + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "$ref": "#/definitions/OnTaskFailure" + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the job as metadata.", + "description": "A list of name-value pairs associated with the job as metadata." + }, + "usesTaskDependencies": { + "type": "boolean", + "title": "The flag that determines if this job will use tasks with dependencies.", + "description": "The flag that determines if this job will use tasks with dependencies." + }, + "taskFactory": { + "type": "object", + "title": "A specification for the tasks to be added to the job.", + "$ref": "#/definitions/TaskFactory", + "description": "A specification for the tasks to be added to the job." + }, + "applicationTemplateInfo": { + "type": "object", + "title": "An application template from which to create the job.", + "$ref": "#/definitions/ApplicationTemplateInfo", + "description": "An application template from which to create the job." + } + }, + "required": [ + "id", + "poolInfo" + ], + "title": "An Azure Batch job to add." + }, + "JobConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the job may run, measured from the time the job is created.", + "description": "The maximum elapsed time that the job may run, measured from the time the job is created." + }, + "maxTaskRetryCount": { + "type": "integer", + "format": "int32", + "title": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero." + } + }, + "title": "The execution constraints for a job." + }, + "JobManagerTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Manager taskwithin the job.", + "description": "A string that uniquely identifies the Job Manager taskwithin the job." + }, + "displayName": { + "type": "string", + "title": "The display name of the Job Manager task.", + "description": "The display name of the Job Manager task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Manager task.", + "description": "The command line of the Job Manager task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Manager task.", + "description": "A list of environment variable settings for the Job Manager task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Manager task.", + "description": "Constraints that apply to the Job Manager task." + }, + "killJobOnCompletion": { + "type": "boolean", + "title": "Whether completion of the Job Manager task signifies completion of the entire job.", + "description": "Whether completion of the Job Manager task signifies completion of the entire job." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Manager task runs.", + "description": "The user identity under which the Job Manager task runs." + }, + "runExclusive": { + "type": "boolean", + "title": "Whether the Job Manager task requires exclusive use of the compute node where it runs.", + "description": "Whether the Job Manager task requires exclusive use of the compute node where it runs." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "allowLowPriorityNode": { + "type": "boolean", + "title": "Whether the Job Manager task may run on a low-priority compute node.", + "description": "Whether the Job Manager task may run on a low-priority compute node." + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "Specifies details of a Job Manager task." + }, + "ResourceFile": { + "properties": { + "blobSource": { + "type": "string", + "title": "The URL of the file within Azure Blob Storage.", + "description": "The URL of the file within Azure Blob Storage." + }, + "filePath": { + "type": "string", + "title": "The location on the compute node to which to download the file, relative to the task's working directory.", + "description": "The location on the compute node to which to download the file, relative to the task's working directory." + }, + "fileMode": { + "type": "string", + "title": "The file permission mode attribute in octal format.", + "description": "The file permission mode attribute in octal format." + }, + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line.", + "description": "A source for files to be downloaded before running the task command line." + } + }, + "required": [], + "title": "A file to be downloaded from Azure blob storage to a compute node.", + "oneOf": [ + { + "required": [ + "source" + ] + }, + { + "required": [ + "blobSource" + ] + } + ] + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files.", + "description": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download.", + "description": "A prefix with which to filter the files to download." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFile": { + "properties": { + "filePattern": { + "type": "string", + "title": "A pattern indicating which file(s) to upload.", + "description": "A pattern indicating which file(s) to upload." + }, + "destination": { + "title": "The destination for the output file(s).", + "$ref": "#/definitions/OutputFileDestination", + "description": "The destination for the output file(s)." + }, + "uploadOptions": { + "title": "Additional options for the upload operation, including under what conditions to perform the upload.", + "$ref": "#/definitions/OutputFileUploadOptions", + "description": "Additional options for the upload operation, including under what conditions to perform the upload." + } + }, + "required": [ + "filePattern", + "destination", + "uploadOptions" + ], + "title": "A specification for uploading files from an Azure Batch node to another location after the Batch service has finished executing the task process." + }, + "OutputFileDestination": { + "properties": { + "container": { + "title": "A location in Azure blob storage to which files are uploaded.", + "$ref": "#/definitions/OutputFileBlobContainerDestination", + "description": "A location in Azure blob storage to which files are uploaded." + }, + "autoStorage": { + "type": "object", + "$ref": "#/definitions/OutputFileAutoStorageDestination", + "title": "A destination in the linked storage account to which to persist output files.", + "description": "A destination in the linked storage account to which to persist output files." + } + }, + "title": "The destination to which a file should be uploaded." + }, + "OutputFileBlobContainerDestination": { + "properties": { + "path": { + "type": "string", + "title": "The destination blob or virtual directory within the Azure Storage container.", + "description": "The destination blob or virtual directory within the Azure Storage container." + }, + "containerUrl": { + "type": "string", + "title": "The URL of the container within Azure Blob Storage to which to upload the file(s).", + "description": "The URL of the container within Azure Blob Storage to which to upload the file(s)." + } + }, + "required": [ + "containerUrl" + ], + "title": "Specifies a file upload destination within an Azure blob storage container." + }, + "OutputFileAutoStorageDestination": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account to which to save files.", + "description": "The file group in the linked storage account to which to save files." + }, + "path": { + "type": "string", + "title": "The path within the file group to which output files will be uploaded.", + "description": "The path within the file group to which output files will be uploaded." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFileUploadOptions": { + "properties": { + "uploadCondition": { + "title": "The conditions under which the task output file or set of files should be uploaded.", + "description": "The conditions under which the task output file or set of files should be uploaded.", + "$ref": "#/definitions/OutputFileUploadCondition" + } + }, + "required": [ + "uploadCondition" + ], + "title": "Details about an output file upload operation, including under what conditions to perform the upload." + }, + "OutputFileUploadCondition": { + "type": "string", + "title": "The conditions under which a task output file or set of files should be uploaded.", + "description": "taskSuccess: Upload the file(s) only after the task process exits with an exit code of 0. taskFailure: Upload the file(s) only after the task process exits with a nonzero exit code. taskCompletion: Upload the file(s) after the task process exits, no matter what the exit code was.", + "enum": [ + "taskSuccess", + "taskFailure", + "taskCompletion" + ], + "x-ms-enum": { + "name": "OutputFileUploadCondition", + "modelAsString": false + } + }, + "EnvironmentSetting": { + "properties": { + "name": { + "type": "string", + "title": "The name of the environment variable.", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "title": "The value of the environment variable.", + "description": "The value of the environment variable." + } + }, + "required": [ + "name" + ], + "title": "An environment variable to be set on a task process." + }, + "TaskConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it.", + "description": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents." + }, + "maxTaskRetryCount": { + "type": "integer", + "format": "int32", + "title": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero." + } + }, + "title": "Execution constraints to apply to a task." + }, + "UserIdentity": { + "properties": { + "username": { + "type": "string", + "x-ms-client-name": "userName", + "title": "The name of the user identity under which the task is run.", + "description": "The name of the user identity under which the task is run." + }, + "autoUser": { + "$ref": "#/definitions/AutoUserSpecification", + "title": "The auto user under which the task is run.", + "description": "The auto user under which the task is run." + } + }, + "title": "The definition of the user identity under which the task is run.", + "description": "Specify either the userName or autoUser property, but not both." + }, + "AutoUserSpecification": { + "properties": { + "scope": { + "type": "string", + "title": "The scope for the auto user", + "description": "The scope for the auto user", + "enum": [ + "task", + "pool" + ], + "x-ms-enum": { + "name": "AutoUserScope", + "modelAsString": false + } + }, + "elevationLevel": { + "title": "The elevation level of the auto user.", + "description": "The elevation level of the auto user.", + "$ref": "#/definitions/ElevationLevel" + } + }, + "title": "Specifies the parameters for the auto user that runs a task on the Batch service." + }, + "ElevationLevel": { + "type": "string", + "title": "The elevation level of the user.", + "description": "nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.", + "enum": [ + "nonAdmin", + "admin" + ], + "x-ms-enum": { + "name": "ElevationLevel", + "modelAsString": false + } + }, + "ApplicationPackageReference": { + "properties": { + "applicationId": { + "type": "string", + "title": "The ID of the application to deploy.", + "description": "The ID of the application to deploy." + }, + "version": { + "type": "string", + "title": "The version of the application to deploy. If omitted, the default version is deployed.", + "description": "The version of the application to deploy. If omitted, the default version is deployed." + } + }, + "required": [ + "applicationId" + ], + "title": "A reference to an application package to be deployed to compute nodes." + }, + "AuthenticationTokenSettings": { + "properties": { + "access": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "job" + ], + "x-ms-enum": { + "name": "AccessScope", + "modelAsString": false + } + }, + "title": "The Batch resources to which the token grants access.", + "description": "The Batch resources to which the token grants access." + } + }, + "title": "The settings for an authentication token that the task can use to perform Batch service operations." + }, + "JobPreparationTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Preparation task within the job.", + "description": "A string that uniquely identifies the Job Preparation task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Preparation task.", + "description": "The command line of the Job Preparation task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Preparation task.", + "description": "A list of environment variable settings for the Job Preparation task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Preparation task.", + "description": "Constraints that apply to the Job Preparation task." + }, + "waitForSuccess": { + "type": "boolean", + "title": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.", + "description": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Preparation task runs.", + "description": "The user identity under which the Job Preparation task runs." + }, + "rerunOnNodeRebootAfterSuccess": { + "type": "boolean", + "title": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots.", + "description": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots." + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Preparation task to run before any tasks of the job on any given compute node." + }, + "JobReleaseTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Release task within the job.", + "description": "A string that uniquely identifies the Job Release task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Release task.", + "description": "The command line of the Job Release task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Release task.", + "description": "A list of environment variable settings for the Job Release task." + }, + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).", + "description": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request)." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Release task runs.", + "description": "The user identity under which the Job Release task runs." + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Release task to run on job completion on any compute node where the job has run." + }, + "PoolInformation": { + "properties": { + "poolId": { + "type": "string", + "title": "The ID of an existing pool. All the tasks of the job will run on the specified pool.", + "description": "The ID of an existing pool. All the tasks of the job will run on the specified pool." + }, + "autoPoolSpecification": { + "$ref": "#/definitions/AutoPoolSpecification", + "title": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted.", + "description": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + } + }, + "title": "Specifies how a job should be assigned to a pool.", + "oneOf": [ + { + "required": [ + "poolId" + ] + }, + { + "required": [ + "autoPoolSpecification" + ] + } + ] + }, + "AutoPoolSpecification": { + "properties": { + "autoPoolIdPrefix": { + "type": "string", + "title": "A prefix to be added to the unique identifier when a pool is automatically created.", + "description": "A prefix to be added to the unique identifier when a pool is automatically created." + }, + "poolLifetimeOption": { + "type": "string", + "title": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "description": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "enum": [ + "jobSchedule", + "job" + ], + "x-ms-enum": { + "name": "PoolLifetimeOption", + "modelAsString": false + } + }, + "keepAlive": { + "type": "boolean", + "title": "Whether to keep an auto pool alive after its lifetime expires.", + "description": "Whether to keep an auto pool alive after its lifetime expires." + }, + "pool": { + "$ref": "#/definitions/PoolSpecification", + "title": "The pool specification for the auto pool.", + "description": "The pool specification for the auto pool." + } + }, + "required": [ + "poolLifetimeOption" + ], + "title": "Specifies characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + }, + "PoolSpecification": { + "properties": { + "displayName": { + "type": "string", + "title": "The display name for the pool.", + "description": "The display name for the pool." + }, + "vmSize": { + "type": "string", + "title": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size.", + "description": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size." + }, + "cloudServiceConfiguration": { + "$ref": "#/definitions/CloudServiceConfiguration", + "title": "The cloud service configuration for the pool.", + "description": "The cloud service configuration for the pool." + }, + "virtualMachineConfiguration": { + "$ref": "#/definitions/VirtualMachineConfiguration", + "title": "The virtual machine configuration for the pool.", + "description": "The virtual machine configuration for the pool." + }, + "maxTasksPerNode": { + "type": "integer", + "format": "int32", + "title": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "description": "The maximum number of tasks that can run concurrently on a single compute node in the pool." + }, + "taskSchedulingPolicy": { + "$ref": "#/definitions/TaskSchedulingPolicy" + }, + "resizeTimeout": { + "type": "string", + "format": "duration", + "title": "The timeout for allocation of compute nodes to the pool.", + "description": "The timeout for allocation of compute nodes to the pool." + }, + "targetDedicatedNodes": { + "type": "integer", + "format": "int32", + "title": "The desired number of dedicated compute nodes in the pool.", + "description": "The desired number of dedicated compute nodes in the pool." + }, + "targetLowPriorityNodes": { + "type": "integer", + "format": "int32", + "title": "The desired number of low-priority compute nodes in the pool.", + "description": "The desired number of low-priority compute nodes in the pool." + }, + "enableAutoScale": { + "type": "boolean", + "title": "Whether the pool size should automatically adjust over time.", + "description": "Whether the pool size should automatically adjust over time." + }, + "autoScaleFormula": { + "type": "string", + "title": "The formula for the desired number of compute nodes in the pool.", + "description": "The formula for the desired number of compute nodes in the pool." + }, + "autoScaleEvaluationInterval": { + "type": "string", + "format": "duration", + "title": "The time interval at which to automatically adjust the pool size according to the autoscale formula.", + "description": "The time interval at which to automatically adjust the pool size according to the autoscale formula." + }, + "enableInterNodeCommunication": { + "type": "boolean", + "title": "Whether the pool permits direct communication between nodes.", + "description": "Whether the pool permits direct communication between nodes." + }, + "networkConfiguration": { + "$ref": "#/definitions/NetworkConfiguration", + "title": "The network configuration for the pool.", + "description": "The network configuration for the pool." + }, + "startTask": { + "$ref": "#/definitions/StartTask", + "title": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted.", + "description": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted." + }, + "certificateReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/CertificateReference" + }, + "title": "A list of certificates to be installed on each compute node in the pool.", + "description": "A list of certificates to be installed on each compute node in the pool." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "The list of application packages to be installed on each compute node in the pool.", + "description": "The list of application packages to be installed on each compute node in the pool." + }, + "applicationLicenses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of application licenses the Batch service will make available on each compute node in the pool.", + "description": "The list of application licenses the Batch service will make available on each compute node in the pool." + }, + "userAccounts": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccount" + }, + "title": "The list of user accounts to be created on each node in the pool.", + "description": "The list of user accounts to be created on each node in the pool." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the pool as metadata.", + "description": "A list of name-value pairs associated with the pool as metadata." + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool.", + "description": "A collection of packages to be added from external package managers to each node in the pool." + } + }, + "required": [ + "vmSize" + ], + "title": "Specification for creating a new pool.", + "oneOf": [ + { + "required": [ + "cloudServiceConfiguration" + ] + }, + { + "required": [ + "virtualMachineConfiguration" + ] + } + ], + "dependencies": { + "autoScaleFormula": [ + "enableAutoScale" + ], + "autoScaleEvaluationInterval": [ + "enableAutoScale" + ] + } + }, + "CloudServiceConfiguration": { + "properties": { + "osFamily": { + "type": "string", + "title": "The Azure Guest OS family to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS family to be installed on the virtual machines in the pool." + }, + "targetOSVersion": { + "type": "string", + "title": "The Azure Guest OS version to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS version to be installed on the virtual machines in the pool." + }, + "currentOSVersion": { + "type": "string", + "title": "The Azure Guest OS Version currently installed on the virtual machines in the pool.", + "description": "The Azure Guest OS Version currently installed on the virtual machines in the pool." + } + }, + "required": [ + "osFamily" + ], + "title": "The configuration for nodes in a pool based on the Azure Cloud Services platform." + }, + "VirtualMachineConfiguration": { + "properties": { + "imageReference": { + "$ref": "#/definitions/ImageReference", + "title": "A reference to the Azure Virtual Machines Marketplace image to use.", + "description": "A reference to the Azure Virtual Machines Marketplace image to use." + }, + "osDisk": { + "$ref": "#/definitions/OSDisk", + "title": "A reference to the OS disk image to use.", + "description": "A reference to the OS disk image to use." + }, + "nodeAgentSKUId": { + "type": "string", + "title": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool.", + "description": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool." + }, + "windowsConfiguration": { + "$ref": "#/definitions/WindowsConfiguration", + "title": "Windows operating system settings on the virtual machine.", + "description": "Windows operating system settings on the virtual machine." + } + }, + "required": [ + "nodeAgentSKUId" + ], + "title": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "oneOf": [ + { + "required": [ + "imageReference" + ] + }, + { + "required": [ + "osDisk" + ] + } + ] + }, + "ImageReference": { + "properties": { + "publisher": { + "type": "string", + "title": "The publisher of the Azure Virtual Machines Marketplace image.", + "description": "The publisher of the Azure Virtual Machines Marketplace image." + }, + "offer": { + "type": "string", + "title": "The offer type of the Azure Virtual Machines Marketplace image.", + "description": "The offer type of the Azure Virtual Machines Marketplace image." + }, + "sku": { + "type": "string", + "title": "The SKU of the Azure Virtual Machines Marketplace image.", + "description": "The SKU of the Azure Virtual Machines Marketplace image." + }, + "version": { + "type": "string", + "title": "The version of the Azure Virtual Machines Marketplace image.", + "description": "The version of the Azure Virtual Machines Marketplace image." + } + }, + "required": [ + "publisher", + "offer", + "sku" + ], + "title": "A reference to an Azure Virtual Machines Marketplace image. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation." + }, + "OSDisk": { + "properties": { + "imageUris": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The collection of Virtual Hard Disk (VHD) URIs.", + "description": "The collection of Virtual Hard Disk (VHD) URIs." + }, + "caching": { + "type": "string", + "title": "The type of caching to enable for the OS disk.", + "description": "The type of caching to enable for the OS disk.", + "enum": [ + "none", + "readOnly", + "readWrite" + ], + "x-ms-enum": { + "name": "CachingType", + "modelAsString": false + } + } + }, + "required": [ + "imageUris" + ], + "title": "A reference to an OS disk image." + }, + "WindowsConfiguration": { + "properties": { + "enableAutomaticUpdates": { + "type": "boolean", + "title": "Whether automatic updates are enabled on the virtual machine.", + "description": "Whether automatic updates are enabled on the virtual machine." + } + }, + "title": "Windows operating system settings to apply to the virtual machine." + }, + "TaskSchedulingPolicy": { + "properties": { + "nodeFillType": { + "type": "string", + "title": "How tasks should be distributed across compute nodes.", + "enum": [ + "spread", + "pack" + ], + "x-ms-enum": { + "name": "ComputeNodeFillType", + "modelAsString": false + }, + "description": "How tasks should be distributed across compute nodes." + } + }, + "required": [ + "nodeFillType" + ], + "title": "Specifies how tasks should be distributed across compute nodes." + }, + "NetworkConfiguration": { + "properties": { + "subnetId": { + "type": "string", + "title": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "description": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "externalDocs": { + "url": "https://azure.microsoft.com/en-us/documentation/articles/role-based-access-built-in-roles/#classic-virtual-machine-contributor", + "description": "Setting up RBAC for Azure Batch VNETs" + } + } + }, + "description": "The network configuration for a pool." + }, + "StartTask": { + "properties": { + "commandLine": { + "type": "string", + "title": "The command line of the start task.", + "description": "The command line of the start task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the start task.", + "description": "A list of environment variable settings for the start task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the start task runs.", + "description": "The user identity under which the start task runs." + }, + "maxTaskRetryCount": { + "type": "integer", + "format": "int32", + "title": "The maximum number of times the task may be retried.", + "description": "The maximum number of times the task may be retried." + }, + "waitForSuccess": { + "type": "boolean", + "title": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "description": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node." + } + }, + "required": [ + "commandLine" + ], + "title": "A task which is run when a compute node joins a pool in the Azure Batch service, or when the compute node is rebooted or reimaged." + }, + "CertificateReference": { + "properties": { + "thumbprint": { + "type": "string", + "title": "The thumbprint of the certificate.", + "description": "The thumbprint of the certificate." + }, + "thumbprintAlgorithm": { + "type": "string", + "title": "The algorithm with which the thumbprint is associated. This must be sha1.", + "description": "The algorithm with which the thumbprint is associated. This must be sha1." + }, + "storeLocation": { + "type": "string", + "title": "The location of the certificate store on the compute node into which to install the certificate.", + "description": "The location of the certificate store on the compute node into which to install the certificate.", + "enum": [ + "currentUser", + "localMachine" + ], + "x-ms-enum": { + "name": "CertificateStoreLocation", + "modelAsString": false + } + }, + "storeName": { + "type": "string", + "title": "The name of the certificate store on the compute node into which to install the certificate.", + "description": "The name of the certificate store on the compute node into which to install the certificate." + }, + "visibility": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "startTask", + "task", + "remoteUser" + ], + "x-ms-enum": { + "name": "CertificateVisibility", + "modelAsString": false + } + }, + "title": "Which user accounts on the compute node should have access to the private data of the certificate.", + "description": "Which user accounts on the compute node should have access to the private data of the certificate." + } + }, + "required": [ + "thumbprint", + "thumbprintAlgorithm" + ], + "title": "A reference to a certificate to be installed on compute nodes in a pool." + }, + "UserAccount": { + "properties": { + "name": { + "type": "string", + "title": "The name of the user account.", + "description": "The name of the user account." + }, + "password": { + "type": "string", + "title": "The password for the user account.", + "description": "The password for the user account." + }, + "elevationLevel": { + "title": "The elevation level of the user account.", + "description": "The elevation level of the user account.", + "$ref": "#/definitions/ElevationLevel" + }, + "linuxUserConfiguration": { + "title": "The Linux-specific user configuration for the user account.", + "description": "The Linux-specific user configuration for the user account.", + "$ref": "#/definitions/LinuxUserConfiguration" + } + }, + "required": [ + "name", + "password" + ], + "title": "Properties used to create a user used to execute tasks on an Azure Batch node." + }, + "LinuxUserConfiguration": { + "properties": { + "uid": { + "type": "integer", + "format": "int32", + "title": "The user ID of the user account.", + "description": "The user ID of the user account." + }, + "gid": { + "type": "integer", + "format": "int32", + "title": "The group ID for the user account.", + "description": "The group ID for the user account." + }, + "sshPrivateKey": { + "type": "string", + "title": "The SSH private key for the user account.", + "description": "The SSH private key for the user account." + } + }, + "title": "Properties used to create a user account on a Linux node." + }, + "MetadataItem": { + "properties": { + "name": { + "type": "string", + "title": "The name of the metadata item.", + "description": "The name of the metadata item." + }, + "value": { + "type": "string", + "title": "The value of the metadata item.", + "description": "The value of the metadata item." + } + }, + "required": [ + "name", + "value" + ], + "title": "A name-value pair associated with a Batch service resource.", + "description": "The Batch service does not assign any meaning to this metadata; it is solely for the use of user code." + }, + "PackageReference": { + "properties": { + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage", + "description": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository.", + "description": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed.", + "description": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "type": "boolean", + "title": "Whether Chocolatey will install packages without a checksum for validation.", + "description": "Whether Chocolatey will install packages without a checksum for validation." + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages).", + "description": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": [ + "type", + "id" + ] + }, + "OnAllTasksComplete": { + "type": "string", + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'.", + "enum": [ + "noAction", + "terminateJob" + ], + "x-ms-enum": { + "name": "OnAllTasksComplete", + "modelAsString": false + } + }, + "OnTaskFailure": { + "type": "string", + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. This may still result in no action being taken, if that is what the task specifies.", + "enum": [ + "noAction", + "performExitOptionsJobAction" + ], + "x-ms-enum": { + "name": "OnTaskFailure", + "modelAsString": false + } + }, + "TaskFactory": { + "properties": { + "type": { + "type": "string", + "title": "The type of task factory - taskCollection, parametricSweep or taskPerFile", + "description": "The type of task factory - taskCollection, parametricSweep or taskPerFile" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskAddParameter" + }, + "title": "The tasks that make up the job.", + "description": "The tasks that make up the job." + }, + "parameterSets": { + "type": "array", + "items": { + "$ref": "#/definitions/ParametricSweepParameterSet" + }, + "title": "The parameter or parameters whose values will be varied over the parametric sweep.", + "description": "The parameter or parameters whose values will be varied over the parametric sweep." + }, + "repeatTask": { + "type": "object", + "$ref": "#/definitions/RepeatTask", + "title": "The task that is to be repeated for each value.", + "description": "The task that is to be repeated for each value." + }, + "source": { + "type": "object", + "$ref": "#/definitions/TaskPerFileSource", + "title": "The source of the files for which to create tasks.", + "description": "The source of the files for which to create tasks." + } + } + }, + "TaskAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the task within the job.", + "description": "A string that uniquely identifies the task within the job." + }, + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "dependsOn": { + "$ref": "#/definitions/TaskDependencies", + "title": "The tasks that this task depends on.", + "description": "The tasks that this task depends on." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "An Azure Batch task to add." + }, + "ExitConditions": { + "properties": { + "exitCodes": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeMapping" + }, + "title": "A list of individual task exit codes and how the Batch service should respond to them.", + "description": "A list of individual task exit codes and how the Batch service should respond to them." + }, + "exitCodeRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeRangeMapping" + }, + "title": "A list of task exit code ranges and how the Batch service should respond to them.", + "description": "A list of task exit code ranges and how the Batch service should respond to them." + }, + "preProcessingError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails to start due to an error.", + "description": "How the Batch service should respond if the task fails to start due to an error." + }, + "fileUploadError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if a file upload error occurs.", + "description": "How the Batch service should respond if a file upload error occurs." + }, + "default": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties.", + "description": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties." + } + }, + "title": "Specifies how the Batch service should respond when the task completes." + }, + "ExitCodeMapping": { + "properties": { + "code": { + "type": "integer", + "format": "int32", + "title": "A process exit code.", + "description": "A process exit code." + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with this exit code.", + "description": "How the Batch service should respond if the task exits with this exit code." + } + }, + "title": "How the Batch service should respond if a task exits with a particular exit code.", + "required": [ + "code", + "exitOptions" + ] + }, + "ExitOptions": { + "properties": { + "jobAction": { + "type": "string", + "title": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "description": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "enum": [ + "none", + "disable", + "terminate" + ], + "x-ms-enum": { + "name": "JobAction", + "modelAsString": false + } + }, + "dependencyAction": { + "type": "string", + "title": "An action that the Batch service performs on tasks that depend on this task.", + "description": "An action that the Batch service performs on tasks that depend on this task.", + "enum": [ + "satisfy", + "block" + ], + "x-ms-enum": { + "name": "DependencyAction", + "modelAsString": false + } + } + }, + "title": "Specifies how the Batch service responds to a particular exit condition." + }, + "ExitCodeRangeMapping": { + "properties": { + "start": { + "type": "integer", + "format": "int32", + "title": "The first exit code in the range.", + "description": "The first exit code in the range." + }, + "end": { + "type": "integer", + "format": "int32", + "title": "The last exit code in the range.", + "description": "The last exit code in the range." + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive).", + "description": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive)." + } + }, + "title": "A range of exit codes and how the Batch service should respond to exit codes within that range.", + "required": [ + "start", + "end", + "exitOptions" + ] + }, + "AffinityInformation": { + "properties": { + "affinityId": { + "type": "string", + "title": "An opaque string representing the location of a compute node or a task that has run previously.", + "description": "An opaque string representing the location of a compute node or a task that has run previously." + } + }, + "required": [ + "affinityId" + ], + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start a task." + }, + "MultiInstanceSettings": { + "properties": { + "numberOfInstances": { + "type": "integer", + "format": "int32", + "title": "The number of compute nodes required by the task.", + "description": "The number of compute nodes required by the task." + }, + "coordinationCommandLine": { + "type": "string", + "title": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command.", + "description": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command." + }, + "commonResourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download before running the coordination command line.", + "description": "A list of files that the Batch service will download before running the coordination command line." + } + }, + "required": [ + "numberOfInstances" + ], + "title": "Settings which specify how to run a multi-instance task.", + "description": "Multi-instance tasks are commonly used to support MPI tasks." + }, + "TaskDependencies": { + "properties": { + "taskIds": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled.", + "description": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled." + }, + "taskIdRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskIdRange" + }, + "title": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled.", + "description": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled." + } + }, + "title": "Specifies any dependencies of a task. Any task that is explicitly specified or within a dependency range must complete before the dependant task will be scheduled." + }, + "TaskIdRange": { + "properties": { + "start": { + "type": "integer", + "format": "int32", + "title": "The first task ID in the range.", + "description": "The first task ID in the range." + }, + "end": { + "type": "integer", + "format": "int32", + "title": "The last task ID in the range.", + "description": "The last task ID in the range." + } + }, + "title": "A range of task IDs that a task can depend on. All tasks with IDs in the range must complete successfully before the dependent task can be scheduled.", + "description": "The start and end of the range are inclusive. For example, if a range has start 9 and end 12, then it represents tasks '9', '10', '11' and '12'.", + "required": [ + "start", + "end" + ] + }, + "ParametricSweepParameterSet": { + "properties": { + "start": { + "type": "integer", + "title": "The start of the parametric sweep range.", + "description": "The start of the parametric sweep range." + }, + "end": { + "type": "integer", + "title": "The end of the parametric sweep range.", + "description": "The end of the parametric sweep range." + }, + "step": { + "type": "integer", + "title": "The increment step between values of the parameter.", + "description": "The increment step between values of the parameter." + } + }, + "required": [ + "start", + "end" + ] + }, + "RepeatTask": { + "properties": { + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "title": "An Azure Batch task to add.", + "required": [ + "commandLine" + ] + }, + "TaskPerFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to take files.", + "description": "The file group in the linked storage account from which to take files." + }, + "containerUrl": { + "type": "string", + "title": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS).", + "description": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS)." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files from which to create tasks.", + "description": "A prefix with which to filter the files from which to create tasks." + } + } + }, + "ApplicationTemplateInfo": { + "properties": { + "filePath": { + "type": "string", + "title": "The path to the application template file.", + "description": "The path to the application template file." + }, + "parameters": { + "type": "object", + "title": "The values to assign to the application template parameters.", + "description": "The values to assign to the application template parameters." + } + } + } + } +} \ No newline at end of file diff --git a/schema/jobtemplate.schema.json b/schema/jobtemplate.schema.json new file mode 100644 index 0000000..c431a4f --- /dev/null +++ b/schema/jobtemplate.schema.json @@ -0,0 +1,2047 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "jobtemplate", + "description": "An Azure Batch job template", + "type": "object", + "$ref": "#/definitions/JobTemplate", + "definitions": { + "JobTemplate": { + "properties": { + "parameters": { + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/BatchTemplateParameter" + }, + "title": "The parameters whose values may be supplied each time the template is used.", + "description": "The parameters whose values may be supplied each time the template is used." + }, + "job": { + "type": "object", + "$ref": "#/definitions/JobTemplateJob", + "title": "The resource to be created from the template.", + "description": "The resource to be created from the template." + } + }, + "required": [ + "job" + ], + "title": "An Azure Batch job template." + }, + "BatchTemplateParameter": { + "properties": { + "type": { + "type": "string", + "enum": [ + "int", + "string", + "bool" + ], + "title": "The data type of the parameter.", + "description": "The data type of the parameter." + }, + "defaultValue": { + "title": "The default value of the parameter.", + "description": "The default value of the parameter." + }, + "allowedValues": { + "type": "array", + "title": "The allowed values of the parameter.", + "description": "The allowed values of the parameter." + }, + "minValue": { + "type": "integer", + "title": "The minimum value of the parameter.", + "description": "The minimum value of the parameter." + }, + "maxValue": { + "type": "integer", + "title": "The maximum value of the parameter.", + "description": "The maximum value of the parameter." + }, + "minLength": { + "type": "integer", + "title": "The minimum length of the parameter value.", + "description": "The minimum length of the parameter value." + }, + "maxLength": { + "type": "integer", + "title": "The maximum length of the parameter value.", + "description": "The maximum length of the parameter value." + }, + "metadata": { + "type": "object", + "$ref": "#/definitions/BatchTemplateParameterMetadata", + "title": "Additional data about the parameter.", + "description": "Additional data about the parameter." + } + }, + "required": [ + "type" + ] + }, + "BatchTemplateParameterMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A description of the parameter, suitable for display in a user interface.", + "description": "A description of the parameter, suitable for display in a user interface." + } + }, + "title": "Additional data about an Azure Batch template parameter." + }, + "JobTemplateJob": { + "properties": { + "type": { + "type": "string", + "title": "The type of Azure Batch resource to create. Must be 'Microsoft.Batch/batchAccounts/jobs'.", + "enum": [ + "Microsoft.Batch/batchAccounts/jobs" + ], + "description": "The type of Azure Batch resource to create. Must be 'Microsoft.Batch/batchAccounts/jobs'." + }, + "apiVersion": { + "type": "string", + "title": "The Azure Batch API version against which the template is written. Must be '2017-05-01.5.0'.", + "enum": [ + "2017-05-01.5.0" + ], + "description": "The Azure Batch API version against which the template is written. Must be '2017-05-01.5.0'." + }, + "properties": { + "type": "object", + "$ref": "#/definitions/JobAddParameter", + "title": "The job to be created from the template.", + "description": "The job to be created from the template." + } + }, + "required": [ + "type", + "apiVersion", + "properties" + ], + "title": "The resource to be created from an Azure Batch template." + }, + "JobAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the job within the account.", + "description": "A string that uniquely identifies the job within the account." + }, + "displayName": { + "type": "string", + "title": "The display name for the job.", + "description": "The display name for the job." + }, + "priority": { + "format": "int32", + "title": "The priority of the job.", + "description": "The priority of the job.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "constraints": { + "$ref": "#/definitions/JobConstraints" + }, + "jobManagerTask": { + "$ref": "#/definitions/JobManagerTask", + "title": "Details of a Job Manager task to be launched when the job is started.", + "description": "Details of a Job Manager task to be launched when the job is started." + }, + "jobPreparationTask": { + "$ref": "#/definitions/JobPreparationTask", + "title": "The Job Preparation task.", + "description": "The Job Preparation task." + }, + "jobReleaseTask": { + "$ref": "#/definitions/JobReleaseTask", + "title": "The Job Release task.", + "description": "The Job Release task." + }, + "commonEnvironmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks).", + "description": "The list of common environment variable settings. These environment variables are set for all tasks in the job (including the Job Manager, Job Preparation and Job Release tasks)." + }, + "poolInfo": { + "$ref": "#/definitions/PoolInformation", + "title": "The pool on which the Batch service runs the job's tasks.", + "description": "The pool on which the Batch service runs the job's tasks." + }, + "onAllTasksComplete": { + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "The action the Batch service should take when all tasks in the job are in the completed state.", + "$ref": "#/definitions/OnAllTasksComplete" + }, + "onTaskFailure": { + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "$ref": "#/definitions/OnTaskFailure" + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the job as metadata.", + "description": "A list of name-value pairs associated with the job as metadata." + }, + "usesTaskDependencies": { + "title": "The flag that determines if this job will use tasks with dependencies.", + "description": "The flag that determines if this job will use tasks with dependencies.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskFactory": { + "type": "object", + "title": "A specification for the tasks to be added to the job.", + "$ref": "#/definitions/TaskFactory", + "description": "A specification for the tasks to be added to the job." + }, + "applicationTemplateInfo": { + "type": "object", + "title": "An application template from which to create the job.", + "$ref": "#/definitions/ApplicationTemplateInfo", + "description": "An application template from which to create the job." + } + }, + "required": [ + "id", + "poolInfo" + ], + "title": "An Azure Batch job to add." + }, + "JobConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the job may run, measured from the time the job is created.", + "description": "The maximum elapsed time that the job may run, measured from the time the job is created." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times each task may be retried. The Batch service retries a task if its exit code is nonzero.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "The execution constraints for a job." + }, + "JobManagerTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Manager taskwithin the job.", + "description": "A string that uniquely identifies the Job Manager taskwithin the job." + }, + "displayName": { + "type": "string", + "title": "The display name of the Job Manager task.", + "description": "The display name of the Job Manager task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Manager task.", + "description": "The command line of the Job Manager task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Manager task.", + "description": "A list of environment variable settings for the Job Manager task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Manager task.", + "description": "Constraints that apply to the Job Manager task." + }, + "killJobOnCompletion": { + "title": "Whether completion of the Job Manager task signifies completion of the entire job.", + "description": "Whether completion of the Job Manager task signifies completion of the entire job.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Manager task runs.", + "description": "The user identity under which the Job Manager task runs." + }, + "runExclusive": { + "title": "Whether the Job Manager task requires exclusive use of the compute node where it runs.", + "description": "Whether the Job Manager task requires exclusive use of the compute node where it runs.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "allowLowPriorityNode": { + "title": "Whether the Job Manager task may run on a low-priority compute node.", + "description": "Whether the Job Manager task may run on a low-priority compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "Specifies details of a Job Manager task." + }, + "ResourceFile": { + "properties": { + "blobSource": { + "type": "string", + "title": "The URL of the file within Azure Blob Storage.", + "description": "The URL of the file within Azure Blob Storage." + }, + "filePath": { + "type": "string", + "title": "The location on the compute node to which to download the file, relative to the task's working directory.", + "description": "The location on the compute node to which to download the file, relative to the task's working directory." + }, + "fileMode": { + "type": "string", + "title": "The file permission mode attribute in octal format.", + "description": "The file permission mode attribute in octal format." + }, + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line.", + "description": "A source for files to be downloaded before running the task command line." + } + }, + "required": [], + "title": "A file to be downloaded from Azure blob storage to a compute node.", + "oneOf": [ + { + "required": [ + "source" + ] + }, + { + "required": [ + "blobSource" + ] + } + ] + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files.", + "description": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download.", + "description": "A prefix with which to filter the files to download." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFile": { + "properties": { + "filePattern": { + "type": "string", + "title": "A pattern indicating which file(s) to upload.", + "description": "A pattern indicating which file(s) to upload." + }, + "destination": { + "title": "The destination for the output file(s).", + "$ref": "#/definitions/OutputFileDestination", + "description": "The destination for the output file(s)." + }, + "uploadOptions": { + "title": "Additional options for the upload operation, including under what conditions to perform the upload.", + "$ref": "#/definitions/OutputFileUploadOptions", + "description": "Additional options for the upload operation, including under what conditions to perform the upload." + } + }, + "required": [ + "filePattern", + "destination", + "uploadOptions" + ], + "title": "A specification for uploading files from an Azure Batch node to another location after the Batch service has finished executing the task process." + }, + "OutputFileDestination": { + "properties": { + "container": { + "title": "A location in Azure blob storage to which files are uploaded.", + "$ref": "#/definitions/OutputFileBlobContainerDestination", + "description": "A location in Azure blob storage to which files are uploaded." + }, + "autoStorage": { + "type": "object", + "$ref": "#/definitions/OutputFileAutoStorageDestination", + "title": "A destination in the linked storage account to which to persist output files.", + "description": "A destination in the linked storage account to which to persist output files." + } + }, + "title": "The destination to which a file should be uploaded." + }, + "OutputFileBlobContainerDestination": { + "properties": { + "path": { + "type": "string", + "title": "The destination blob or virtual directory within the Azure Storage container.", + "description": "The destination blob or virtual directory within the Azure Storage container." + }, + "containerUrl": { + "type": "string", + "title": "The URL of the container within Azure Blob Storage to which to upload the file(s).", + "description": "The URL of the container within Azure Blob Storage to which to upload the file(s)." + } + }, + "required": [ + "containerUrl" + ], + "title": "Specifies a file upload destination within an Azure blob storage container." + }, + "OutputFileAutoStorageDestination": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account to which to save files.", + "description": "The file group in the linked storage account to which to save files." + }, + "path": { + "type": "string", + "title": "The path within the file group to which output files will be uploaded.", + "description": "The path within the file group to which output files will be uploaded." + } + }, + "required": [ + "fileGroup" + ] + }, + "OutputFileUploadOptions": { + "properties": { + "uploadCondition": { + "title": "The conditions under which the task output file or set of files should be uploaded.", + "description": "The conditions under which the task output file or set of files should be uploaded.", + "$ref": "#/definitions/OutputFileUploadCondition" + } + }, + "required": [ + "uploadCondition" + ], + "title": "Details about an output file upload operation, including under what conditions to perform the upload." + }, + "OutputFileUploadCondition": { + "type": "string", + "title": "The conditions under which a task output file or set of files should be uploaded.", + "description": "taskSuccess: Upload the file(s) only after the task process exits with an exit code of 0. taskFailure: Upload the file(s) only after the task process exits with a nonzero exit code. taskCompletion: Upload the file(s) after the task process exits, no matter what the exit code was.", + "enum": [ + "taskSuccess", + "taskFailure", + "taskCompletion" + ], + "x-ms-enum": { + "name": "OutputFileUploadCondition", + "modelAsString": false + } + }, + "EnvironmentSetting": { + "properties": { + "name": { + "type": "string", + "title": "The name of the environment variable.", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "title": "The value of the environment variable.", + "description": "The value of the environment variable." + } + }, + "required": [ + "name" + ], + "title": "An environment variable to be set on a task process." + }, + "TaskConstraints": { + "properties": { + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it.", + "description": "The maximum elapsed time that the task may run, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory on the compute node where it ran, from the time it completes execution. After this time, the Batch service may delete the task directory and all its contents." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.", + "description": "The maximum number of times the task may be retried. The Batch service retries a task if its exit code is nonzero.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "Execution constraints to apply to a task." + }, + "UserIdentity": { + "properties": { + "username": { + "type": "string", + "x-ms-client-name": "userName", + "title": "The name of the user identity under which the task is run.", + "description": "The name of the user identity under which the task is run." + }, + "autoUser": { + "$ref": "#/definitions/AutoUserSpecification", + "title": "The auto user under which the task is run.", + "description": "The auto user under which the task is run." + } + }, + "title": "The definition of the user identity under which the task is run.", + "description": "Specify either the userName or autoUser property, but not both." + }, + "AutoUserSpecification": { + "properties": { + "scope": { + "type": "string", + "title": "The scope for the auto user", + "description": "The scope for the auto user", + "enum": [ + "task", + "pool" + ], + "x-ms-enum": { + "name": "AutoUserScope", + "modelAsString": false + } + }, + "elevationLevel": { + "title": "The elevation level of the auto user.", + "description": "The elevation level of the auto user.", + "$ref": "#/definitions/ElevationLevel" + } + }, + "title": "Specifies the parameters for the auto user that runs a task on the Batch service." + }, + "ElevationLevel": { + "type": "string", + "title": "The elevation level of the user.", + "description": "nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.", + "enum": [ + "nonAdmin", + "admin" + ], + "x-ms-enum": { + "name": "ElevationLevel", + "modelAsString": false + } + }, + "ApplicationPackageReference": { + "properties": { + "applicationId": { + "type": "string", + "title": "The ID of the application to deploy.", + "description": "The ID of the application to deploy." + }, + "version": { + "type": "string", + "title": "The version of the application to deploy. If omitted, the default version is deployed.", + "description": "The version of the application to deploy. If omitted, the default version is deployed." + } + }, + "required": [ + "applicationId" + ], + "title": "A reference to an application package to be deployed to compute nodes." + }, + "AuthenticationTokenSettings": { + "properties": { + "access": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "job" + ], + "x-ms-enum": { + "name": "AccessScope", + "modelAsString": false + } + }, + "title": "The Batch resources to which the token grants access.", + "description": "The Batch resources to which the token grants access." + } + }, + "title": "The settings for an authentication token that the task can use to perform Batch service operations." + }, + "JobPreparationTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Preparation task within the job.", + "description": "A string that uniquely identifies the Job Preparation task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Preparation task.", + "description": "The command line of the Job Preparation task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Preparation task.", + "description": "A list of environment variable settings for the Job Preparation task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "Constraints that apply to the Job Preparation task.", + "description": "Constraints that apply to the Job Preparation task." + }, + "waitForSuccess": { + "title": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.", + "description": "Whether the Batch service should wait for the Job Preparation task to complete successfully before scheduling any other tasks of the job on the compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Preparation task runs.", + "description": "The user identity under which the Job Preparation task runs." + }, + "rerunOnNodeRebootAfterSuccess": { + "title": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots.", + "description": "Whether the Batch service should rerun the Job Preparation task after a compute node reboots.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Preparation task to run before any tasks of the job on any given compute node." + }, + "JobReleaseTask": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the Job Release task within the job.", + "description": "A string that uniquely identifies the Job Release task within the job." + }, + "commandLine": { + "type": "string", + "title": "The command line of the Job Release task.", + "description": "The command line of the Job Release task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the Job Release task.", + "description": "A list of environment variable settings for the Job Release task." + }, + "maxWallClockTime": { + "type": "string", + "format": "duration", + "title": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request).", + "description": "The maximum elapsed time that the Job Release task may run on a given compute node, measured from the time the task starts. If the task does not complete within the time limit, the Batch service terminates it. The default value is 15 minutes. You may not specify a timeout longer than 15 minutes. If you do, the Batch service rejects it with an error; if you are calling the REST API directly, the HTTP status code is 400 (Bad Request)." + }, + "retentionTime": { + "type": "string", + "format": "duration", + "title": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents.", + "description": "The minimum time to retain the task directory for the Job Release task on the compute node. After this time, the Batch service may delete the task directory and all its contents." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the Job Release task runs.", + "description": "The user identity under which the Job Release task runs." + } + }, + "required": [ + "commandLine" + ], + "title": "A Job Release task to run on job completion on any compute node where the job has run." + }, + "PoolInformation": { + "properties": { + "poolId": { + "type": "string", + "title": "The ID of an existing pool. All the tasks of the job will run on the specified pool.", + "description": "The ID of an existing pool. All the tasks of the job will run on the specified pool." + }, + "autoPoolSpecification": { + "$ref": "#/definitions/AutoPoolSpecification", + "title": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted.", + "description": "Characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + } + }, + "title": "Specifies how a job should be assigned to a pool.", + "oneOf": [ + { + "required": [ + "poolId" + ] + }, + { + "required": [ + "autoPoolSpecification" + ] + } + ] + }, + "AutoPoolSpecification": { + "properties": { + "autoPoolIdPrefix": { + "type": "string", + "title": "A prefix to be added to the unique identifier when a pool is automatically created.", + "description": "A prefix to be added to the unique identifier when a pool is automatically created." + }, + "poolLifetimeOption": { + "type": "string", + "title": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "description": "The minimum lifetime of created auto pools, and how multiple jobs on a schedule are assigned to pools.", + "enum": [ + "jobSchedule", + "job" + ], + "x-ms-enum": { + "name": "PoolLifetimeOption", + "modelAsString": false + } + }, + "keepAlive": { + "title": "Whether to keep an auto pool alive after its lifetime expires.", + "description": "Whether to keep an auto pool alive after its lifetime expires.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "pool": { + "$ref": "#/definitions/PoolSpecification", + "title": "The pool specification for the auto pool.", + "description": "The pool specification for the auto pool." + } + }, + "required": [ + "poolLifetimeOption" + ], + "title": "Specifies characteristics for a temporary 'auto pool'. The Batch service will create this auto pool when the job is submitted." + }, + "PoolSpecification": { + "properties": { + "displayName": { + "type": "string", + "title": "The display name for the pool.", + "description": "The display name for the pool." + }, + "vmSize": { + "type": "string", + "title": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size.", + "description": "The size of the virtual machines in the pool. All virtual machines in a pool are the same size." + }, + "cloudServiceConfiguration": { + "$ref": "#/definitions/CloudServiceConfiguration", + "title": "The cloud service configuration for the pool.", + "description": "The cloud service configuration for the pool." + }, + "virtualMachineConfiguration": { + "$ref": "#/definitions/VirtualMachineConfiguration", + "title": "The virtual machine configuration for the pool.", + "description": "The virtual machine configuration for the pool." + }, + "maxTasksPerNode": { + "format": "int32", + "title": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "description": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskSchedulingPolicy": { + "$ref": "#/definitions/TaskSchedulingPolicy" + }, + "resizeTimeout": { + "type": "string", + "format": "duration", + "title": "The timeout for allocation of compute nodes to the pool.", + "description": "The timeout for allocation of compute nodes to the pool." + }, + "targetDedicatedNodes": { + "format": "int32", + "title": "The desired number of dedicated compute nodes in the pool.", + "description": "The desired number of dedicated compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "targetLowPriorityNodes": { + "format": "int32", + "title": "The desired number of low-priority compute nodes in the pool.", + "description": "The desired number of low-priority compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "enableAutoScale": { + "title": "Whether the pool size should automatically adjust over time.", + "description": "Whether the pool size should automatically adjust over time.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "autoScaleFormula": { + "type": "string", + "title": "The formula for the desired number of compute nodes in the pool.", + "description": "The formula for the desired number of compute nodes in the pool." + }, + "autoScaleEvaluationInterval": { + "type": "string", + "format": "duration", + "title": "The time interval at which to automatically adjust the pool size according to the autoscale formula.", + "description": "The time interval at which to automatically adjust the pool size according to the autoscale formula." + }, + "enableInterNodeCommunication": { + "title": "Whether the pool permits direct communication between nodes.", + "description": "Whether the pool permits direct communication between nodes.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "networkConfiguration": { + "$ref": "#/definitions/NetworkConfiguration", + "title": "The network configuration for the pool.", + "description": "The network configuration for the pool." + }, + "startTask": { + "$ref": "#/definitions/StartTask", + "title": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted.", + "description": "A task to run on each compute node as it joins the pool. The task runs when the node is added to the pool or when the node is restarted." + }, + "certificateReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/CertificateReference" + }, + "title": "A list of certificates to be installed on each compute node in the pool.", + "description": "A list of certificates to be installed on each compute node in the pool." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "The list of application packages to be installed on each compute node in the pool.", + "description": "The list of application packages to be installed on each compute node in the pool." + }, + "applicationLicenses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of application licenses the Batch service will make available on each compute node in the pool.", + "description": "The list of application licenses the Batch service will make available on each compute node in the pool." + }, + "userAccounts": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccount" + }, + "title": "The list of user accounts to be created on each node in the pool.", + "description": "The list of user accounts to be created on each node in the pool." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the pool as metadata.", + "description": "A list of name-value pairs associated with the pool as metadata." + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool.", + "description": "A collection of packages to be added from external package managers to each node in the pool." + } + }, + "required": [ + "vmSize" + ], + "title": "Specification for creating a new pool.", + "oneOf": [ + { + "required": [ + "cloudServiceConfiguration" + ] + }, + { + "required": [ + "virtualMachineConfiguration" + ] + } + ], + "dependencies": { + "autoScaleFormula": [ + "enableAutoScale" + ], + "autoScaleEvaluationInterval": [ + "enableAutoScale" + ] + } + }, + "CloudServiceConfiguration": { + "properties": { + "osFamily": { + "type": "string", + "title": "The Azure Guest OS family to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS family to be installed on the virtual machines in the pool." + }, + "targetOSVersion": { + "type": "string", + "title": "The Azure Guest OS version to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS version to be installed on the virtual machines in the pool." + }, + "currentOSVersion": { + "type": "string", + "title": "The Azure Guest OS Version currently installed on the virtual machines in the pool.", + "description": "The Azure Guest OS Version currently installed on the virtual machines in the pool." + } + }, + "required": [ + "osFamily" + ], + "title": "The configuration for nodes in a pool based on the Azure Cloud Services platform." + }, + "VirtualMachineConfiguration": { + "properties": { + "imageReference": { + "$ref": "#/definitions/ImageReference", + "title": "A reference to the Azure Virtual Machines Marketplace image to use.", + "description": "A reference to the Azure Virtual Machines Marketplace image to use." + }, + "osDisk": { + "$ref": "#/definitions/OSDisk", + "title": "A reference to the OS disk image to use.", + "description": "A reference to the OS disk image to use." + }, + "nodeAgentSKUId": { + "type": "string", + "title": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool.", + "description": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool." + }, + "windowsConfiguration": { + "$ref": "#/definitions/WindowsConfiguration", + "title": "Windows operating system settings on the virtual machine.", + "description": "Windows operating system settings on the virtual machine." + } + }, + "required": [ + "nodeAgentSKUId" + ], + "title": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "oneOf": [ + { + "required": [ + "imageReference" + ] + }, + { + "required": [ + "osDisk" + ] + } + ] + }, + "ImageReference": { + "properties": { + "publisher": { + "type": "string", + "title": "The publisher of the Azure Virtual Machines Marketplace image.", + "description": "The publisher of the Azure Virtual Machines Marketplace image." + }, + "offer": { + "type": "string", + "title": "The offer type of the Azure Virtual Machines Marketplace image.", + "description": "The offer type of the Azure Virtual Machines Marketplace image." + }, + "sku": { + "type": "string", + "title": "The SKU of the Azure Virtual Machines Marketplace image.", + "description": "The SKU of the Azure Virtual Machines Marketplace image." + }, + "version": { + "type": "string", + "title": "The version of the Azure Virtual Machines Marketplace image.", + "description": "The version of the Azure Virtual Machines Marketplace image." + } + }, + "required": [ + "publisher", + "offer", + "sku" + ], + "title": "A reference to an Azure Virtual Machines Marketplace image. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation." + }, + "OSDisk": { + "properties": { + "imageUris": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The collection of Virtual Hard Disk (VHD) URIs.", + "description": "The collection of Virtual Hard Disk (VHD) URIs." + }, + "caching": { + "type": "string", + "title": "The type of caching to enable for the OS disk.", + "description": "The type of caching to enable for the OS disk.", + "enum": [ + "none", + "readOnly", + "readWrite" + ], + "x-ms-enum": { + "name": "CachingType", + "modelAsString": false + } + } + }, + "required": [ + "imageUris" + ], + "title": "A reference to an OS disk image." + }, + "WindowsConfiguration": { + "properties": { + "enableAutomaticUpdates": { + "title": "Whether automatic updates are enabled on the virtual machine.", + "description": "Whether automatic updates are enabled on the virtual machine.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "Windows operating system settings to apply to the virtual machine." + }, + "TaskSchedulingPolicy": { + "properties": { + "nodeFillType": { + "type": "string", + "title": "How tasks should be distributed across compute nodes.", + "enum": [ + "spread", + "pack" + ], + "x-ms-enum": { + "name": "ComputeNodeFillType", + "modelAsString": false + }, + "description": "How tasks should be distributed across compute nodes." + } + }, + "required": [ + "nodeFillType" + ], + "title": "Specifies how tasks should be distributed across compute nodes." + }, + "NetworkConfiguration": { + "properties": { + "subnetId": { + "type": "string", + "title": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "description": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "externalDocs": { + "url": "https://azure.microsoft.com/en-us/documentation/articles/role-based-access-built-in-roles/#classic-virtual-machine-contributor", + "description": "Setting up RBAC for Azure Batch VNETs" + } + } + }, + "description": "The network configuration for a pool." + }, + "StartTask": { + "properties": { + "commandLine": { + "type": "string", + "title": "The command line of the start task.", + "description": "The command line of the start task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the start task.", + "description": "A list of environment variable settings for the start task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the start task runs.", + "description": "The user identity under which the start task runs." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times the task may be retried.", + "description": "The maximum number of times the task may be retried.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "waitForSuccess": { + "title": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "description": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "commandLine" + ], + "title": "A task which is run when a compute node joins a pool in the Azure Batch service, or when the compute node is rebooted or reimaged." + }, + "CertificateReference": { + "properties": { + "thumbprint": { + "type": "string", + "title": "The thumbprint of the certificate.", + "description": "The thumbprint of the certificate." + }, + "thumbprintAlgorithm": { + "type": "string", + "title": "The algorithm with which the thumbprint is associated. This must be sha1.", + "description": "The algorithm with which the thumbprint is associated. This must be sha1." + }, + "storeLocation": { + "type": "string", + "title": "The location of the certificate store on the compute node into which to install the certificate.", + "description": "The location of the certificate store on the compute node into which to install the certificate.", + "enum": [ + "currentUser", + "localMachine" + ], + "x-ms-enum": { + "name": "CertificateStoreLocation", + "modelAsString": false + } + }, + "storeName": { + "type": "string", + "title": "The name of the certificate store on the compute node into which to install the certificate.", + "description": "The name of the certificate store on the compute node into which to install the certificate." + }, + "visibility": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "startTask", + "task", + "remoteUser" + ], + "x-ms-enum": { + "name": "CertificateVisibility", + "modelAsString": false + } + }, + "title": "Which user accounts on the compute node should have access to the private data of the certificate.", + "description": "Which user accounts on the compute node should have access to the private data of the certificate." + } + }, + "required": [ + "thumbprint", + "thumbprintAlgorithm" + ], + "title": "A reference to a certificate to be installed on compute nodes in a pool." + }, + "UserAccount": { + "properties": { + "name": { + "type": "string", + "title": "The name of the user account.", + "description": "The name of the user account." + }, + "password": { + "type": "string", + "title": "The password for the user account.", + "description": "The password for the user account." + }, + "elevationLevel": { + "title": "The elevation level of the user account.", + "description": "The elevation level of the user account.", + "$ref": "#/definitions/ElevationLevel" + }, + "linuxUserConfiguration": { + "title": "The Linux-specific user configuration for the user account.", + "description": "The Linux-specific user configuration for the user account.", + "$ref": "#/definitions/LinuxUserConfiguration" + } + }, + "required": [ + "name", + "password" + ], + "title": "Properties used to create a user used to execute tasks on an Azure Batch node." + }, + "LinuxUserConfiguration": { + "properties": { + "uid": { + "format": "int32", + "title": "The user ID of the user account.", + "description": "The user ID of the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "gid": { + "format": "int32", + "title": "The group ID for the user account.", + "description": "The group ID for the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "sshPrivateKey": { + "type": "string", + "title": "The SSH private key for the user account.", + "description": "The SSH private key for the user account." + } + }, + "title": "Properties used to create a user account on a Linux node." + }, + "MetadataItem": { + "properties": { + "name": { + "type": "string", + "title": "The name of the metadata item.", + "description": "The name of the metadata item." + }, + "value": { + "type": "string", + "title": "The value of the metadata item.", + "description": "The value of the metadata item." + } + }, + "required": [ + "name", + "value" + ], + "title": "A name-value pair associated with a Batch service resource.", + "description": "The Batch service does not assign any meaning to this metadata; it is solely for the use of user code." + }, + "PackageReference": { + "properties": { + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage", + "description": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository.", + "description": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed.", + "description": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "title": "Whether Chocolatey will install packages without a checksum for validation.", + "description": "Whether Chocolatey will install packages without a checksum for validation.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages).", + "description": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": [ + "type", + "id" + ] + }, + "OnAllTasksComplete": { + "type": "string", + "title": "The action the Batch service should take when all tasks in the job are in the completed state.", + "description": "noAction - do nothing. The job remains active unless terminated or disabled by some other means. terminateJob - terminate the job. The job's terminateReason is set to 'AllTasksComplete'.", + "enum": [ + "noAction", + "terminateJob" + ], + "x-ms-enum": { + "name": "OnAllTasksComplete", + "modelAsString": false + } + }, + "OnTaskFailure": { + "type": "string", + "title": "The action the Batch service should take when any task in the job fails. A task is considered to have failed if it completes with a non-zero exit code and has exhausted its retry count, or if it had a scheduling error.", + "description": "noAction - do nothing. performExitOptionsJobAction - take the action associated with the task exit condition in the task's exitConditions collection. This may still result in no action being taken, if that is what the task specifies.", + "enum": [ + "noAction", + "performExitOptionsJobAction" + ], + "x-ms-enum": { + "name": "OnTaskFailure", + "modelAsString": false + } + }, + "TaskFactory": { + "properties": { + "type": { + "type": "string", + "title": "The type of task factory - taskCollection, parametricSweep or taskPerFile", + "description": "The type of task factory - taskCollection, parametricSweep or taskPerFile" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskAddParameter" + }, + "title": "The tasks that make up the job.", + "description": "The tasks that make up the job." + }, + "parameterSets": { + "type": "array", + "items": { + "$ref": "#/definitions/ParametricSweepParameterSet" + }, + "title": "The parameter or parameters whose values will be varied over the parametric sweep.", + "description": "The parameter or parameters whose values will be varied over the parametric sweep." + }, + "repeatTask": { + "type": "object", + "$ref": "#/definitions/RepeatTask", + "title": "The task that is to be repeated for each value.", + "description": "The task that is to be repeated for each value." + }, + "source": { + "type": "object", + "$ref": "#/definitions/TaskPerFileSource", + "title": "The source of the files for which to create tasks.", + "description": "The source of the files for which to create tasks." + } + } + }, + "TaskAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the task within the job.", + "description": "A string that uniquely identifies the task within the job." + }, + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "dependsOn": { + "$ref": "#/definitions/TaskDependencies", + "title": "The tasks that this task depends on.", + "description": "The tasks that this task depends on." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "required": [ + "id", + "commandLine" + ], + "title": "An Azure Batch task to add." + }, + "ExitConditions": { + "properties": { + "exitCodes": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeMapping" + }, + "title": "A list of individual task exit codes and how the Batch service should respond to them.", + "description": "A list of individual task exit codes and how the Batch service should respond to them." + }, + "exitCodeRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/ExitCodeRangeMapping" + }, + "title": "A list of task exit code ranges and how the Batch service should respond to them.", + "description": "A list of task exit code ranges and how the Batch service should respond to them." + }, + "preProcessingError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails to start due to an error.", + "description": "How the Batch service should respond if the task fails to start due to an error." + }, + "fileUploadError": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if a file upload error occurs.", + "description": "How the Batch service should respond if a file upload error occurs." + }, + "default": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties.", + "description": "How the Batch service should respond if the task fails with an exit condition not covered by any of the other properties." + } + }, + "title": "Specifies how the Batch service should respond when the task completes." + }, + "ExitCodeMapping": { + "properties": { + "code": { + "format": "int32", + "title": "A process exit code.", + "description": "A process exit code.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with this exit code.", + "description": "How the Batch service should respond if the task exits with this exit code." + } + }, + "title": "How the Batch service should respond if a task exits with a particular exit code.", + "required": [ + "code", + "exitOptions" + ] + }, + "ExitOptions": { + "properties": { + "jobAction": { + "type": "string", + "title": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "description": "An action to take on the job containing the task, if the task completes with the given exit condition and the job's onTaskFailed property is 'performExitOptionsJobAction'.", + "enum": [ + "none", + "disable", + "terminate" + ], + "x-ms-enum": { + "name": "JobAction", + "modelAsString": false + } + }, + "dependencyAction": { + "type": "string", + "title": "An action that the Batch service performs on tasks that depend on this task.", + "description": "An action that the Batch service performs on tasks that depend on this task.", + "enum": [ + "satisfy", + "block" + ], + "x-ms-enum": { + "name": "DependencyAction", + "modelAsString": false + } + } + }, + "title": "Specifies how the Batch service responds to a particular exit condition." + }, + "ExitCodeRangeMapping": { + "properties": { + "start": { + "format": "int32", + "title": "The first exit code in the range.", + "description": "The first exit code in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "format": "int32", + "title": "The last exit code in the range.", + "description": "The last exit code in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "exitOptions": { + "$ref": "#/definitions/ExitOptions", + "title": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive).", + "description": "How the Batch service should respond if the task exits with an exit code in the range start to end (inclusive)." + } + }, + "title": "A range of exit codes and how the Batch service should respond to exit codes within that range.", + "required": [ + "start", + "end", + "exitOptions" + ] + }, + "AffinityInformation": { + "properties": { + "affinityId": { + "type": "string", + "title": "An opaque string representing the location of a compute node or a task that has run previously.", + "description": "An opaque string representing the location of a compute node or a task that has run previously." + } + }, + "required": [ + "affinityId" + ], + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start a task." + }, + "MultiInstanceSettings": { + "properties": { + "numberOfInstances": { + "format": "int32", + "title": "The number of compute nodes required by the task.", + "description": "The number of compute nodes required by the task.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "coordinationCommandLine": { + "type": "string", + "title": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command.", + "description": "The command line to run on all the compute nodes to enable them to coordinate when the primary runs the main task command." + }, + "commonResourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download before running the coordination command line.", + "description": "A list of files that the Batch service will download before running the coordination command line." + } + }, + "required": [ + "numberOfInstances" + ], + "title": "Settings which specify how to run a multi-instance task.", + "description": "Multi-instance tasks are commonly used to support MPI tasks." + }, + "TaskDependencies": { + "properties": { + "taskIds": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled.", + "description": "The list of task IDs that this task depends on. All tasks in this list must complete successfully before the dependent task can be scheduled." + }, + "taskIdRanges": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskIdRange" + }, + "title": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled.", + "description": "The list of task ID ranges that this task depends on. All tasks in all ranges must complete successfully before the dependent task can be scheduled." + } + }, + "title": "Specifies any dependencies of a task. Any task that is explicitly specified or within a dependency range must complete before the dependant task will be scheduled." + }, + "TaskIdRange": { + "properties": { + "start": { + "format": "int32", + "title": "The first task ID in the range.", + "description": "The first task ID in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "format": "int32", + "title": "The last task ID in the range.", + "description": "The last task ID in the range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "A range of task IDs that a task can depend on. All tasks with IDs in the range must complete successfully before the dependent task can be scheduled.", + "description": "The start and end of the range are inclusive. For example, if a range has start 9 and end 12, then it represents tasks '9', '10', '11' and '12'.", + "required": [ + "start", + "end" + ] + }, + "ParametricSweepParameterSet": { + "properties": { + "start": { + "title": "The start of the parametric sweep range.", + "description": "The start of the parametric sweep range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "end": { + "title": "The end of the parametric sweep range.", + "description": "The end of the parametric sweep range.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "step": { + "title": "The increment step between values of the parameter.", + "description": "The increment step between values of the parameter.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "start", + "end" + ] + }, + "RepeatTask": { + "properties": { + "displayName": { + "type": "string", + "title": "A display name for the task.", + "description": "A display name for the task." + }, + "commandLine": { + "type": "string", + "title": "The command line of the task.", + "description": "The command line of the task." + }, + "exitConditions": { + "$ref": "#/definitions/ExitConditions" + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "outputFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/OutputFile" + }, + "title": "A list of files that the Batch service will upload from the compute node after running the command line.", + "description": "A list of files that the Batch service will upload from the compute node after running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the task.", + "description": "A list of environment variable settings for the task." + }, + "affinityInfo": { + "$ref": "#/definitions/AffinityInformation", + "title": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task.", + "description": "A locality hint that can be used by the Batch service to select a compute node on which to start the new task." + }, + "constraints": { + "$ref": "#/definitions/TaskConstraints", + "title": "The execution constraints that apply to this task.", + "description": "The execution constraints that apply to this task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the task runs.", + "description": "The user identity under which the task runs." + }, + "multiInstanceSettings": { + "$ref": "#/definitions/MultiInstanceSettings", + "title": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task.", + "description": "An object that indicates that the task is a multi-instance task, and contains information about how to run the multi-instance task." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "A list of application packages that the Batch service will deploy to the compute node before running the command line.", + "description": "A list of application packages that the Batch service will deploy to the compute node before running the command line." + }, + "authenticationTokenSettings": { + "title": "The settings for an authentication token that the task can use to perform Batch service operations.", + "description": "The settings for an authentication token that the task can use to perform Batch service operations.", + "$ref": "#/definitions/AuthenticationTokenSettings" + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs.", + "description": "A collection of packages from external package managers to be added to the node where the task runs." + } + }, + "title": "An Azure Batch task to add.", + "required": [ + "commandLine" + ] + }, + "TaskPerFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to take files.", + "description": "The file group in the linked storage account from which to take files." + }, + "containerUrl": { + "type": "string", + "title": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS).", + "description": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS)." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files from which to create tasks.", + "description": "A prefix with which to filter the files from which to create tasks." + } + } + }, + "ApplicationTemplateInfo": { + "properties": { + "filePath": { + "type": "string", + "title": "The path to the application template file.", + "description": "The path to the application template file." + }, + "parameters": { + "type": "object", + "title": "The values to assign to the application template parameters.", + "description": "The values to assign to the application template parameters." + } + } + } + } +} \ No newline at end of file diff --git a/schema/pool.schema.json b/schema/pool.schema.json new file mode 100644 index 0000000..5a00be4 --- /dev/null +++ b/schema/pool.schema.json @@ -0,0 +1,688 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "pool", + "description": "An Azure Batch pool", + "type": "object", + "$ref": "#/definitions/PoolAddParameter", + "definitions": { + "PoolAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the pool within the account.", + "description": "A string that uniquely identifies the pool within the account." + }, + "displayName": { + "type": "string", + "title": "The display name for the pool.", + "description": "The display name for the pool." + }, + "vmSize": { + "type": "string", + "title": "The size of virtual machines in the pool. All virtual machines in a pool are the same size.", + "description": "The size of virtual machines in the pool. All virtual machines in a pool are the same size." + }, + "cloudServiceConfiguration": { + "$ref": "#/definitions/CloudServiceConfiguration", + "title": "The cloud service configuration for the pool.", + "description": "The cloud service configuration for the pool." + }, + "virtualMachineConfiguration": { + "$ref": "#/definitions/VirtualMachineConfiguration", + "title": "The virtual machine configuration for the pool.", + "description": "The virtual machine configuration for the pool." + }, + "resizeTimeout": { + "type": "string", + "format": "duration", + "title": "The timeout for allocation of compute nodes to the pool.", + "description": "The timeout for allocation of compute nodes to the pool." + }, + "targetDedicatedNodes": { + "type": "integer", + "format": "int32", + "title": "The desired number of dedicated compute nodes in the pool.", + "description": "The desired number of dedicated compute nodes in the pool." + }, + "targetLowPriorityNodes": { + "type": "integer", + "format": "int32", + "title": "The desired number of low-priority compute nodes in the pool.", + "description": "The desired number of low-priority compute nodes in the pool." + }, + "enableAutoScale": { + "type": "boolean", + "title": "Whether the pool size should automatically adjust over time.", + "description": "Whether the pool size should automatically adjust over time." + }, + "autoScaleFormula": { + "type": "string", + "title": "A formula for the desired number of compute nodes in the pool.", + "description": "A formula for the desired number of compute nodes in the pool." + }, + "autoScaleEvaluationInterval": { + "type": "string", + "format": "duration", + "title": "The time interval at which to automatically adjust the pool size according to the autoscale formula.", + "description": "The time interval at which to automatically adjust the pool size according to the autoscale formula." + }, + "enableInterNodeCommunication": { + "type": "boolean", + "title": "Whether the pool permits direct communication between nodes.", + "description": "Whether the pool permits direct communication between nodes." + }, + "networkConfiguration": { + "$ref": "#/definitions/NetworkConfiguration", + "title": "The network configuration for the pool.", + "description": "The network configuration for the pool." + }, + "startTask": { + "$ref": "#/definitions/StartTask", + "title": "A task specified to run on each compute node as it joins the pool.", + "description": "A task specified to run on each compute node as it joins the pool." + }, + "certificateReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/CertificateReference" + }, + "title": "The list of certificates to be installed on each compute node in the pool.", + "description": "The list of certificates to be installed on each compute node in the pool." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "The list of application packages to be installed on each compute node in the pool.", + "description": "The list of application packages to be installed on each compute node in the pool." + }, + "applicationLicenses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of application licenses the Batch service will make available on each compute node in the pool.", + "description": "The list of application licenses the Batch service will make available on each compute node in the pool." + }, + "maxTasksPerNode": { + "type": "integer", + "format": "int32", + "title": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "description": "The maximum number of tasks that can run concurrently on a single compute node in the pool." + }, + "taskSchedulingPolicy": { + "$ref": "#/definitions/TaskSchedulingPolicy", + "title": "How the Batch service distributes tasks between compute nodes in the pool.", + "description": "How the Batch service distributes tasks between compute nodes in the pool." + }, + "userAccounts": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccount" + }, + "title": "The list of user accounts to be created on each node in the pool.", + "description": "The list of user accounts to be created on each node in the pool." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the pool as metadata.", + "description": "A list of name-value pairs associated with the pool as metadata." + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool.", + "description": "A collection of packages to be added from external package managers to each node in the pool." + } + }, + "required": [ + "id", + "vmSize" + ], + "title": "A pool in the Azure Batch service to add.", + "oneOf": [ + { + "required": [ + "cloudServiceConfiguration" + ] + }, + { + "required": [ + "virtualMachineConfiguration" + ] + } + ], + "dependencies": { + "autoScaleFormula": [ + "enableAutoScale" + ], + "autoScaleEvaluationInterval": [ + "enableAutoScale" + ] + } + }, + "CloudServiceConfiguration": { + "properties": { + "osFamily": { + "type": "string", + "title": "The Azure Guest OS family to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS family to be installed on the virtual machines in the pool." + }, + "targetOSVersion": { + "type": "string", + "title": "The Azure Guest OS version to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS version to be installed on the virtual machines in the pool." + }, + "currentOSVersion": { + "type": "string", + "title": "The Azure Guest OS Version currently installed on the virtual machines in the pool.", + "description": "The Azure Guest OS Version currently installed on the virtual machines in the pool." + } + }, + "required": [ + "osFamily" + ], + "title": "The configuration for nodes in a pool based on the Azure Cloud Services platform." + }, + "VirtualMachineConfiguration": { + "properties": { + "imageReference": { + "$ref": "#/definitions/ImageReference", + "title": "A reference to the Azure Virtual Machines Marketplace image to use.", + "description": "A reference to the Azure Virtual Machines Marketplace image to use." + }, + "osDisk": { + "$ref": "#/definitions/OSDisk", + "title": "A reference to the OS disk image to use.", + "description": "A reference to the OS disk image to use." + }, + "nodeAgentSKUId": { + "type": "string", + "title": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool.", + "description": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool." + }, + "windowsConfiguration": { + "$ref": "#/definitions/WindowsConfiguration", + "title": "Windows operating system settings on the virtual machine.", + "description": "Windows operating system settings on the virtual machine." + } + }, + "required": [ + "nodeAgentSKUId" + ], + "title": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "oneOf": [ + { + "required": [ + "imageReference" + ] + }, + { + "required": [ + "osDisk" + ] + } + ] + }, + "ImageReference": { + "properties": { + "publisher": { + "type": "string", + "title": "The publisher of the Azure Virtual Machines Marketplace image.", + "description": "The publisher of the Azure Virtual Machines Marketplace image." + }, + "offer": { + "type": "string", + "title": "The offer type of the Azure Virtual Machines Marketplace image.", + "description": "The offer type of the Azure Virtual Machines Marketplace image." + }, + "sku": { + "type": "string", + "title": "The SKU of the Azure Virtual Machines Marketplace image.", + "description": "The SKU of the Azure Virtual Machines Marketplace image." + }, + "version": { + "type": "string", + "title": "The version of the Azure Virtual Machines Marketplace image.", + "description": "The version of the Azure Virtual Machines Marketplace image." + } + }, + "required": [ + "publisher", + "offer", + "sku" + ], + "title": "A reference to an Azure Virtual Machines Marketplace image. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation." + }, + "OSDisk": { + "properties": { + "imageUris": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The collection of Virtual Hard Disk (VHD) URIs.", + "description": "The collection of Virtual Hard Disk (VHD) URIs." + }, + "caching": { + "type": "string", + "title": "The type of caching to enable for the OS disk.", + "description": "The type of caching to enable for the OS disk.", + "enum": [ + "none", + "readOnly", + "readWrite" + ], + "x-ms-enum": { + "name": "CachingType", + "modelAsString": false + } + } + }, + "required": [ + "imageUris" + ], + "title": "A reference to an OS disk image." + }, + "WindowsConfiguration": { + "properties": { + "enableAutomaticUpdates": { + "type": "boolean", + "title": "Whether automatic updates are enabled on the virtual machine.", + "description": "Whether automatic updates are enabled on the virtual machine." + } + }, + "title": "Windows operating system settings to apply to the virtual machine." + }, + "NetworkConfiguration": { + "properties": { + "subnetId": { + "type": "string", + "title": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "description": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "externalDocs": { + "url": "https://azure.microsoft.com/en-us/documentation/articles/role-based-access-built-in-roles/#classic-virtual-machine-contributor", + "description": "Setting up RBAC for Azure Batch VNETs" + } + } + }, + "description": "The network configuration for a pool." + }, + "StartTask": { + "properties": { + "commandLine": { + "type": "string", + "title": "The command line of the start task.", + "description": "The command line of the start task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the start task.", + "description": "A list of environment variable settings for the start task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the start task runs.", + "description": "The user identity under which the start task runs." + }, + "maxTaskRetryCount": { + "type": "integer", + "format": "int32", + "title": "The maximum number of times the task may be retried.", + "description": "The maximum number of times the task may be retried." + }, + "waitForSuccess": { + "type": "boolean", + "title": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "description": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node." + } + }, + "required": [ + "commandLine" + ], + "title": "A task which is run when a compute node joins a pool in the Azure Batch service, or when the compute node is rebooted or reimaged." + }, + "ResourceFile": { + "properties": { + "blobSource": { + "type": "string", + "title": "The URL of the file within Azure Blob Storage.", + "description": "The URL of the file within Azure Blob Storage." + }, + "filePath": { + "type": "string", + "title": "The location on the compute node to which to download the file, relative to the task's working directory.", + "description": "The location on the compute node to which to download the file, relative to the task's working directory." + }, + "fileMode": { + "type": "string", + "title": "The file permission mode attribute in octal format.", + "description": "The file permission mode attribute in octal format." + }, + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line.", + "description": "A source for files to be downloaded before running the task command line." + } + }, + "required": [], + "title": "A file to be downloaded from Azure blob storage to a compute node.", + "oneOf": [ + { + "required": [ + "source" + ] + }, + { + "required": [ + "blobSource" + ] + } + ] + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files.", + "description": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download.", + "description": "A prefix with which to filter the files to download." + } + }, + "required": [ + "fileGroup" + ] + }, + "EnvironmentSetting": { + "properties": { + "name": { + "type": "string", + "title": "The name of the environment variable.", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "title": "The value of the environment variable.", + "description": "The value of the environment variable." + } + }, + "required": [ + "name" + ], + "title": "An environment variable to be set on a task process." + }, + "UserIdentity": { + "properties": { + "username": { + "type": "string", + "x-ms-client-name": "userName", + "title": "The name of the user identity under which the task is run.", + "description": "The name of the user identity under which the task is run." + }, + "autoUser": { + "$ref": "#/definitions/AutoUserSpecification", + "title": "The auto user under which the task is run.", + "description": "The auto user under which the task is run." + } + }, + "title": "The definition of the user identity under which the task is run.", + "description": "Specify either the userName or autoUser property, but not both." + }, + "AutoUserSpecification": { + "properties": { + "scope": { + "type": "string", + "title": "The scope for the auto user", + "description": "The scope for the auto user", + "enum": [ + "task", + "pool" + ], + "x-ms-enum": { + "name": "AutoUserScope", + "modelAsString": false + } + }, + "elevationLevel": { + "title": "The elevation level of the auto user.", + "description": "The elevation level of the auto user.", + "$ref": "#/definitions/ElevationLevel" + } + }, + "title": "Specifies the parameters for the auto user that runs a task on the Batch service." + }, + "ElevationLevel": { + "type": "string", + "title": "The elevation level of the user.", + "description": "nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.", + "enum": [ + "nonAdmin", + "admin" + ], + "x-ms-enum": { + "name": "ElevationLevel", + "modelAsString": false + } + }, + "CertificateReference": { + "properties": { + "thumbprint": { + "type": "string", + "title": "The thumbprint of the certificate.", + "description": "The thumbprint of the certificate." + }, + "thumbprintAlgorithm": { + "type": "string", + "title": "The algorithm with which the thumbprint is associated. This must be sha1.", + "description": "The algorithm with which the thumbprint is associated. This must be sha1." + }, + "storeLocation": { + "type": "string", + "title": "The location of the certificate store on the compute node into which to install the certificate.", + "description": "The location of the certificate store on the compute node into which to install the certificate.", + "enum": [ + "currentUser", + "localMachine" + ], + "x-ms-enum": { + "name": "CertificateStoreLocation", + "modelAsString": false + } + }, + "storeName": { + "type": "string", + "title": "The name of the certificate store on the compute node into which to install the certificate.", + "description": "The name of the certificate store on the compute node into which to install the certificate." + }, + "visibility": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "startTask", + "task", + "remoteUser" + ], + "x-ms-enum": { + "name": "CertificateVisibility", + "modelAsString": false + } + }, + "title": "Which user accounts on the compute node should have access to the private data of the certificate.", + "description": "Which user accounts on the compute node should have access to the private data of the certificate." + } + }, + "required": [ + "thumbprint", + "thumbprintAlgorithm" + ], + "title": "A reference to a certificate to be installed on compute nodes in a pool." + }, + "ApplicationPackageReference": { + "properties": { + "applicationId": { + "type": "string", + "title": "The ID of the application to deploy.", + "description": "The ID of the application to deploy." + }, + "version": { + "type": "string", + "title": "The version of the application to deploy. If omitted, the default version is deployed.", + "description": "The version of the application to deploy. If omitted, the default version is deployed." + } + }, + "required": [ + "applicationId" + ], + "title": "A reference to an application package to be deployed to compute nodes." + }, + "TaskSchedulingPolicy": { + "properties": { + "nodeFillType": { + "type": "string", + "title": "How tasks should be distributed across compute nodes.", + "enum": [ + "spread", + "pack" + ], + "x-ms-enum": { + "name": "ComputeNodeFillType", + "modelAsString": false + }, + "description": "How tasks should be distributed across compute nodes." + } + }, + "required": [ + "nodeFillType" + ], + "title": "Specifies how tasks should be distributed across compute nodes." + }, + "UserAccount": { + "properties": { + "name": { + "type": "string", + "title": "The name of the user account.", + "description": "The name of the user account." + }, + "password": { + "type": "string", + "title": "The password for the user account.", + "description": "The password for the user account." + }, + "elevationLevel": { + "title": "The elevation level of the user account.", + "description": "The elevation level of the user account.", + "$ref": "#/definitions/ElevationLevel" + }, + "linuxUserConfiguration": { + "title": "The Linux-specific user configuration for the user account.", + "description": "The Linux-specific user configuration for the user account.", + "$ref": "#/definitions/LinuxUserConfiguration" + } + }, + "required": [ + "name", + "password" + ], + "title": "Properties used to create a user used to execute tasks on an Azure Batch node." + }, + "LinuxUserConfiguration": { + "properties": { + "uid": { + "type": "integer", + "format": "int32", + "title": "The user ID of the user account.", + "description": "The user ID of the user account." + }, + "gid": { + "type": "integer", + "format": "int32", + "title": "The group ID for the user account.", + "description": "The group ID for the user account." + }, + "sshPrivateKey": { + "type": "string", + "title": "The SSH private key for the user account.", + "description": "The SSH private key for the user account." + } + }, + "title": "Properties used to create a user account on a Linux node." + }, + "MetadataItem": { + "properties": { + "name": { + "type": "string", + "title": "The name of the metadata item.", + "description": "The name of the metadata item." + }, + "value": { + "type": "string", + "title": "The value of the metadata item.", + "description": "The value of the metadata item." + } + }, + "required": [ + "name", + "value" + ], + "title": "A name-value pair associated with a Batch service resource.", + "description": "The Batch service does not assign any meaning to this metadata; it is solely for the use of user code." + }, + "PackageReference": { + "properties": { + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage", + "description": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository.", + "description": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed.", + "description": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "type": "boolean", + "title": "Whether Chocolatey will install packages without a checksum for validation.", + "description": "Whether Chocolatey will install packages without a checksum for validation." + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages).", + "description": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": [ + "type", + "id" + ] + } + } +} \ No newline at end of file diff --git a/schema/pooltemplate.schema.json b/schema/pooltemplate.schema.json new file mode 100644 index 0000000..510b7e2 --- /dev/null +++ b/schema/pooltemplate.schema.json @@ -0,0 +1,893 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "pooltemplate", + "description": "An Azure Batch pool template", + "type": "object", + "$ref": "#/definitions/PoolTemplate", + "definitions": { + "PoolTemplate": { + "properties": { + "parameters": { + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/BatchTemplateParameter" + }, + "title": "The parameters whose values may be supplied each time the template is used.", + "description": "The parameters whose values may be supplied each time the template is used." + }, + "pool": { + "type": "object", + "$ref": "#/definitions/PoolTemplatePool", + "title": "The resource to be created from the template.", + "description": "The resource to be created from the template." + } + }, + "required": [ + "pool" + ], + "title": "An Azure Batch pool template." + }, + "BatchTemplateParameter": { + "properties": { + "type": { + "type": "string", + "enum": [ + "int", + "string", + "bool" + ], + "title": "The data type of the parameter.", + "description": "The data type of the parameter." + }, + "defaultValue": { + "title": "The default value of the parameter.", + "description": "The default value of the parameter." + }, + "allowedValues": { + "type": "array", + "title": "The allowed values of the parameter.", + "description": "The allowed values of the parameter." + }, + "minValue": { + "type": "integer", + "title": "The minimum value of the parameter.", + "description": "The minimum value of the parameter." + }, + "maxValue": { + "type": "integer", + "title": "The maximum value of the parameter.", + "description": "The maximum value of the parameter." + }, + "minLength": { + "type": "integer", + "title": "The minimum length of the parameter value.", + "description": "The minimum length of the parameter value." + }, + "maxLength": { + "type": "integer", + "title": "The maximum length of the parameter value.", + "description": "The maximum length of the parameter value." + }, + "metadata": { + "type": "object", + "$ref": "#/definitions/BatchTemplateParameterMetadata", + "title": "Additional data about the parameter.", + "description": "Additional data about the parameter." + } + }, + "required": [ + "type" + ] + }, + "BatchTemplateParameterMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A description of the parameter, suitable for display in a user interface.", + "description": "A description of the parameter, suitable for display in a user interface." + } + }, + "title": "Additional data about an Azure Batch template parameter." + }, + "PoolTemplatePool": { + "properties": { + "type": { + "type": "string", + "title": "The type of Azure Batch resource to create. Must be 'Microsoft.Batch/batchAccounts/pools'.", + "enum": [ + "Microsoft.Batch/batchAccounts/pools" + ], + "description": "The type of Azure Batch resource to create. Must be 'Microsoft.Batch/batchAccounts/pools'." + }, + "apiVersion": { + "type": "string", + "title": "The Azure Batch API version against which the template is written. Must be '2017-05-01.5.0'.", + "enum": [ + "2017-05-01.5.0" + ], + "description": "The Azure Batch API version against which the template is written. Must be '2017-05-01.5.0'." + }, + "properties": { + "type": "object", + "$ref": "#/definitions/PoolAddParameter", + "title": "The pool to be created from the template.", + "description": "The pool to be created from the template." + } + }, + "required": [ + "type", + "apiVersion", + "properties" + ], + "title": "The resource to be created from an Azure Batch template." + }, + "PoolAddParameter": { + "properties": { + "id": { + "type": "string", + "title": "A string that uniquely identifies the pool within the account.", + "description": "A string that uniquely identifies the pool within the account." + }, + "displayName": { + "type": "string", + "title": "The display name for the pool.", + "description": "The display name for the pool." + }, + "vmSize": { + "type": "string", + "title": "The size of virtual machines in the pool. All virtual machines in a pool are the same size.", + "description": "The size of virtual machines in the pool. All virtual machines in a pool are the same size." + }, + "cloudServiceConfiguration": { + "$ref": "#/definitions/CloudServiceConfiguration", + "title": "The cloud service configuration for the pool.", + "description": "The cloud service configuration for the pool." + }, + "virtualMachineConfiguration": { + "$ref": "#/definitions/VirtualMachineConfiguration", + "title": "The virtual machine configuration for the pool.", + "description": "The virtual machine configuration for the pool." + }, + "resizeTimeout": { + "type": "string", + "format": "duration", + "title": "The timeout for allocation of compute nodes to the pool.", + "description": "The timeout for allocation of compute nodes to the pool." + }, + "targetDedicatedNodes": { + "format": "int32", + "title": "The desired number of dedicated compute nodes in the pool.", + "description": "The desired number of dedicated compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "targetLowPriorityNodes": { + "format": "int32", + "title": "The desired number of low-priority compute nodes in the pool.", + "description": "The desired number of low-priority compute nodes in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "enableAutoScale": { + "title": "Whether the pool size should automatically adjust over time.", + "description": "Whether the pool size should automatically adjust over time.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "autoScaleFormula": { + "type": "string", + "title": "A formula for the desired number of compute nodes in the pool.", + "description": "A formula for the desired number of compute nodes in the pool." + }, + "autoScaleEvaluationInterval": { + "type": "string", + "format": "duration", + "title": "The time interval at which to automatically adjust the pool size according to the autoscale formula.", + "description": "The time interval at which to automatically adjust the pool size according to the autoscale formula." + }, + "enableInterNodeCommunication": { + "title": "Whether the pool permits direct communication between nodes.", + "description": "Whether the pool permits direct communication between nodes.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "networkConfiguration": { + "$ref": "#/definitions/NetworkConfiguration", + "title": "The network configuration for the pool.", + "description": "The network configuration for the pool." + }, + "startTask": { + "$ref": "#/definitions/StartTask", + "title": "A task specified to run on each compute node as it joins the pool.", + "description": "A task specified to run on each compute node as it joins the pool." + }, + "certificateReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/CertificateReference" + }, + "title": "The list of certificates to be installed on each compute node in the pool.", + "description": "The list of certificates to be installed on each compute node in the pool." + }, + "applicationPackageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/ApplicationPackageReference" + }, + "title": "The list of application packages to be installed on each compute node in the pool.", + "description": "The list of application packages to be installed on each compute node in the pool." + }, + "applicationLicenses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The list of application licenses the Batch service will make available on each compute node in the pool.", + "description": "The list of application licenses the Batch service will make available on each compute node in the pool." + }, + "maxTasksPerNode": { + "format": "int32", + "title": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "description": "The maximum number of tasks that can run concurrently on a single compute node in the pool.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "taskSchedulingPolicy": { + "$ref": "#/definitions/TaskSchedulingPolicy", + "title": "How the Batch service distributes tasks between compute nodes in the pool.", + "description": "How the Batch service distributes tasks between compute nodes in the pool." + }, + "userAccounts": { + "type": "array", + "items": { + "$ref": "#/definitions/UserAccount" + }, + "title": "The list of user accounts to be created on each node in the pool.", + "description": "The list of user accounts to be created on each node in the pool." + }, + "metadata": { + "type": "array", + "items": { + "$ref": "#/definitions/MetadataItem" + }, + "title": "A list of name-value pairs associated with the pool as metadata.", + "description": "A list of name-value pairs associated with the pool as metadata." + }, + "packageReferences": { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool.", + "description": "A collection of packages to be added from external package managers to each node in the pool." + } + }, + "required": [ + "id", + "vmSize" + ], + "title": "A pool in the Azure Batch service to add.", + "oneOf": [ + { + "required": [ + "cloudServiceConfiguration" + ] + }, + { + "required": [ + "virtualMachineConfiguration" + ] + } + ], + "dependencies": { + "autoScaleFormula": [ + "enableAutoScale" + ], + "autoScaleEvaluationInterval": [ + "enableAutoScale" + ] + } + }, + "CloudServiceConfiguration": { + "properties": { + "osFamily": { + "type": "string", + "title": "The Azure Guest OS family to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS family to be installed on the virtual machines in the pool." + }, + "targetOSVersion": { + "type": "string", + "title": "The Azure Guest OS version to be installed on the virtual machines in the pool.", + "description": "The Azure Guest OS version to be installed on the virtual machines in the pool." + }, + "currentOSVersion": { + "type": "string", + "title": "The Azure Guest OS Version currently installed on the virtual machines in the pool.", + "description": "The Azure Guest OS Version currently installed on the virtual machines in the pool." + } + }, + "required": [ + "osFamily" + ], + "title": "The configuration for nodes in a pool based on the Azure Cloud Services platform." + }, + "VirtualMachineConfiguration": { + "properties": { + "imageReference": { + "$ref": "#/definitions/ImageReference", + "title": "A reference to the Azure Virtual Machines Marketplace image to use.", + "description": "A reference to the Azure Virtual Machines Marketplace image to use." + }, + "osDisk": { + "$ref": "#/definitions/OSDisk", + "title": "A reference to the OS disk image to use.", + "description": "A reference to the OS disk image to use." + }, + "nodeAgentSKUId": { + "type": "string", + "title": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool.", + "description": "The SKU of the Batch node agent to be provisioned on compute nodes in the pool." + }, + "windowsConfiguration": { + "$ref": "#/definitions/WindowsConfiguration", + "title": "Windows operating system settings on the virtual machine.", + "description": "Windows operating system settings on the virtual machine." + } + }, + "required": [ + "nodeAgentSKUId" + ], + "title": "The configuration for compute nodes in a pool based on the Azure Virtual Machines infrastructure.", + "oneOf": [ + { + "required": [ + "imageReference" + ] + }, + { + "required": [ + "osDisk" + ] + } + ] + }, + "ImageReference": { + "properties": { + "publisher": { + "type": "string", + "title": "The publisher of the Azure Virtual Machines Marketplace image.", + "description": "The publisher of the Azure Virtual Machines Marketplace image." + }, + "offer": { + "type": "string", + "title": "The offer type of the Azure Virtual Machines Marketplace image.", + "description": "The offer type of the Azure Virtual Machines Marketplace image." + }, + "sku": { + "type": "string", + "title": "The SKU of the Azure Virtual Machines Marketplace image.", + "description": "The SKU of the Azure Virtual Machines Marketplace image." + }, + "version": { + "type": "string", + "title": "The version of the Azure Virtual Machines Marketplace image.", + "description": "The version of the Azure Virtual Machines Marketplace image." + } + }, + "required": [ + "publisher", + "offer", + "sku" + ], + "title": "A reference to an Azure Virtual Machines Marketplace image. To get the list of all imageReferences verified by Azure Batch, see the 'List supported node agent SKUs' operation." + }, + "OSDisk": { + "properties": { + "imageUris": { + "type": "array", + "items": { + "type": "string" + }, + "title": "The collection of Virtual Hard Disk (VHD) URIs.", + "description": "The collection of Virtual Hard Disk (VHD) URIs." + }, + "caching": { + "type": "string", + "title": "The type of caching to enable for the OS disk.", + "description": "The type of caching to enable for the OS disk.", + "enum": [ + "none", + "readOnly", + "readWrite" + ], + "x-ms-enum": { + "name": "CachingType", + "modelAsString": false + } + } + }, + "required": [ + "imageUris" + ], + "title": "A reference to an OS disk image." + }, + "WindowsConfiguration": { + "properties": { + "enableAutomaticUpdates": { + "title": "Whether automatic updates are enabled on the virtual machine.", + "description": "Whether automatic updates are enabled on the virtual machine.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "title": "Windows operating system settings to apply to the virtual machine." + }, + "NetworkConfiguration": { + "properties": { + "subnetId": { + "type": "string", + "title": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "description": "The ARM resource identifier of the virtual network subnet which the compute nodes of the pool will join. This is of the form /subscriptions/{subscription}/resourceGroups/{group}/providers/{provider}/virtualNetworks/{network}/subnets/{subnet}.", + "externalDocs": { + "url": "https://azure.microsoft.com/en-us/documentation/articles/role-based-access-built-in-roles/#classic-virtual-machine-contributor", + "description": "Setting up RBAC for Azure Batch VNETs" + } + } + }, + "description": "The network configuration for a pool." + }, + "StartTask": { + "properties": { + "commandLine": { + "type": "string", + "title": "The command line of the start task.", + "description": "The command line of the start task." + }, + "resourceFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/ResourceFile" + }, + "title": "A list of files that the Batch service will download to the compute node before running the command line.", + "description": "A list of files that the Batch service will download to the compute node before running the command line." + }, + "environmentSettings": { + "type": "array", + "items": { + "$ref": "#/definitions/EnvironmentSetting" + }, + "title": "A list of environment variable settings for the start task.", + "description": "A list of environment variable settings for the start task." + }, + "userIdentity": { + "$ref": "#/definitions/UserIdentity", + "title": "The user identity under which the start task runs.", + "description": "The user identity under which the start task runs." + }, + "maxTaskRetryCount": { + "format": "int32", + "title": "The maximum number of times the task may be retried.", + "description": "The maximum number of times the task may be retried.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "waitForSuccess": { + "title": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "description": "Whether the Batch service should wait for the start task to complete successfully (that is, to exit with exit code 0) before scheduling any tasks on the compute node.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + } + }, + "required": [ + "commandLine" + ], + "title": "A task which is run when a compute node joins a pool in the Azure Batch service, or when the compute node is rebooted or reimaged." + }, + "ResourceFile": { + "properties": { + "blobSource": { + "type": "string", + "title": "The URL of the file within Azure Blob Storage.", + "description": "The URL of the file within Azure Blob Storage." + }, + "filePath": { + "type": "string", + "title": "The location on the compute node to which to download the file, relative to the task's working directory.", + "description": "The location on the compute node to which to download the file, relative to the task's working directory." + }, + "fileMode": { + "type": "string", + "title": "The file permission mode attribute in octal format.", + "description": "The file permission mode attribute in octal format." + }, + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line.", + "description": "A source for files to be downloaded before running the task command line." + } + }, + "required": [], + "title": "A file to be downloaded from Azure blob storage to a compute node.", + "oneOf": [ + { + "required": [ + "source" + ] + }, + { + "required": [ + "blobSource" + ] + } + ] + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files.", + "description": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download.", + "description": "A prefix with which to filter the files to download." + } + }, + "required": [ + "fileGroup" + ] + }, + "EnvironmentSetting": { + "properties": { + "name": { + "type": "string", + "title": "The name of the environment variable.", + "description": "The name of the environment variable." + }, + "value": { + "type": "string", + "title": "The value of the environment variable.", + "description": "The value of the environment variable." + } + }, + "required": [ + "name" + ], + "title": "An environment variable to be set on a task process." + }, + "UserIdentity": { + "properties": { + "username": { + "type": "string", + "x-ms-client-name": "userName", + "title": "The name of the user identity under which the task is run.", + "description": "The name of the user identity under which the task is run." + }, + "autoUser": { + "$ref": "#/definitions/AutoUserSpecification", + "title": "The auto user under which the task is run.", + "description": "The auto user under which the task is run." + } + }, + "title": "The definition of the user identity under which the task is run.", + "description": "Specify either the userName or autoUser property, but not both." + }, + "AutoUserSpecification": { + "properties": { + "scope": { + "type": "string", + "title": "The scope for the auto user", + "description": "The scope for the auto user", + "enum": [ + "task", + "pool" + ], + "x-ms-enum": { + "name": "AutoUserScope", + "modelAsString": false + } + }, + "elevationLevel": { + "title": "The elevation level of the auto user.", + "description": "The elevation level of the auto user.", + "$ref": "#/definitions/ElevationLevel" + } + }, + "title": "Specifies the parameters for the auto user that runs a task on the Batch service." + }, + "ElevationLevel": { + "type": "string", + "title": "The elevation level of the user.", + "description": "nonAdmin - The user is a standard user without elevated access. admin - The user is a user with elevated access and operates with full Administrator permissions.", + "enum": [ + "nonAdmin", + "admin" + ], + "x-ms-enum": { + "name": "ElevationLevel", + "modelAsString": false + } + }, + "CertificateReference": { + "properties": { + "thumbprint": { + "type": "string", + "title": "The thumbprint of the certificate.", + "description": "The thumbprint of the certificate." + }, + "thumbprintAlgorithm": { + "type": "string", + "title": "The algorithm with which the thumbprint is associated. This must be sha1.", + "description": "The algorithm with which the thumbprint is associated. This must be sha1." + }, + "storeLocation": { + "type": "string", + "title": "The location of the certificate store on the compute node into which to install the certificate.", + "description": "The location of the certificate store on the compute node into which to install the certificate.", + "enum": [ + "currentUser", + "localMachine" + ], + "x-ms-enum": { + "name": "CertificateStoreLocation", + "modelAsString": false + } + }, + "storeName": { + "type": "string", + "title": "The name of the certificate store on the compute node into which to install the certificate.", + "description": "The name of the certificate store on the compute node into which to install the certificate." + }, + "visibility": { + "type": "array", + "items": { + "type": "string", + "x-nullable": false, + "enum": [ + "startTask", + "task", + "remoteUser" + ], + "x-ms-enum": { + "name": "CertificateVisibility", + "modelAsString": false + } + }, + "title": "Which user accounts on the compute node should have access to the private data of the certificate.", + "description": "Which user accounts on the compute node should have access to the private data of the certificate." + } + }, + "required": [ + "thumbprint", + "thumbprintAlgorithm" + ], + "title": "A reference to a certificate to be installed on compute nodes in a pool." + }, + "ApplicationPackageReference": { + "properties": { + "applicationId": { + "type": "string", + "title": "The ID of the application to deploy.", + "description": "The ID of the application to deploy." + }, + "version": { + "type": "string", + "title": "The version of the application to deploy. If omitted, the default version is deployed.", + "description": "The version of the application to deploy. If omitted, the default version is deployed." + } + }, + "required": [ + "applicationId" + ], + "title": "A reference to an application package to be deployed to compute nodes." + }, + "TaskSchedulingPolicy": { + "properties": { + "nodeFillType": { + "type": "string", + "title": "How tasks should be distributed across compute nodes.", + "enum": [ + "spread", + "pack" + ], + "x-ms-enum": { + "name": "ComputeNodeFillType", + "modelAsString": false + }, + "description": "How tasks should be distributed across compute nodes." + } + }, + "required": [ + "nodeFillType" + ], + "title": "Specifies how tasks should be distributed across compute nodes." + }, + "UserAccount": { + "properties": { + "name": { + "type": "string", + "title": "The name of the user account.", + "description": "The name of the user account." + }, + "password": { + "type": "string", + "title": "The password for the user account.", + "description": "The password for the user account." + }, + "elevationLevel": { + "title": "The elevation level of the user account.", + "description": "The elevation level of the user account.", + "$ref": "#/definitions/ElevationLevel" + }, + "linuxUserConfiguration": { + "title": "The Linux-specific user configuration for the user account.", + "description": "The Linux-specific user configuration for the user account.", + "$ref": "#/definitions/LinuxUserConfiguration" + } + }, + "required": [ + "name", + "password" + ], + "title": "Properties used to create a user used to execute tasks on an Azure Batch node." + }, + "LinuxUserConfiguration": { + "properties": { + "uid": { + "format": "int32", + "title": "The user ID of the user account.", + "description": "The user ID of the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "gid": { + "format": "int32", + "title": "The group ID for the user account.", + "description": "The group ID for the user account.", + "anyOf": [ + { + "type": "integer" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "sshPrivateKey": { + "type": "string", + "title": "The SSH private key for the user account.", + "description": "The SSH private key for the user account." + } + }, + "title": "Properties used to create a user account on a Linux node." + }, + "MetadataItem": { + "properties": { + "name": { + "type": "string", + "title": "The name of the metadata item.", + "description": "The name of the metadata item." + }, + "value": { + "type": "string", + "title": "The value of the metadata item.", + "description": "The value of the metadata item." + } + }, + "required": [ + "name", + "value" + ], + "title": "A name-value pair associated with a Batch service resource.", + "description": "The Batch service does not assign any meaning to this metadata; it is solely for the use of user code." + }, + "PackageReference": { + "properties": { + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage", + "description": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository.", + "description": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed.", + "description": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "title": "Whether Chocolatey will install packages without a checksum for validation.", + "description": "Whether Chocolatey will install packages without a checksum for validation.", + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "\\[parameters\\('\\w+'\\)\\]" + } + ] + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages).", + "description": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": [ + "type", + "id" + ] + } + } +} \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 0e837bd..4938da8 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -395,7 +395,7 @@ function getParameterTypeName(value : any) : string { async function viewnodeGet(node : azurebatchtree.AzureBatchTreeNode) { if (!node) { // TODO: handle this more politely - vscode.window.showErrorMessage("This command may be used only from the Azure Batch explorer.") + vscode.window.showErrorMessage("This command may be used only from the Azure Batch explorer."); return; } if (azurebatchtree.isResourceNode(node)) { @@ -407,7 +407,7 @@ async function viewnodeGet(node : azurebatchtree.AzureBatchTreeNode) { async function viewnodeGetAsTemplate(node : azurebatchtree.AzureBatchTreeNode) { if (!node) { // TODO: handle this more politely - vscode.window.showErrorMessage("This command may be used only from the Azure Batch explorer.") + vscode.window.showErrorMessage("This command may be used only from the Azure Batch explorer."); return; } if (azurebatchtree.isResourceNode(node)) { diff --git a/tools/applicationtemplate.schematemplate.json b/tools/applicationtemplate.schematemplate.json new file mode 100644 index 0000000..ec281ac --- /dev/null +++ b/tools/applicationtemplate.schematemplate.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "applicationtemplate", + "description": "An Azure Batch application template", + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplate", + "definitions": { + "BatchApplicationTemplate": { + "properties": { + "templateMetadata": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateMetadata", + "title": "Additional information about the template itself." + }, + "parameters": { + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateParameter" + }, + "title": "The parameters whose values may be supplied each time the template is used." + } + } + }, + "BatchApplicationTemplateMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A simple description of the functionality provided by the template." + }, + "author": { + "type": "string", + "title": "The name or email address of the template author." + }, + "dateUpdated": { + "type": "string", + "title": "A human readable message (a date or a version number) for when the template was last modified." + } + } + }, + "BatchApplicationTemplateParameter": { + "properties": { + "type": { + "type": "string", + "enum": [ "int", "string", "bool" ], + "title": "The data type of the parameter." + }, + "defaultValue": { + "title": "The default value of the parameter." + }, + "metadata": { + "type": "object", + "$ref": "#/definitions/BatchApplicationTemplateParameterMetadata", + "title": "Additional data about the parameter." + } + }, + "required": ["type"] + }, + "BatchApplicationTemplateParameterMetadata": { + "properties": { + "description": { + "type": "string", + "title": "A description of the parameter, suitable for display in a user interface." + } + }, + "title": "Additional data about an Azure Batch template parameter." + } + } +} \ No newline at end of file diff --git a/tools/extensions.schema.json b/tools/extensions.schema.json new file mode 100644 index 0000000..ab3ad2b --- /dev/null +++ b/tools/extensions.schema.json @@ -0,0 +1,196 @@ +{ + "JobAddParameter": { + "properties": { + "taskFactory" : { + "type": "object", + "title": "A specification for the tasks to be added to the job.", + "$ref": "#/definitions/TaskFactory" + }, + "applicationTemplateInfo" : { + "type": "object", + "title": "An application template from which to create the job.", + "$ref": "#/definitions/ApplicationTemplateInfo" + } + + } + }, + "PoolAddParameter": { + "properties": { + "packageReferences" : { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool." + } + } + }, + "PoolSpecification": { + "properties": { + "packageReferences" : { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages to be added from external package managers to each node in the pool." + } + } + }, + "TaskAddParameter": { + "properties": { + "packageReferences" : { + "type": "array", + "items": { + "$ref": "#/definitions/PackageReference" + }, + "title": "A collection of packages from external package managers to be added to the node where the task runs." + } + } + }, + "OutputFileDestination": { + "properties": { + "autoStorage": { + "type": "object", + "$ref": "#/definitions/OutputFileAutoStorageDestination", + "title": "A destination in the linked storage account to which to persist output files." + } + } + }, + "PackageReference": { + "properties":{ + "type": { + "type": "string", + "title": "The type of package - aptPackage, chocolateyPackage, or yumPackage" + }, + "id": { + "type": "string", + "title": "The name or ID of the package to be installed as identified according to the package repository." + }, + "version": { + "type": "string", + "title": "The version of the package to be installed." + }, + "allowEmptyChecksums": { + "type": "boolean", + "title": "Whether Chocolatey will install packages without a checksum for validation." + }, + "disableExcludes": { + "type": "string", + "title": "Packages that might otherwise be excluded by VM configuration (e.g. kernel packages)." + } + }, + "required": ["type", "id"] + }, + "TaskFactory": { + "properties":{ + "type": { + "type": "string", + "title": "The type of task factory - taskCollection, parametricSweep or taskPerFile" + }, + "tasks": { + "type": "array", + "items": { + "$ref": "#/definitions/TaskAddParameter" + }, + "title": "The tasks that make up the job." + }, + "parameterSets": { + "type": "array", + "items": { + "$ref": "#/definitions/ParametricSweepParameterSet" + }, + "title": "The parameter or parameters whose values will be varied over the parametric sweep." + }, + "repeatTask": { + "type": "object", + "$ref": "#/definitions/RepeatTask", + "title": "The task that is to be repeated for each value." + }, + "source": { + "type": "object", + "$ref": "#/definitions/TaskPerFileSource", + "title": "The source of the files for which to create tasks." + } + } + }, + "ParametricSweepParameterSet": { + "properties": { + "start": { + "type": "integer", + "title": "The start of the parametric sweep range." + }, + "end": { + "type": "integer", + "title": "The end of the parametric sweep range." + }, + "step": { + "type": "integer", + "title": "The increment step between values of the parameter." + } + }, + "required": ["start", "end"] + }, + "TaskPerFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to take files." + }, + "containerUrl": { + "type": "string", + "title": "The URL of an Azure Storage blob container from which to take files, including any required Shared Access Signature (SAS)." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files from which to create tasks." + } + } + }, + "ApplicationTemplateInfo": { + "properties":{ + "filePath": { + "type": "string", + "title": "The path to the application template file." + }, + "parameters": { + "type": "object", + "title": "The values to assign to the application template parameters." + } + } + }, + "ResourceFile": { + "properties": { + "source": { + "type": "object", + "$ref": "#/definitions/ResourceFileSource", + "title": "A source for files to be downloaded before running the task command line." + } + } + }, + "ResourceFileSource": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account from which to download files." + }, + "prefix": { + "type": "string", + "title": "A prefix with which to filter the files to download." + } + }, + "required": ["fileGroup"] + }, + "OutputFileAutoStorageDestination": { + "properties": { + "fileGroup": { + "type": "string", + "title": "The file group in the linked storage account to which to save files." + }, + "path": { + "type": "string", + "title": "The path within the file group to which output files will be uploaded." + } + }, + "required": ["fileGroup"] + } +} diff --git a/tools/swaggatron.ts b/tools/swaggatron.ts new file mode 100644 index 0000000..90d52d4 --- /dev/null +++ b/tools/swaggatron.ts @@ -0,0 +1,439 @@ +import * as https from 'https'; +import * as http from 'http'; +import * as batch from '../src/batch'; +import * as path from 'path'; +import * as fs from 'fs'; + +writeResourceSchemas().then(() => {console.log('done');}); + +const implicitExtensionTypes = [ + { + "name": "RepeatTask", + "basedOn": "TaskAddParameter", + "removing": ["id", "dependsOn"] + } +]; + +// Additional JSON Schema elements to be merged with the specified definitions - +// refer to JSON Schema documentation for semantics. These capture information which +// is only in documentation in the Swagger spec. +const enrichments : any = { + PoolInformation: { + oneOf: [ + { required: ["poolId"] }, + { required: ["autoPoolSpecification"] } + ] + }, + PoolAddParameter: { + oneOf: [ + { required: ["cloudServiceConfiguration"] }, + { required: ["virtualMachineConfiguration"] } + // TODO: is there a nice way in JSON Schema to express independent oneOfs (specifically for targetDedicated and autoScaleFormula independently of the CSC/VMC alternate) + ], + dependencies: { + autoScaleFormula: ["enableAutoScale"], + autoScaleEvaluationInterval: ["enableAutoScale"] + // TODO: would like to express e.g. "ASF depends on EAS being present **and true**" - JSON Schema may be able to do this but the VS Code validator doesn't seem to handle it yet + } + }, + PoolSpecification: { + oneOf: [ + { required: ["cloudServiceConfiguration"] }, + { required: ["virtualMachineConfiguration"] } + // TODO: is there a nice way in JSON Schema to express independent oneOfs (specifically for targetDedicated and autoScaleFormula independently of the CSC/VMC alternate) + ], + dependencies: { + autoScaleFormula: ["enableAutoScale"], + autoScaleEvaluationInterval: ["enableAutoScale"] + } + }, + VirtualMachineConfiguration: { + oneOf: [ + { required: ["imageReference"] }, + { required: ["osDisk"] } + ] + }, + ResourceFile: { + oneOf: [ + { required: ["source"] }, + { required: ["blobSource"] } + ], + required: [] + } +}; + +async function writeResourceSchemas() { + await writeResourceSchema('job'); + await writeResourceSchema('pool'); + await writeTemplateSchema('job'); + await writeTemplateSchema('pool'); + await writeApplicationTemplateSchema(); +} + +async function writeResourceSchema(resourceType : batch.BatchResourceType) : Promise { + const schema = await createResourceSchema(resourceType); + const schemaText = JSON.stringify(schema, null, 2); + const schemaFilePath = path.join(__dirname, `../../schema/${resourceType}.schema.json`); + fs.writeFileSync(schemaFilePath, schemaText); +} + +async function writeTemplateSchema(resourceType: batch.BatchResourceType) : Promise { + const schema = await createTemplateSchema(resourceType); + const schemaText = JSON.stringify(schema, null, 2); + const schemaFilePath = path.join(__dirname, `../../schema/${resourceType}template.schema.json`); + fs.writeFileSync(schemaFilePath, schemaText); +} + +const applicationTemplateableProperties = [ + "jobManagerTask", + "jobPreparationTask", + "jobReleaseTask", + "commonEnvironmentSettings", + "usesTaskDependencies", + "onAllTasksComplete", + "onTaskFailure", + "taskFactory", + "metadata" +]; + +async function writeApplicationTemplateSchema() : Promise { + const schema = await createApplicationTemplateSchema(); + const schemaText = JSON.stringify(schema, null, 2); + const schemaFilePath = path.join(__dirname, `../../schema/applicationtemplate.schema.json`); + fs.writeFileSync(schemaFilePath, schemaText); +} + +async function createApplicationTemplateSchema() : Promise { + const appTemplateSchemaTemplatePath = path.join(__dirname, "../../tools/applicationtemplate.schematemplate.json"); + let appTemplateSchema : any = JSON.parse(fs.readFileSync(appTemplateSchemaTemplatePath, 'utf8')); + fixAllDefinitionsSoTitlesShowInJsonValidation(appTemplateSchema); + const jobSchema = await createResourceSchema('job'); + addParameterSupport(jobSchema.definitions); + for (const d in jobSchema.definitions) { + appTemplateSchema.definitions[d] = jobSchema.definitions[d]; + } + const jobResourceSchema = jobSchema.definitions['JobAddParameter']; + for (const p in jobResourceSchema.properties) { + if (applicationTemplateableProperties.indexOf(p) >= 0) { + appTemplateSchema.definitions['BatchApplicationTemplate'].properties[p] = jobResourceSchema.properties[p]; + } + } + return appTemplateSchema; +} + +async function createResourceSchema(resourceType : batch.BatchResourceType) : Promise { + let schemaDefinitions : any = {}; + const swagger = await fetchSwagger(); + extendSchemaForBatchExtensions(swagger.definitions); + const addResourceOperation = swagger.paths[resourcePath(resourceType)].post; + const addResourceBodySchemaRef : string = addResourceOperation.parameters.find((p: any) => p.in === 'body').schema['$ref']; + + const bodySchema = chaseRef(swagger, addResourceBodySchemaRef); + + schemaDefinitions[bodySchema.name] = bodySchema.schema; + fixSchemaSoTitlesShowInJsonValidation(schemaDefinitions[bodySchema.name]); + + recursivelyAddDefns(swagger, bodySchema.schema, schemaDefinitions); + + enrichSchema(schemaDefinitions); // do this here to save us having to deal with oneOf etc. in the recursive addition process + + const schema : any = { + '$schema': 'http://json-schema.org/draft-04/schema#', + title: resourceType, + description: `An Azure Batch ${resourceType}`, + type: 'object', + '$ref': `#/definitions/${bodySchema.name}`, + definitions: schemaDefinitions + }; + + return schema; +} + +// NOTE: VS Code JSON validation has a bug where it shows description rather than title +// in intellisense. We could write the template schema template to return descriptions, +// but in order to keep it 'correct' we return titles and fix them up in the same way +// as we fix up the definitions that we source from Swagger. +function templateSchemaTemplate(resourceType: batch.BatchResourceType) : any { + const pascalCased = resourceType[0].toUpperCase() + resourceType.substring(1); + return { + '$schema': 'http://json-schema.org/draft-04/schema#', + title: `${resourceType}template`, + description: `An Azure Batch ${resourceType} template`, + type: "object", + '$ref': `#/definitions/${pascalCased}Template`, + definitions: { + [`${pascalCased}Template`]: { + properties: { + parameters: { + type: "object", + additionalProperties: { + type: "object", + "$ref": "#/definitions/BatchTemplateParameter" + }, + title: "The parameters whose values may be supplied each time the template is used." + }, + [resourceType]: { + type: "object", + "$ref": `#/definitions/${pascalCased}Template${pascalCased}`, + title: `The resource to be created from the template.` + } + }, + required: [resourceType], + title: `An Azure Batch ${resourceType} template.` + }, + BatchTemplateParameter: { + properties: { + type: { + type: "string", + enum: [ "int", "string", "bool" ], + title: "The data type of the parameter." + }, + defaultValue: { + title: "The default value of the parameter." + }, + allowedValues: { + type: "array", + title: "The allowed values of the parameter." + }, + minValue: { + type: "integer", + title: "The minimum value of the parameter." + }, + maxValue: { + type: "integer", + title: "The maximum value of the parameter." + }, + minLength: { + type: "integer", + title: "The minimum length of the parameter value." + }, + maxLength: { + type: "integer", + title: "The maximum length of the parameter value." + }, + metadata: { + type: "object", + "$ref": "#/definitions/BatchTemplateParameterMetadata", + title: "Additional data about the parameter." + } + }, + required: ["type"] + }, + BatchTemplateParameterMetadata: { + properties: { + description: { + type: "string", + title: "A description of the parameter, suitable for display in a user interface." + } + }, + title: "Additional data about an Azure Batch template parameter." + }, + [`${pascalCased}Template${pascalCased}`]: { + properties: { + type: { + type: "string", + title: `The type of Azure Batch resource to create. Must be '${templateResourceType(resourceType)}'.`, + enum: [templateResourceType(resourceType)] // const not yet supported in VS Code + }, + apiVersion: { + type: "string", + title: "The Azure Batch API version against which the template is written. Must be '2017-05-01.5.0'.", + enum: ["2017-05-01.5.0"] // const not yet supported in VS Code + }, + properties: { + type: "object", + "$ref": `#/definitions/${pascalCased}AddParameter`, // except any property can also be a string because substitution - handled by the addParameterSupport transformation + title: `The ${resourceType} to be created from the template.` + } + }, + required: [ "type", "apiVersion", "properties" ], + title: "The resource to be created from an Azure Batch template." + } + } + }; +} + +async function createTemplateSchema(resourceType: batch.BatchResourceType) : Promise { + const resourceSchema = await createResourceSchema(resourceType); + addParameterSupport(resourceSchema.definitions); + let templateSchema : any = templateSchemaTemplate(resourceType); + fixAllDefinitionsSoTitlesShowInJsonValidation(templateSchema); // Rather than compromise our template schema to deal with the VS Code title bug, we fix it up here + Object.assign(templateSchema.definitions, resourceSchema.definitions); + return templateSchema; +} + +function addParameterSupport(definitions : any) : void { + // so the idea is we go through all the properties + // and change them all from type: X to anyOf: [ { type: X }, { type: string, pattern: param_regex } ] + for (let d in definitions) { + for (let pn in definitions[d].properties) { + let p = definitions[d].properties[pn]; + const type = p.type; + if (type === "integer" || type === "boolean") { + p.anyOf = [ + { type: type }, + { type: "string", pattern: "\\[parameters\\('\\w+'\\)\\]" } + ]; + delete p.type; + } + } + } +} + +function extendSchemaForBatchExtensions(definitions: any) : void { + const extensionsText = fs.readFileSync(path.join(__dirname, `../../tools/extensions.schema.json`), 'utf8'); + const extensions : any = JSON.parse(extensionsText); + mergeExtensions(extensions, definitions); +} + +function mergeExtensions(extensions: any, base: any) { + for (const p in extensions) { + if (base[p]) { + base[p].properties = Object.assign(base[p].properties, extensions[p].properties); + } else { + base[p] = extensions[p]; + } + } + fillInImplicitExtensionTypes(base); +} + +function fillInImplicitExtensionTypes(definitions: any) { + for (const extensionType of implicitExtensionTypes) { + let basedOn = definitions[extensionType.basedOn]; + let definition : any = { properties: { } }; // can't use Object.assign({}, definitions[extensionType.basedOn]); because of shallow copies + for (const property in basedOn.properties) { + if (extensionType.removing.indexOf(property) < 0) { + definition.properties[property] = basedOn.properties[property]; + } + } + definition.title = basedOn.title; + definition.description = basedOn.description; + definition.required = basedOn.required.filter((p : string) => extensionType.removing.indexOf(p) < 0); + definitions[extensionType.name] = definition; + } +} + +function enrichSchema(definitions: any) { + for (const e in enrichments) { + let declaringType = definitions[e]; + if (declaringType) { // we run this after filtering to the job or pool subset, so some enrichments may not relate to the definitions at hand + declaringType = Object.assign(declaringType, enrichments[e]); + } + } +} + +function chaseRef(swagger: any, ref: string) : { name: string, schema: any } { + const refPath = ref.split('/'); + refPath.shift(); + let r = swagger; + for (const p of refPath) { + r = r[p]; + } + const schema : any = r; + const name = refPath.reverse()[0]; + return { name: name, schema: schema }; +} + +function recursivelyAddDefns(swagger: any, source: any, destination: any) : void { + if (source.properties) { + for (const p in source.properties) { + if (source.properties[p]['$ref']) { + const ref : string = source.properties[p]['$ref']; + recursivelyAddDefnsForRef(swagger, ref, destination); + } else if (source.properties[p].items && source.properties[p].items['$ref']) { + const ref : string = source.properties[p].items['$ref']; + recursivelyAddDefnsForRef(swagger, ref, destination); + } + } + } +} + +function recursivelyAddDefnsForRef(swagger: any, ref: string, destination: any) { + const refSchema = chaseRef(swagger, ref); + if (!destination[refSchema.name]) { + destination[refSchema.name] = refSchema.schema; + fixSchemaSoTitlesShowInJsonValidation(destination[refSchema.name]); + recursivelyAddDefns(swagger, refSchema.schema, destination); + } +} + +function fixAllDefinitionsSoTitlesShowInJsonValidation(schema: any) : void { + for (const p in schema.definitions) { // Rather than compromise our template schema to deal with the VS Code title bug, we fix it up here + fixSchemaSoTitlesShowInJsonValidation(schema.definitions[p]); + } +} + +function fixSchemaSoTitlesShowInJsonValidation(schema: any) : any { + // Workaround for https://github.com/Microsoft/vscode/issues/28978 + if (schema.properties) { + for (const p in schema.properties) { + schema.properties[p].description = schema.properties[p].title; + } + } +} + +function resourcePath(resourceType : batch.BatchResourceType) : string { + switch (resourceType) { + case 'job': + return '/jobs'; + case 'pool': + return '/pools'; + default: + throw 'Unknown resource type ' + resourceType; + } +} + +// We don't want to take a runtime dependency on batch.ts as it indirectly +// imports the vscode module. So we copy these two functions from there. +// (We are allowed to take compile time dependencies on type definitions.) + +function templateResourceType(resourceType : batch.BatchResourceType) : string { + return "Microsoft.Batch/batchAccounts/" + plural(resourceType); +} + +function plural(resourceType : batch.BatchResourceType) : string { + switch (resourceType) { + case 'job': return 'jobs'; + case 'pool': return 'pools'; + default: throw `unknown resource type ${resourceType}`; + } +} + +// End of copy from the batch.ts module + +export async function fetchSwagger() : Promise { + const swaggerUrl = `https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/batch/2017-05-01.5.0/swagger/BatchService.json`; + const response = await httpsGet(swaggerUrl); + if (response.statusCode === 200) { + const swaggerText = await readText(response); + const swagger : any = JSON.parse(swaggerText); + return swagger; + } + response.resume(); + throw `Failed to download Swagger: ${response.statusCode} ${response.statusMessage}`; +} + +function readText(response : http.IncomingMessage) : Promise { + return new Promise((resolve, reject) => { + if (response.statusCode === 200) { + response.setEncoding('utf8'); + let text = ''; + response.on('data', (chunk) => { text += chunk; }); + response.on('end', () => { + resolve(text); + return; + }); + } else { + response.resume(); + reject("Failed to download Swagger"); + } + }); +} + +function httpsGet(url : string) : Promise { + return new Promise((resolve, reject) => { + https.get(url, (result: http.IncomingMessage) => { + resolve(result); + }); + }); +} \ No newline at end of file