sdkutil

package
v1.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

README

sdkutil Package

This package contains utilities for interacting with SageMaker SDK types. Specifically, these files help convert and compare the operator's SageMaker types to SageMaker SDK types.

Documentation

Index

Constants

View Source
const HostingAutoscalingPolicyServiceNamespace = "sagemaker"

HostingAutoscalingPolicyServiceNamespace is a constant value for using the Autoscaling API in the SageMaker Service

Variables

This section is empty.

Functions

func ConvertAutoscalingResourceToString added in v1.2.0

func ConvertAutoscalingResourceToString(resourceIDfromSpec commonv1.AutoscalingResource) *string

ConvertAutoscalingResourceToString converts a map to a key value pair

func ConvertDebugRuleEvaluationStatusesFromSageMaker

func ConvertDebugRuleEvaluationStatusesFromSageMaker(source []*sagemaker.DebugRuleEvaluationStatus) ([]commonv1.DebugRuleEvaluationStatus, error)

ConvertDebugRuleEvaluationStatusesFromSageMaker converts an array of SageMaker DebugRuleEvaluationStatus to a Kubernetes SageMaker type.

func ConvertHyperParameterTrainingJobSummaryFromSageMaker

func ConvertHyperParameterTrainingJobSummaryFromSageMaker(source *sagemaker.HyperParameterTrainingJobSummary) (*commonv1.HyperParameterTrainingJobSummary, error)

ConvertHyperParameterTrainingJobSummaryFromSageMaker converts a HyperParameterTrainingJobSummary to a Kubernetes SageMaker type, returning errors if there are any.

func ConvertKeyValuePairSliceToMap

func ConvertKeyValuePairSliceToMap(kvps []*commonv1.KeyValuePair) map[string]*string

ConvertKeyValuePairSliceToMap converts key value pairs to a map

func ConvertMapToKeyValuePairSlice

func ConvertMapToKeyValuePairSlice(m map[string]*string) []*commonv1.KeyValuePair

ConvertMapToKeyValuePairSlice converts a map to a key value pair

func ConvertProductionVariantSummary

func ConvertProductionVariantSummary(pv *sagemaker.ProductionVariantSummary) (*commonv1.ProductionVariantSummary, error)

ConvertProductionVariantSummary creates a *commonv1.ProductionVariantSummary from the equivalent SageMaker type.

func ConvertProductionVariantSummarySlice

func ConvertProductionVariantSummarySlice(pvs []*sagemaker.ProductionVariantSummary) ([]*commonv1.ProductionVariantSummary, error)

ConvertProductionVariantSummarySlice creates a []*commonv1.ProductionVariantSummary from the equivalent SageMaker type.

func ConvertTagSliceToSageMakerTagSlice

func ConvertTagSliceToSageMakerTagSlice(tags []commonv1.Tag) []*sagemaker.Tag

ConvertTagSliceToSageMakerTagSlice converts Tags to Sagemaker Tags

func ConvertVariantPropertiesToSageMakerVariantProperties added in v1.2.0

func ConvertVariantPropertiesToSageMakerVariantProperties(variantProperties []commonv1.VariantProperty) []*sagemaker.VariantProperty

Converts VariantProperties to SageMaker VariantProperties

func CreateCreateBatchTransformJobInputFromSpec

func CreateCreateBatchTransformJobInputFromSpec(spec batchtransformjobv1.BatchTransformJobSpec) sagemaker.CreateTransformJobInput

CreateCreateBatchTransformJobInputFromSpec creates a CreateTrainingJobInput from a BatchTransformJobSpec

func CreateCreateEndpointConfigInputFromSpec

func CreateCreateEndpointConfigInputFromSpec(endpointconfig *endpointconfigv1.EndpointConfigSpec, endpointConfigName string) (*sagemaker.CreateEndpointConfigInput, error)

CreateCreateEndpointConfigInputFromSpec creates a CreateEndpointConfig request input from a Kubernetes EndpointConfig spec.

func CreateCreateHyperParameterTuningJobInputFromSpec

func CreateCreateHyperParameterTuningJobInputFromSpec(spec hpojobv1.HyperparameterTuningJobSpec) (sagemaker.CreateHyperParameterTuningJobInput, error)

CreateCreateHyperParameterTuningJobInputFromSpec creates a CreateHPO request input from a Kubernetes HPO spec.

func CreateCreateModelInputFromSpec

func CreateCreateModelInputFromSpec(model *modelv1.ModelSpec, modelName string) (*sagemaker.CreateModelInput, error)

CreateCreateModelInputFromSpec creates a CreateModel request input from a Kubernetes Model spec.

func CreateCreateProcessingJobInputFromSpec added in v1.2.0

func CreateCreateProcessingJobInputFromSpec(spec processingjobv1.ProcessingJobSpec, processingJobName *string) sagemaker.CreateProcessingJobInput

CreateCreateProcessingJobInputFromSpec creates a CreateProcessingJobInput from a ProcessingJobSpec. This panics if json libraries are unable to serialize the spec or deserialize the serialization.

func CreateCreateTrainingJobInputFromSpec

func CreateCreateTrainingJobInputFromSpec(spec trainingjobv1.TrainingJobSpec) sagemaker.CreateTrainingJobInput

CreateCreateTrainingJobInputFromSpec creates a CreateTrainingJobInput from a TrainingJobSpec. This panics if json libraries are unable to serialize the spec or deserialize the serialization.

func CreateDeleteEndpointConfigInput

func CreateDeleteEndpointConfigInput(endpointConfigName *string) (*sagemaker.DeleteEndpointConfigInput, error)

CreateDeleteEndpointConfigInput creates a DeleteEndpointConfigRequest input from a EndpointConfigName.

func CreateDeleteModelInput

func CreateDeleteModelInput(modelName *string) (*sagemaker.DeleteModelInput, error)

CreateDeleteModelInput creates a DeleteModel request input from a ModelName.

func CreateDeleteScalingPolicyInput added in v1.2.0

CreateDeleteScalingPolicyInput creates DeleteScalingPolicyInput from spec

func CreateDeregisterScalableTargetInput added in v1.2.0

CreateDeregisterScalableTargetInput creates DeregisterScalableTargetInput from spec

func CreateEndpointConfigSpecFromDescription

func CreateEndpointConfigSpecFromDescription(description *sagemaker.DescribeEndpointConfigOutput) (*endpointconfigv1.EndpointConfigSpec, error)

CreateEndpointConfigSpecFromDescription creates a Kubernetes EndpointConfig spec from a SageMaker endpointconfig description.

func CreateHostingAutoscalingPolicySpecFromDescription added in v1.2.0

func CreateHostingAutoscalingPolicySpecFromDescription(targetDescriptions []*applicationautoscaling.DescribeScalableTargetsOutput, descriptions []*applicationautoscaling.ScalingPolicy, oldResourceIDList []string) (hostingautoscalingpolicyv1.HostingAutoscalingPolicySpec, error)

CreateHostingAutoscalingPolicySpecFromDescription creates a Kubernetes spec from a List of Descriptions Review: Needs a major review and also update if additional fields are added/removed from spec

func CreateHyperParameterTuningJobSpecFromDescription

func CreateHyperParameterTuningJobSpecFromDescription(description sagemaker.DescribeHyperParameterTuningJobOutput) hpojobv1.HyperparameterTuningJobSpec

CreateHyperParameterTuningJobSpecFromDescription creates a HyperParameterTuningJobSpec from a DescribeHyperParameterTuningJobOutput. This panics if json libraries are unable to serialize the description and deserialize the serialization.

func CreateModelSpecFromDescription

func CreateModelSpecFromDescription(description *sagemaker.DescribeModelOutput) (*modelv1.ModelSpec, error)

CreateModelSpecFromDescription creates a Kubernetes Model spec from a SageMaker model description.

func CreatePutScalingPolicyInputFromSpec added in v1.2.0

CreatePutScalingPolicyInputFromSpec from a JobSpec. This panics if json libraries are unable to serialize the spec or deserialize the serialization.

func CreateRegisterScalableTargetInputFromSpec added in v1.2.0

CreateRegisterScalableTargetInputFromSpec from a JobSpec. This panics if json libraries are unable to serialize the spec or deserialize the serialization.

func CreateTrainingJobSpecFromDescription

func CreateTrainingJobSpecFromDescription(description sagemaker.DescribeTrainingJobOutput) (trainingjobv1.TrainingJobSpec, error)

CreateTrainingJobSpecFromDescription creates a TrainingJobSpec from a SageMaker description. This uses JSON to do the assignment. It also transforms the hyperparameter list from map to list of key,value pairs.

func CreateTrainingJobStatusCountersFromDescription

func CreateTrainingJobStatusCountersFromDescription(sageMakerDescription *sagemaker.DescribeHyperParameterTuningJobOutput) *commonv1.TrainingJobStatusCounters

CreateTrainingJobStatusCountersFromDescription creates a set of TrainingJobStatusCounters from a DescribeHyperParameterTuningJobOutput

func CreateTransformJobSpecFromDescription

func CreateTransformJobSpecFromDescription(description sagemaker.DescribeTransformJobOutput) batchtransformjobv1.BatchTransformJobSpec

CreateTransformJobSpecFromDescription creates a BatchTransformJobSpec from a DescribeTrainingJobOutput. This panics if json libraries are unable to serialize the description and deserialize the serialization.

Types

type Comparison

type Comparison struct {
	// A human-readable list of differences.
	Differences string

	// Whether or not the two objects are equal.
	Equal bool
}

Comparison is a simple struct representing whether two objects match and their differences.

func EndpointConfigSpecMatchesDescription

func EndpointConfigSpecMatchesDescription(description sagemaker.DescribeEndpointConfigOutput, spec endpointconfigv1.EndpointConfigSpec) (Comparison, error)

Determine if the given EndpointConfigSpec matches the DescribeEndpointConfigOutput. This converts the description to a EndpointConfigSpec, then selectively compares fields.

func HostingAutoscalingPolicySpecMatchesDescription added in v1.2.0

func HostingAutoscalingPolicySpecMatchesDescription(targetDescriptions []*applicationautoscaling.DescribeScalableTargetsOutput, descriptions []*applicationautoscaling.ScalingPolicy, spec hostingautoscalingpolicyv1.HostingAutoscalingPolicySpec, oldResourceIDList []string) (Comparison, error)

HostingAutoscalingPolicySpecMatchesDescription determines if the given HostingAutoscalingPolicySpec matches the DescribeScalingPoliciesOutput. This converts description to spec and selectively compares fields

func HyperparameterTuningJobSpecMatchesDescription

func HyperparameterTuningJobSpecMatchesDescription(description sagemaker.DescribeHyperParameterTuningJobOutput, spec hpojobv1.HyperparameterTuningJobSpec) Comparison

Determine if the given HyperparameterTuningJobSpec matches the DescribeHyperParameterTuningJobOutput. This converts the description to a HyperparameterTuningJobSpec, then selectively compares fields.

func ModelSpecMatchesDescription

func ModelSpecMatchesDescription(description sagemaker.DescribeModelOutput, spec modelv1.ModelSpec) (Comparison, error)

Determine if the given ModelSpec matches the DescribeModelOutput. This converts the description to a ModelSpec, then selectively compares fields.

func TransformJobSpecMatchesDescription

func TransformJobSpecMatchesDescription(description sagemaker.DescribeTransformJobOutput, spec batchtransformjobv1.BatchTransformJobSpec) Comparison

Determine if the given BatchTransformJobSpec matches the DescribeTransformJobOutput. This converts the description to a BatchTransformJobSpec, then selectively compares fields.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL