def submit_stitching_job()

in content/rendering-with-batch/batch/batch.files/job_submission.py [0:0]


def submit_stitching_job(depends_on_job_id):
    """Submits a Batch job that creates a mp4 video using the rendered frames.

    Keyword arguments:
    depends_on_job_id -- identifier of the job that the stitching job depends on
    """

    # Append the name of the job to the URI so that a folder is created in S3
    full_output_uri = '{}/{}'.format(OUTPUT_URI, JOB_NAME)
    client = boto3.client('batch')
    command = 'stitch -i {} -o {}'.format(full_output_uri, full_output_uri)
    kwargs = build_job_kwargs('{}_Stitching'.format(JOB_NAME), command.split())

    # Add the job dependency
    kwargs['dependsOn'] = [
        {
            'jobId': depends_on_job_id,
            'type': 'SEQUENTIAL'
        }
    ]

    try:
        return client.submit_job(**kwargs)
    except Exception as e:
        print(e.args[0])
        sys.exit(2)