Skip to content

stop_compilation_job

stop_compilation_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    compilation_job_name: Optional[EntityName] = None,
) -> None

Stops a model compilation job.

To stop a job, Amazon SageMaker AI sends the algorithm the SIGTERM signal. This gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL signal.

When it receives a StopCompilationJob request, Amazon SageMaker AI changes the CompilationJobStatus of the job to Stopping. After Amazon SageMaker stops the job, it sets the CompilationJobStatus to Stopped.

Parameters:

  • compilation_job_name (Optional[EntityName], default: None ) –

    The name of the model compilation job to stop.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def stop_compilation_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    compilation_job_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
) -> None:
    """<p>Stops a model compilation job.</p> <p> To stop a job, Amazon SageMaker AI sends the algorithm the SIGTERM signal. This gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL signal.</p> <p>When it receives a <code>StopCompilationJob</code> request, Amazon SageMaker AI changes the <code>CompilationJobStatus</code> of the job to <code>Stopping</code>. After Amazon SageMaker stops the job, it sets the <code>CompilationJobStatus</code> to <code>Stopped</code>. </p>

    Args:
        compilation_job_name: <p>The name of the model compilation job to stop.</p>

    Raises:
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.stop_compilation_job_request.StopCompilationJobRequest]",
    ) -> OperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.stop_compilation_job

        output, http_response = (
            capo_sagemaker._operations.sage_maker.stop_compilation_job.stop_compilation_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopCompilationJob")
    )
    input_: capo_sagemaker.types.stop_compilation_job_request.StopCompilationJobRequest = {}
    if compilation_job_name is not None:
        input_["compilation_job_name"] = compilation_job_name

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