Skip to content

start_ml_data_processing_job async

start_ml_data_processing_job(
    input_data_s3_location: str,
    processed_data_s3_location: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    id: Optional[str] = None,
    previous_data_processing_job_id: Optional[str] = None,
    sagemaker_iam_role_arn: Optional[str] = None,
    neptune_iam_role_arn: Optional[str] = None,
    processing_instance_type: Optional[str] = None,
    processing_instance_volume_size_in_gb: Optional[int] = None,
    processing_time_out_in_seconds: Optional[int] = None,
    model_type: Optional[str] = None,
    config_file_name: Optional[str] = None,
    subnets: Optional[StringList] = None,
    security_group_ids: Optional[StringList] = None,
    volume_encryption_kms_key: Optional[str] = None,
    s3_output_encryption_kms_key: Optional[str] = None,
) -> StartMLDataProcessingJobOutput

Creates a new Neptune ML data processing job for processing the graph data exported from Neptune for training. See The dataprocessing command.

When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the neptune-db:StartMLModelDataProcessingJob IAM action in that cluster.

Parameters:

  • id (Optional[str], default: None ) –

    A unique identifier for the new job. The default is an autogenerated UUID.

  • previous_data_processing_job_id (Optional[str], default: None ) –

    The job ID of a completed data processing job run on an earlier version of the data.

  • input_data_s3_location (str) –

    The URI of the Amazon S3 location where you want SageMaker to download the data needed to run the data processing job.

  • processed_data_s3_location (str) –

    The URI of the Amazon S3 location where you want SageMaker to save the results of a data processing job.

  • sagemaker_iam_role_arn (Optional[str], default: None ) –

    The ARN of an IAM role for SageMaker execution. This must be listed in your DB cluster parameter group or an error will occur.

  • neptune_iam_role_arn (Optional[str], default: None ) –

    The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. This must be listed in your DB cluster parameter group or an error will occur.

  • processing_instance_type (Optional[str], default: None ) –

    The type of ML instance used during data processing. Its memory should be large enough to hold the processed dataset. The default is the smallest ml.r5 type whose memory is ten times larger than the size of the exported graph data on disk.

  • processing_instance_volume_size_in_gb (Optional[int], default: None ) –

    The disk volume size of the processing instance. Both input data and processed data are stored on disk, so the volume size must be large enough to hold both data sets. The default is 0. If not specified or 0, Neptune ML chooses the volume size automatically based on the data size.

  • processing_time_out_in_seconds (Optional[int], default: None ) –

    Timeout in seconds for the data processing job. The default is 86,400 (1 day).

  • model_type (Optional[str], default: None ) –

    One of the two model types that Neptune ML currently supports: heterogeneous graph models (heterogeneous), and knowledge graph (kge). The default is none. If not specified, Neptune ML chooses the model type automatically based on the data.

  • config_file_name (Optional[str], default: None ) –

    A data specification file that describes how to load the exported graph data for training. The file is automatically generated by the Neptune export toolkit. The default is training-data-configuration.json.

  • subnets (Optional[StringList], default: None ) –

    The IDs of the subnets in the Neptune VPC. The default is None.

  • security_group_ids (Optional[StringList], default: None ) –

    The VPC security group IDs. The default is None.

  • volume_encryption_kms_key (Optional[str], default: None ) –

    The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instances that run the training job. The default is None.

  • s3_output_encryption_kms_key (Optional[str], default: None ) –

    The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to encrypt the output of the processing job. The default is none.

Raises:

Source code in docs_src/capo_neptunedata/_services/async_neptunedata.py
async def start_ml_data_processing_job(
    self,
    input_data_s3_location: str,
    processed_data_s3_location: str,
    *,
    config_overrides: Optional[AsyncneptunedataClientConfig] = None,
    id: Optional[str] = None,
    previous_data_processing_job_id: Optional[str] = None,
    sagemaker_iam_role_arn: Optional[str] = None,
    neptune_iam_role_arn: Optional[str] = None,
    processing_instance_type: Optional[str] = None,
    processing_instance_volume_size_in_gb: Optional[int] = None,
    processing_time_out_in_seconds: Optional[int] = None,
    model_type: Optional[str] = None,
    config_file_name: Optional[str] = None,
    subnets: Optional["capo_neptunedata.types.string_list.StringList"] = None,
    security_group_ids: Optional[
        "capo_neptunedata.types.string_list.StringList"
    ] = None,
    volume_encryption_kms_key: Optional[str] = None,
    s3_output_encryption_kms_key: Optional[str] = None,
) -> "capo_neptunedata.types.start_ml_data_processing_job_output.StartMLDataProcessingJobOutput":
    """<p>Creates a new Neptune ML data processing job for processing the graph data exported from Neptune for training. See <a href="https://docs.aws.amazon.com/neptune/latest/userguide/machine-learning-api-dataprocessing.html">The <code>dataprocessing</code> command</a>.</p> <p>When invoking this operation in a Neptune cluster that has IAM authentication enabled, the IAM user or role making the request must have a policy attached that allows the <a href="https://docs.aws.amazon.com/neptune/latest/userguide/iam-dp-actions.html#startmlmodeldataprocessingjob">neptune-db:StartMLModelDataProcessingJob</a> IAM action in that cluster.</p>

    Args:
        id: <p>A unique identifier for the new job. The default is an autogenerated UUID.</p>
        previous_data_processing_job_id: <p>The job ID of a completed data processing job run on an earlier version of the data.</p>
        input_data_s3_location: <p>The URI of the Amazon S3 location where you want SageMaker to download the data needed to run the data processing job.</p>
        processed_data_s3_location: <p>The URI of the Amazon S3 location where you want SageMaker to save the results of a data processing job.</p>
        sagemaker_iam_role_arn: <p>The ARN of an IAM role for SageMaker execution. This must be listed in your DB cluster parameter group or an error will occur.</p>
        neptune_iam_role_arn: <p>The Amazon Resource Name (ARN) of an IAM role that SageMaker can assume to perform tasks on your behalf. This must be listed in your DB cluster parameter group or an error will occur.</p>
        processing_instance_type: <p>The type of ML instance used during data processing. Its memory should be large enough to hold the processed dataset. The default is the smallest ml.r5 type whose memory is ten times larger than the size of the exported graph data on disk.</p>
        processing_instance_volume_size_in_gb: <p>The disk volume size of the processing instance. Both input data and processed data are stored on disk, so the volume size must be large enough to hold both data sets. The default is 0. If not specified or 0, Neptune ML chooses the volume size automatically based on the data size.</p>
        processing_time_out_in_seconds: <p>Timeout in seconds for the data processing job. The default is 86,400 (1 day).</p>
        model_type: <p>One of the two model types that Neptune ML currently supports: heterogeneous graph models (<code>heterogeneous</code>), and knowledge graph (<code>kge</code>). The default is none. If not specified, Neptune ML chooses the model type automatically based on the data.</p>
        config_file_name: <p>A data specification file that describes how to load the exported graph data for training. The file is automatically generated by the Neptune export toolkit. The default is <code>training-data-configuration.json</code>.</p>
        subnets: <p>The IDs of the subnets in the Neptune VPC. The default is None.</p>
        security_group_ids: <p>The VPC security group IDs. The default is None.</p>
        volume_encryption_kms_key: <p>The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to encrypt data on the storage volume attached to the ML compute instances that run the training job. The default is None.</p>
        s3_output_encryption_kms_key: <p>The Amazon Key Management Service (Amazon KMS) key that SageMaker uses to encrypt the output of the processing job. The default is none.</p>

    Raises:
        capo_neptunedata.errors.bad_request_exception.BadRequestException: <p>Raised when a request is submitted that cannot be processed.</p>
        capo_neptunedata.errors.client_timeout_exception.ClientTimeoutException: <p>Raised when a request timed out in the client.</p>
        capo_neptunedata.errors.constraint_violation_exception.ConstraintViolationException: <p>Raised when a value in a request field did not satisfy required constraints.</p>
        capo_neptunedata.errors.illegal_argument_exception.IllegalArgumentException: <p>Raised when an argument in a request is not supported.</p>
        capo_neptunedata.errors.invalid_argument_exception.InvalidArgumentException: <p>Raised when an argument in a request has an invalid value.</p>
        capo_neptunedata.errors.invalid_parameter_exception.InvalidParameterException: <p>Raised when a parameter value is not valid.</p>
        capo_neptunedata.errors.missing_parameter_exception.MissingParameterException: <p>Raised when a required parameter is missing.</p>
        capo_neptunedata.errors.ml_resource_not_found_exception.MLResourceNotFoundException: <p>Raised when a specified machine-learning resource could not be found.</p>
        capo_neptunedata.errors.preconditions_failed_exception.PreconditionsFailedException: <p>Raised when a precondition for processing a request is not satisfied.</p>
        capo_neptunedata.errors.too_many_requests_exception.TooManyRequestsException: <p>Raised when the number of requests being processed exceeds the limit.</p>
        capo_neptunedata.errors.unsupported_operation_exception.UnsupportedOperationException: <p>Raised when a request attempts to initiate an operation that is not supported.</p>
        capo_neptunedata.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_neptunedata.types.start_ml_data_processing_job_input.StartMLDataProcessingJobInput]",
    ) -> AsyncOperationResponse[
        "capo_neptunedata.types.start_ml_data_processing_job_output.StartMLDataProcessingJobOutput"
    ]:
        import capo_neptunedata._operations.amazon_neptune_dataplane.start_ml_data_processing_job

        (
            output,
            http_response,
        ) = await capo_neptunedata._operations.amazon_neptune_dataplane.start_ml_data_processing_job.async_start_ml_data_processing_job(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartMLDataProcessingJob")
    )
    input_: capo_neptunedata.types.start_ml_data_processing_job_input.StartMLDataProcessingJobInput = {
        "input_data_s3_location": input_data_s3_location,
        "processed_data_s3_location": processed_data_s3_location,
    }
    if id is not None:
        input_["id"] = id
    if previous_data_processing_job_id is not None:
        input_["previous_data_processing_job_id"] = previous_data_processing_job_id
    if sagemaker_iam_role_arn is not None:
        input_["sagemaker_iam_role_arn"] = sagemaker_iam_role_arn
    if neptune_iam_role_arn is not None:
        input_["neptune_iam_role_arn"] = neptune_iam_role_arn
    if processing_instance_type is not None:
        input_["processing_instance_type"] = processing_instance_type
    if processing_instance_volume_size_in_gb is not None:
        input_["processing_instance_volume_size_in_gb"] = (
            processing_instance_volume_size_in_gb
        )
    if processing_time_out_in_seconds is not None:
        input_["processing_time_out_in_seconds"] = processing_time_out_in_seconds
    if model_type is not None:
        input_["model_type"] = model_type
    if config_file_name is not None:
        input_["config_file_name"] = config_file_name
    if subnets is not None:
        input_["subnets"] = subnets
    if security_group_ids is not None:
        input_["security_group_ids"] = security_group_ids
    if volume_encryption_kms_key is not None:
        input_["volume_encryption_kms_key"] = volume_encryption_kms_key
    if s3_output_encryption_kms_key is not None:
        input_["s3_output_encryption_kms_key"] = s3_output_encryption_kms_key

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output