.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto/integrations/aws/batch/batch.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_integrations_aws_batch_batch.py: AWS Batch ############ This example shows how to use a Flyte AWS batch plugin to execute a tasks on batch service. With AWS Batch, there is no need to install and manage batch computing software or server clusters that you use to run your jobs, allowing you to focus on analyzing results and solving problems. .. GENERATED FROM PYTHON SOURCE LINES 8-12 .. code-block:: default from flytekit import task, workflow from flytekitplugins.awsbatch import AWSBatchConfig .. GENERATED FROM PYTHON SOURCE LINES 13-17 Use this to configure SubmitJobInput for a AWS batch job. Task's marked with this will automatically execute natively onto AWS batch service. Refer to AWS SubmitJobInput for more detail: https://docs.aws.amazon.com/sdk-for-go/api/service/batch/#SubmitJobInput .. GENERATED FROM PYTHON SOURCE LINES 17-42 .. code-block:: default config = AWSBatchConfig( parameters={"codec": "mp4"}, platformCapabilities="EC2", tags={"name": "flyte-example"}, ) @task(task_config=config) def t1(a: int) -> int: return a + 2 @task(task_config=config) def t2(b: int) -> int: return b * 10 @workflow def my_wf(a: int) -> int: b = t1(a=a) return t2(b=b) if __name__ == "__main__": print(f"Running my_wf(a=3') {my_wf(a=3)}") .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_auto_integrations_aws_batch_batch.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: batch.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: batch.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_