Skip to content

create_job

create_job(
    client_token: String64,
    algorithm_specification: AlgorithmSpecification,
    output_data_config: JobOutputDataConfig,
    job_name: str,
    role_arn: RoleArn,
    instance_config: InstanceConfig,
    device_config: DeviceConfig,
    *,
    config_overrides: Optional[BraketClientConfig] = None,
    input_data_config: Optional[InputConfigList] = None,
    checkpoint_config: Optional[JobCheckpointConfig] = None,
    stopping_condition: Optional[JobStoppingCondition] = None,
    hyper_parameters: Optional[HyperParameters] = None,
    tags: Optional[TagsMap] = None,
    associations: Optional[Associations] = None,
) -> CreateJobResponse

Creates an Amazon Braket hybrid job.

Parameters:

  • client_token (String64) –

    The client token associated with this request that guarantees that the request is idempotent.

  • algorithm_specification (AlgorithmSpecification) –

    Definition of the Amazon Braket job to be created. Specifies the container image the job uses and information about the Python scripts used for entry and training.

  • input_data_config (Optional[InputConfigList], default: None ) –

    A list of parameters that specify the name and type of input data and where it is located.

  • output_data_config (JobOutputDataConfig) –

    The path to the S3 location where you want to store hybrid job artifacts and the encryption key used to store them.

  • checkpoint_config (Optional[JobCheckpointConfig], default: None ) –

    Information about the output locations for hybrid job checkpoint data.

  • job_name (str) –

    The name of the Amazon Braket hybrid job.

  • role_arn (RoleArn) –

    The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output results and hybrid job details to the users' s3 buckets.

  • stopping_condition (Optional[JobStoppingCondition], default: None ) –

    The user-defined criteria that specifies when a hybrid job stops running.

  • instance_config (InstanceConfig) –

    Configuration of the resource instances to use while running the hybrid job on Amazon Braket.

  • hyper_parameters (Optional[HyperParameters], default: None ) –

    Algorithm-specific parameters used by an Amazon Braket hybrid job that influence the quality of the training job. The values are set with a map of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of the hyperparameter.

    Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request hyperparameter variable or plain text fields.

  • device_config (DeviceConfig) –

    The quantum processing unit (QPU) or simulator used to create an Amazon Braket hybrid job.

  • tags (Optional[TagsMap], default: None ) –

    Tags to be added to the hybrid job you're creating.

  • associations (Optional[Associations], default: None ) –

    The list of Amazon Braket resources associated with the hybrid job.

Raises:

Source code in docs_src/capo_braket/_services/braket.py
def create_job(
    self,
    client_token: "capo_braket.types.string64.String64",
    algorithm_specification: "capo_braket.types.algorithm_specification.AlgorithmSpecification",
    output_data_config: "capo_braket.types.job_output_data_config.JobOutputDataConfig",
    job_name: str,
    role_arn: "capo_braket.types.role_arn.RoleArn",
    instance_config: "capo_braket.types.instance_config.InstanceConfig",
    device_config: "capo_braket.types.device_config.DeviceConfig",
    *,
    config_overrides: Optional[BraketClientConfig] = None,
    input_data_config: Optional[
        "capo_braket.types.input_config_list.InputConfigList"
    ] = None,
    checkpoint_config: Optional[
        "capo_braket.types.job_checkpoint_config.JobCheckpointConfig"
    ] = None,
    stopping_condition: Optional[
        "capo_braket.types.job_stopping_condition.JobStoppingCondition"
    ] = None,
    hyper_parameters: Optional[
        "capo_braket.types.hyper_parameters.HyperParameters"
    ] = None,
    tags: Optional["capo_braket.types.tags_map.TagsMap"] = None,
    associations: Optional["capo_braket.types.associations.Associations"] = None,
) -> "capo_braket.types.create_job_response.CreateJobResponse":
    """<p>Creates an Amazon Braket hybrid job.</p>

    Args:
        client_token: <p>The client token associated with this request that guarantees that the request is idempotent.</p>
        algorithm_specification: <p>Definition of the Amazon Braket job to be created. Specifies the container image the job uses and information about the Python scripts used for entry and training.</p>
        input_data_config: <p>A list of parameters that specify the name and type of input data and where it is located.</p>
        output_data_config: <p>The path to the S3 location where you want to store hybrid job artifacts and the encryption key used to store them.</p>
        checkpoint_config: <p>Information about the output locations for hybrid job checkpoint data.</p>
        job_name: <p>The name of the Amazon Braket hybrid job.</p>
        role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that Amazon Braket can assume to perform tasks on behalf of a user. It can access user resources, run an Amazon Braket job container on behalf of user, and output results and hybrid job details to the users' s3 buckets.</p>
        stopping_condition: <p> The user-defined criteria that specifies when a hybrid job stops running.</p>
        instance_config: <p>Configuration of the resource instances to use while running the hybrid job on Amazon Braket.</p>
        hyper_parameters: <p>Algorithm-specific parameters used by an Amazon Braket hybrid job that influence the quality of the training job. The values are set with a map of JSON key:value pairs, where the key is the name of the hyperparameter and the value is the value of the hyperparameter.</p> <important> <p>Do not include any security-sensitive information including account access IDs, secrets, or tokens in any hyperparameter fields. As part of the shared responsibility model, you are responsible for any potential exposure, unauthorized access, or compromise of your sensitive data if caused by security-sensitive information included in the request hyperparameter variable or plain text fields.</p> </important>
        device_config: <p>The quantum processing unit (QPU) or simulator used to create an Amazon Braket hybrid job.</p>
        tags: <p>Tags to be added to the hybrid job you're creating.</p>
        associations: <p>The list of Amazon Braket resources associated with the hybrid job.</p>

    Raises:
        capo_braket.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_braket.errors.conflict_exception.ConflictException: <p>An error occurred due to a conflict.</p>
        capo_braket.errors.device_offline_exception.DeviceOfflineException: <p>The specified device is currently offline.</p>
        capo_braket.errors.device_retired_exception.DeviceRetiredException: <p>The specified device has been retired.</p>
        capo_braket.errors.internal_service_exception.InternalServiceException: <p>The request failed because of an unknown error.</p>
        capo_braket.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request failed because a service quota is exceeded.</p>
        capo_braket.errors.throttling_exception.ThrottlingException: <p>The API throttling rate limit is exceeded.</p>
        capo_braket.errors.validation_exception.ValidationException: <p>The input request failed to satisfy constraints expected by Amazon Braket.</p>
        capo_braket.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_braket.types.create_job_request.CreateJobRequest]",
    ) -> OperationResponse[
        "capo_braket.types.create_job_response.CreateJobResponse"
    ]:
        import capo_braket._operations.braket.create_job

        output, http_response = (
            capo_braket._operations.braket.create_job.create_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateJob")
    )
    input_: capo_braket.types.create_job_request.CreateJobRequest = {
        "client_token": client_token,
        "algorithm_specification": algorithm_specification,
        "output_data_config": output_data_config,
        "job_name": job_name,
        "role_arn": role_arn,
        "instance_config": instance_config,
        "device_config": device_config,
    }
    if input_data_config is not None:
        input_["input_data_config"] = input_data_config
    if checkpoint_config is not None:
        input_["checkpoint_config"] = checkpoint_config
    if stopping_condition is not None:
        input_["stopping_condition"] = stopping_condition
    if hyper_parameters is not None:
        input_["hyper_parameters"] = hyper_parameters
    if tags is not None:
        input_["tags"] = tags
    if associations is not None:
        input_["associations"] = associations

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output