def Do(self, spec: SageMakerDeploySpec):
        # Manually invoke AWS client configuration so we can use it before
        # starting the reconciliation loop
        self._configure_aws_clients(spec.inputs)

        name_suffix = SageMakerComponent._generate_unique_timestamped_id()

        self._endpoint_name = (spec.inputs.endpoint_name
                               if spec.inputs.endpoint_name else
                               f"Endpoint{name_suffix}")

        self._should_update_existing = (spec.inputs.update_endpoint
                                        and self._endpoint_name_exists(
                                            spec.inputs.endpoint_name))

        # Fetch existing config to delete after creation
        if self._should_update_existing:
            self._existing_endpoint_config_name = self._get_endpoint_config(
                spec.inputs.endpoint_name)

        self._endpoint_config_name = (
            spec.inputs.endpoint_config_name
            # Only use the predefined name if we are not updating, otherwise could conflict
            if (spec.inputs.endpoint_config_name
                and not self._should_update_existing) else
            f"EndpointConfig{name_suffix}")

        super().Do(spec.inputs, spec.outputs, spec.output_paths)
 def Do(self, spec: SageMakerTrainingSpec):
     self._training_job_name = (
         spec.inputs.job_name if spec.inputs.job_name else
         SageMakerComponent._generate_unique_timestamped_id(
             prefix="TrainingJob"))
     super().Do(spec.inputs, spec.outputs, spec.output_paths)
Example #3
0
 def Do(self, spec: SageMakerRLEstimatorSpec):
     self._rlestimator_job_name = (
         spec.inputs.job_name if spec.inputs.job_name else
         SageMakerComponent._generate_unique_timestamped_id(
             prefix="RLEstimatorJob"))
     super().Do(spec.inputs, spec.outputs, spec.output_paths)