Class: AWS.Batch
- Inherits:
-
AWS.Service
- Object
- AWS.Service
- AWS.Batch
- Identifier:
- batch
- API Version:
- 2016-08-10
- Defined in:
- (unknown)
Overview
Constructs a service interface object. Each API operation is exposed as a function on service.
Service Description
Using Batch, you can run batch computing workloads on the Amazon Web Services Cloud. Batch computing is a common means for developers, scientists, and engineers to access large amounts of compute resources. Batch uses the advantages of the batch computing to remove the undifferentiated heavy lifting of configuring and managing required infrastructure. At the same time, it also adopts a familiar batch computing software approach. You can use Batch to efficiently provision resources, and work toward eliminating capacity constraints, reducing your overall compute costs, and delivering results more quickly.
As a fully managed service, Batch can run batch computing workloads of any scale. Batch automatically provisions compute resources and optimizes workload distribution based on the quantity and scale of your specific workloads. With Batch, there's no need to install or manage batch computing software. This means that you can focus on analyzing results and solving your specific problems instead.
Sending a Request Using Batch
var batch = new AWS.Batch();
batch.cancelJob(params, function (err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
});
Locking the API Version
In order to ensure that the Batch object uses this specific API, you can
construct the object by passing the apiVersion option to the constructor:
var batch = new AWS.Batch({apiVersion: '2016-08-10'});
You can also set the API version globally in AWS.config.apiVersions using
the batch service identifier:
AWS.config.apiVersions = {
batch: '2016-08-10',
// other service API versions
};
var batch = new AWS.Batch();
Constructor Summary collapse
-
new AWS.Batch(options = {}) ⇒ Object
constructor
Constructs a service object.
Property Summary collapse
-
endpoint ⇒ AWS.Endpoint
readwrite
An Endpoint object representing the endpoint URL for service requests.
Properties inherited from AWS.Service
Method Summary collapse
-
cancelJob(params = {}, callback) ⇒ AWS.Request
Cancels a job in an Batch job queue.
-
createComputeEnvironment(params = {}, callback) ⇒ AWS.Request
Creates an Batch compute environment.
-
createJobQueue(params = {}, callback) ⇒ AWS.Request
Creates an Batch job queue.
-
createSchedulingPolicy(params = {}, callback) ⇒ AWS.Request
Creates an Batch scheduling policy.
.
-
deleteComputeEnvironment(params = {}, callback) ⇒ AWS.Request
Deletes an Batch compute environment.
Before you can delete a compute environment, you must set its state to
DISABLEDwith the UpdateComputeEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation. -
deleteJobQueue(params = {}, callback) ⇒ AWS.Request
Deletes the specified job queue.
-
deleteSchedulingPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the specified scheduling policy.
You can't delete a scheduling policy that's used in any job queues.
. -
deregisterJobDefinition(params = {}, callback) ⇒ AWS.Request
Deregisters an Batch job definition.
-
describeComputeEnvironments(params = {}, callback) ⇒ AWS.Request
Describes one or more of your compute environments.
If you're using an unmanaged compute environment, you can use the
.DescribeComputeEnvironmentoperation to determine theecsClusterArnthat you launch your Amazon ECS container instances into. -
describeJobDefinitions(params = {}, callback) ⇒ AWS.Request
Describes a list of job definitions.
-
describeJobQueues(params = {}, callback) ⇒ AWS.Request
Describes one or more of your job queues.
.
-
describeJobs(params = {}, callback) ⇒ AWS.Request
Describes a list of Batch jobs.
.
-
describeSchedulingPolicies(params = {}, callback) ⇒ AWS.Request
Describes one or more of your scheduling policies.
.
-
getJobQueueSnapshot(params = {}, callback) ⇒ AWS.Request
Provides a list of the first 100
RUNNABLEjobs associated to a single job queue..
-
listJobs(params = {}, callback) ⇒ AWS.Request
Returns a list of Batch jobs.
You must specify only one of the following items:
-
A job queue ID to return a list of jobs in that job queue
-
A multi-node parallel job ID to return a list of nodes for that job
-
An array job ID to return a list of the children for that job
You can filter the results by job status with the
jobStatusparameter. -
-
listSchedulingPolicies(params = {}, callback) ⇒ AWS.Request
Returns a list of Batch scheduling policies.
.
-
listTagsForResource(params = {}, callback) ⇒ AWS.Request
Lists the tags for an Batch resource.
-
registerJobDefinition(params = {}, callback) ⇒ AWS.Request
Registers an Batch job definition.
.
-
submitJob(params = {}, callback) ⇒ AWS.Request
Submits an Batch job from a job definition.
-
tagResource(params = {}, callback) ⇒ AWS.Request
Associates the specified tags to a resource with the specified
resourceArn. -
terminateJob(params = {}, callback) ⇒ AWS.Request
Terminates a job in a job queue.
-
untagResource(params = {}, callback) ⇒ AWS.Request
Deletes specified tags from an Batch resource.
.
-
updateComputeEnvironment(params = {}, callback) ⇒ AWS.Request
Updates an Batch compute environment.
.
-
updateJobQueue(params = {}, callback) ⇒ AWS.Request
Updates a job queue.
.
-
updateSchedulingPolicy(params = {}, callback) ⇒ AWS.Request
Updates a scheduling policy.
.
Methods inherited from AWS.Service
makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService
Constructor Details
new AWS.Batch(options = {}) ⇒ Object
Constructs a service object. This object has one method for each API operation.
Property Details
Method Details
cancelJob(params = {}, callback) ⇒ AWS.Request
Cancels a job in an Batch job queue. Jobs that are in a SUBMITTED, PENDING, or RUNNABLE state are cancelled and the job status is updated to FAILED.
PENDING job is canceled after all dependency jobs are completed. Therefore, it may take longer than expected to cancel a job in PENDING status. When you try to cancel an array parent job in PENDING, Batch attempts to cancel all child jobs. The array parent job is canceled when all child jobs are completed. Jobs that progressed to the STARTING or RUNNING state aren't canceled. However, the API operation still succeeds, even if no job is canceled. These jobs must be terminated with the TerminateJob operation.
createComputeEnvironment(params = {}, callback) ⇒ AWS.Request
Creates an Batch compute environment. You can create MANAGED or UNMANAGED compute environments. MANAGED compute environments can use Amazon EC2 or Fargate resources. UNMANAGED compute environments can only use EC2 resources.
In a managed compute environment, Batch manages the capacity and instance types of the compute resources within the environment. This is based on the compute resource specification that you define or the launch template that you specify when you create the compute environment. Either, you can choose to use EC2 On-Demand Instances and EC2 Spot Instances. Or, you can use Fargate and Fargate Spot capacity in your managed compute environment. You can optionally set a maximum price so that Spot Instances only launch when the Spot Instance price is less than a specified percentage of the On-Demand price.
In an unmanaged compute environment, you can manage your own EC2 compute resources and have flexibility with how you configure your compute resources. For example, you can use custom AMIs. However, you must verify that each of your AMIs meet the Amazon ECS container instance AMI specification. For more information, see container instance AMIs in the Amazon Elastic Container Service Developer Guide. After you created your unmanaged compute environment, you can use the DescribeComputeEnvironments operation to find the Amazon ECS cluster that's associated with it. Then, launch your container instances into that Amazon ECS cluster. For more information, see Launching an Amazon ECS container instance in the Amazon Elastic Container Service Developer Guide.
eks:DescribeCluster. - Create a new compute environment with the new AMI.
- Add the compute environment to an existing job queue.
- Remove the earlier compute environment from your job queue.
- Delete the earlier compute environment.
- Either don't set the service role (
serviceRole) parameter or set it to the AWSBatchServiceRole service-linked role. - Set the allocation strategy (
allocationStrategy) parameter toBEST_FIT_PROGRESSIVE,SPOT_CAPACITY_OPTIMIZED, orSPOT_PRICE_CAPACITY_OPTIMIZED. - Set the update to latest image version (
updateToLatestImageVersion) parameter totrue. TheupdateToLatestImageVersionparameter is used when you update a compute environment. This parameter is ignored when you create a compute environment. - Don't specify an AMI ID in
imageId,imageIdOverride(inec2Configuration), or in the launch template (launchTemplate). In that case, Batch selects the latest Amazon ECS optimized AMI that's supported by Batch at the time the infrastructure update is initiated. Alternatively, you can specify the AMI ID in theimageIdorimageIdOverrideparameters, or the launch template identified by theLaunchTemplateproperties. Changing any of these properties starts an infrastructure update. If the AMI ID is specified in the launch template, it can't be replaced by specifying an AMI ID in either theimageIdorimageIdOverrideparameters. It can only be replaced by specifying a different launch template, or if the launch template version is set to$Defaultor$Latest, by setting either a new default version for the launch template (if$Default) or by adding a new version to the launch template (if$Latest).
version setting in the launch template (launchTemplate) is set to $Latest or $Default, the latest or default version of the launch template is evaluated up at the time of the infrastructure update, even if the launchTemplate wasn't updated. createJobQueue(params = {}, callback) ⇒ AWS.Request
Creates an Batch job queue. When you create a job queue, you associate one or more compute environments to the queue and assign an order of preference for the compute environments.
You also set a priority to the job queue that determines the order that the Batch scheduler places jobs onto its associated compute environments. For example, if a compute environment is associated with more than one job queue, the job queue with a higher priority is given preference for scheduling jobs to that compute environment.
deleteComputeEnvironment(params = {}, callback) ⇒ AWS.Request
Deletes an Batch compute environment.
Before you can delete a compute environment, you must set its state to DISABLED with the UpdateComputeEnvironment API operation and disassociate it from any job queues with the UpdateJobQueue API operation. Compute environments that use Fargate resources must terminate all active jobs on that compute environment before deleting the compute environment. If this isn't done, the compute environment enters an invalid state.
deleteJobQueue(params = {}, callback) ⇒ AWS.Request
Deletes the specified job queue. You must first disable submissions for a queue with the UpdateJobQueue operation. All jobs in the queue are eventually terminated when you delete a job queue. The jobs are terminated at a rate of about 16 jobs each second.
It's not necessary to disassociate compute environments from a queue before submitting a DeleteJobQueue request.
deleteSchedulingPolicy(params = {}, callback) ⇒ AWS.Request
Deletes the specified scheduling policy.
You can't delete a scheduling policy that's used in any job queues.
deregisterJobDefinition(params = {}, callback) ⇒ AWS.Request
Deregisters an Batch job definition. Job definitions are permanently deleted after 180 days.
describeComputeEnvironments(params = {}, callback) ⇒ AWS.Request
Describes one or more of your compute environments.
If you're using an unmanaged compute environment, you can use the DescribeComputeEnvironment operation to determine the ecsClusterArn that you launch your Amazon ECS container instances into.