submit_job
async
¶
submit_job(
*,
config_overrides: Optional[AsyncBatchClientConfig] = None,
job_name: Optional[String] = None,
job_queue: Optional[String] = None,
share_identifier: Optional[String] = None,
scheduling_priority_override: Optional[Integer] = None,
array_properties: Optional[ArrayProperties] = None,
depends_on: Optional[JobDependencyList] = None,
job_definition: Optional[String] = None,
parameters: Optional[ParametersMap] = None,
container_overrides: Optional[ContainerOverrides] = None,
node_overrides: Optional[NodeOverrides] = None,
retry_strategy: Optional[RetryStrategy] = None,
propagate_tags: Optional[Boolean] = None,
timeout: Optional[JobTimeout] = None,
tags: Optional[TagrisTagsMap] = None,
eks_properties_override: Optional[EksPropertiesOverride] = None,
ecs_properties_override: Optional[EcsPropertiesOverride] = None,
consumable_resource_properties_override: Optional[
ConsumableResourceProperties
] = None,
) -> SubmitJobResponse
Submits an Batch job from a job definition. Parameters that are specified during SubmitJob override parameters defined in the job definition. vCPU and memory requirements that are specified in the resourceRequirements objects in the job definition are the exception. They can't be overridden this way using the memory and vcpus parameters. Rather, you must specify updates to job definition parameters in a resourceRequirements object that's included in the containerOverrides parameter.
Job queues with a scheduling policy are limited to 500 active share identifiers at a time.
Jobs that run on Fargate resources can't be guaranteed to run for more than 14 days. This is because, after 14 days, Fargate resources might become unavailable and job might be terminated.
Parameters:
-
job_name(Optional[String], default:None) –The name of the job. It can be up to 128 letters long. The first character must be alphanumeric, can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
-
job_queue(Optional[String], default:None) –The job queue where the job is submitted. You can specify either the name or the Amazon Resource Name (ARN) of the queue.
-
share_identifier(Optional[String], default:None) –The share identifier for the job. Don't specify this parameter if the job queue doesn't have a fair-share scheduling policy. If the job queue has a fair-share scheduling policy, then this parameter must be specified.
This string is limited to 255 alphanumeric characters, and can be followed by an asterisk (*).
-
scheduling_priority_override(Optional[Integer], default:None) –The scheduling priority for the job. This only affects jobs in job queues with a fair-share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority. This overrides any scheduling priority in the job definition and works only within a single share identifier.
The minimum supported value is 0 and the maximum supported value is 9999.
-
array_properties(Optional[ArrayProperties], default:None) –The array properties for the submitted job, such as the size of the array. The array size can be between 2 and 10,000. If you specify array properties for a job, it becomes an array job. For more information, see Array Jobs in the Batch User Guide.
-
depends_on(Optional[JobDependencyList], default:None) –A list of dependencies for the job. A job can depend upon a maximum of 20 jobs. You can specify a
SEQUENTIALtype dependency without specifying a job ID for array jobs so that each child array job completes sequentially, starting at index 0. You can also specify anN_TO_Ntype dependency with a job ID for array jobs. In that case, each index child of this job must wait for the corresponding index child of each dependency to complete before it can begin. -
job_definition(Optional[String], default:None) –The job definition used by this job. This value can be one of
definition-name,definition-name:revision, or the Amazon Resource Name (ARN) for the job definition, with or without the revision (arn:aws:batch:region:account:job-definition/definition-name:revision, orarn:aws:batch:region:account:job-definition/definition-name).If the revision is not specified, then the latest active revision is used.
-
parameters(Optional[ParametersMap], default:None) –Additional parameters passed to the job that replace parameter substitution placeholders that are set in the job definition. Parameters are specified as a key and value pair mapping. Parameters in a
SubmitJobrequest override any corresponding parameter defaults from the job definition. -
container_overrides(Optional[ContainerOverrides], default:None) –An object with properties that override the defaults for the job definition that specify the name of a container in the specified job definition and the overrides it should receive. You can override the default command for a container, which is specified in the job definition or the Docker image, with a
commandoverride. You can also override existing environment variables on a container or add new environment variables to it with anenvironmentoverride. -
node_overrides(Optional[NodeOverrides], default:None) –A list of node overrides in JSON format that specify the node range to target and the container overrides for that node range.
This parameter isn't applicable to jobs that are running on Fargate resources; use
containerOverridesinstead. -
retry_strategy(Optional[RetryStrategy], default:None) –The retry strategy to use for failed jobs from this SubmitJob operation. When a retry strategy is specified here, it overrides the retry strategy defined in the job definition.
-
propagate_tags(Optional[Boolean], default:None) –Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks during task creation. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the
FAILEDstate. When specified, this overrides the tag propagation setting in the job definition. -
timeout(Optional[JobTimeout], default:None) –The timeout configuration for this SubmitJob operation. You can specify a timeout duration after which Batch terminates your jobs if they haven't finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds. This configuration overrides any timeout configuration specified in the job definition. For array jobs, child jobs have the same timeout configuration as the parent job. For more information, see Job Timeouts in the Amazon Elastic Container Service Developer Guide.
-
tags(Optional[TagrisTagsMap], default:None) –The tags that you apply to the job request to help you categorize and organize your resources. Each tag consists of a key and an optional value. For more information, see Tagging Amazon Web Services Resources in Amazon Web Services General Reference.
-
eks_properties_override(Optional[EksPropertiesOverride], default:None) –An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon EKS resources.
-
ecs_properties_override(Optional[EcsPropertiesOverride], default:None) –An object, with properties that override defaults for the job definition, can only be specified for jobs that are run on Amazon ECS resources.
-
consumable_resource_properties_override(Optional[ConsumableResourceProperties], default:None) –An object that contains overrides for the consumable resources of a job.
Raises:
-
ClientException–These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To submit a job to a queue This example submits a simple container job called example to the HighPriority job queue.
Source code in docs_src/capo_batch/_services/async_batch.py
2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 | |