batch

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package batch provides AWS Batch service emulation for kumo.

Index

Constants

View Source
const (
	CEStateEnabled  = "ENABLED"
	CEStateDisabled = "DISABLED"
)

Compute environment states.

View Source
const (
	CEStatusCreating = "CREATING"
	CEStatusUpdating = "UPDATING"
	CEStatusDeleting = "DELETING"
	CEStatusDeleted  = "DELETED"
	CEStatusValid    = "VALID"
	CEStatusInvalid  = "INVALID"
)

Compute environment statuses.

View Source
const (
	CETypeManaged   = "MANAGED"
	CETypeUnmanaged = "UNMANAGED"
)

Compute environment types.

View Source
const (
	JQStateEnabled  = "ENABLED"
	JQStateDisabled = "DISABLED"
)

Job queue states.

View Source
const (
	JQStatusCreating = "CREATING"
	JQStatusUpdating = "UPDATING"
	JQStatusDeleting = "DELETING"
	JQStatusDeleted  = "DELETED"
	JQStatusValid    = "VALID"
	JQStatusInvalid  = "INVALID"
)

Job queue statuses.

View Source
const (
	JobStatusSubmitted = "SUBMITTED"
	JobStatusPending   = "PENDING"
	JobStatusRunnable  = "RUNNABLE"
	JobStatusStarting  = "STARTING"
	JobStatusRunning   = "RUNNING"
	JobStatusSucceeded = "SUCCEEDED"
	JobStatusFailed    = "FAILED"
)

Job statuses.

View Source
const (
	JobDefTypeContainer = "container"
	JobDefTypeMultinode = "multinode"
)

Job definition types.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayProperties

type ArrayProperties struct {
	Size int32 `json:"size,omitempty"`
}

ArrayProperties represents array properties.

type ArrayPropertiesDetail

type ArrayPropertiesDetail struct {
	Index         int32            `json:"index,omitempty"`
	Size          int32            `json:"size,omitempty"`
	StatusSummary map[string]int32 `json:"statusSummary,omitempty"`
}

ArrayPropertiesDetail represents array properties detail.

type AttemptContainerDetail

type AttemptContainerDetail struct {
	ContainerInstanceARN string             `json:"containerInstanceArn,omitempty"`
	ExitCode             int32              `json:"exitCode,omitempty"`
	LogStreamName        string             `json:"logStreamName,omitempty"`
	NetworkInterfaces    []NetworkInterface `json:"networkInterfaces,omitempty"`
	Reason               string             `json:"reason,omitempty"`
	TaskARN              string             `json:"taskArn,omitempty"`
}

AttemptContainerDetail represents an attempt container detail.

type AttemptDetail

type AttemptDetail struct {
	Container    *AttemptContainerDetail `json:"container,omitempty"`
	StartedAt    int64                   `json:"startedAt,omitempty"`
	StatusReason string                  `json:"statusReason,omitempty"`
	StoppedAt    int64                   `json:"stoppedAt,omitempty"`
}

AttemptDetail represents an attempt detail.

type AuthorizationConfig

type AuthorizationConfig struct {
	AccessPointID string `json:"accessPointId,omitempty"`
	Iam           string `json:"iam,omitempty"`
}

AuthorizationConfig represents authorization config for EFS.

type ComputeEnvironment

type ComputeEnvironment struct {
	ComputeEnvironmentARN  string            `json:"computeEnvironmentArn,omitempty"`
	ComputeEnvironmentName string            `json:"computeEnvironmentName,omitempty"`
	ComputeResources       *ComputeResource  `json:"computeResources,omitempty"`
	EksConfiguration       *EksConfiguration `json:"eksConfiguration,omitempty"`
	ServiceRole            string            `json:"serviceRole,omitempty"`
	State                  string            `json:"state,omitempty"`
	Status                 string            `json:"status,omitempty"`
	StatusReason           string            `json:"statusReason,omitempty"`
	Type                   string            `json:"type,omitempty"`
	Tags                   map[string]string `json:"tags,omitempty"`
	UpdatePolicy           *UpdatePolicy     `json:"updatePolicy,omitempty"`
	UUID                   string            `json:"uuid,omitempty"`
}

ComputeEnvironment represents a Batch compute environment.

type ComputeEnvironmentOrder

type ComputeEnvironmentOrder struct {
	ComputeEnvironment string `json:"computeEnvironment,omitempty"`
	Order              int32  `json:"order,omitempty"`
}

ComputeEnvironmentOrder represents the order of compute environments.

type ComputeResource

type ComputeResource struct {
	AllocationStrategy string             `json:"allocationStrategy,omitempty"`
	BidPercentage      int32              `json:"bidPercentage,omitempty"`
	DesiredvCpus       int32              `json:"desiredvCpus,omitempty"`
	Ec2Configuration   []Ec2Configuration `json:"ec2Configuration,omitempty"`
	Ec2KeyPair         string             `json:"ec2KeyPair,omitempty"`
	ImageID            string             `json:"imageId,omitempty"`
	InstanceRole       string             `json:"instanceRole,omitempty"`
	InstanceTypes      []string           `json:"instanceTypes,omitempty"`
	LaunchTemplate     *LaunchTemplate    `json:"launchTemplate,omitempty"`
	MaxvCpus           int32              `json:"maxvCpus,omitempty"`
	MinvCpus           int32              `json:"minvCpus,omitempty"`
	PlacementGroup     string             `json:"placementGroup,omitempty"`
	SecurityGroupIDs   []string           `json:"securityGroupIds,omitempty"`
	SpotIamFleetRole   string             `json:"spotIamFleetRole,omitempty"`
	Subnets            []string           `json:"subnets,omitempty"`
	Tags               map[string]string  `json:"tags,omitempty"`
	Type               string             `json:"type,omitempty"`
}

ComputeResource represents compute resources for a compute environment.

type ContainerDetail

type ContainerDetail struct {
	Command                      []string                      `json:"command,omitempty"`
	ContainerInstanceARN         string                        `json:"containerInstanceArn,omitempty"`
	Environment                  []KeyValuePair                `json:"environment,omitempty"`
	ExecutionRoleARN             string                        `json:"executionRoleArn,omitempty"`
	ExitCode                     int32                         `json:"exitCode,omitempty"`
	FargatePlatformConfiguration *FargatePlatformConfiguration `json:"fargatePlatformConfiguration,omitempty"`
	Image                        string                        `json:"image,omitempty"`
	InstanceType                 string                        `json:"instanceType,omitempty"`
	JobRoleARN                   string                        `json:"jobRoleArn,omitempty"`
	LinuxParameters              *LinuxParameters              `json:"linuxParameters,omitempty"`
	LogConfiguration             *LogConfiguration             `json:"logConfiguration,omitempty"`
	LogStreamName                string                        `json:"logStreamName,omitempty"`
	Memory                       int32                         `json:"memory,omitempty"`
	MountPoints                  []MountPoint                  `json:"mountPoints,omitempty"`
	NetworkConfiguration         *NetworkConfiguration         `json:"networkConfiguration,omitempty"`
	NetworkInterfaces            []NetworkInterface            `json:"networkInterfaces,omitempty"`
	Privileged                   bool                          `json:"privileged,omitempty"`
	ReadonlyRootFilesystem       bool                          `json:"readonlyRootFilesystem,omitempty"`
	Reason                       string                        `json:"reason,omitempty"`
	ResourceRequirements         []ResourceRequirement         `json:"resourceRequirements,omitempty"`
	RuntimePlatform              *RuntimePlatform              `json:"runtimePlatform,omitempty"`
	Secrets                      []Secret                      `json:"secrets,omitempty"`
	TaskARN                      string                        `json:"taskArn,omitempty"`
	Ulimits                      []Ulimit                      `json:"ulimits,omitempty"`
	User                         string                        `json:"user,omitempty"`
	Vcpus                        int32                         `json:"vcpus,omitempty"`
	Volumes                      []Volume                      `json:"volumes,omitempty"`
}

ContainerDetail represents container detail.

type ContainerOverrides

type ContainerOverrides struct {
	Command              []string              `json:"command,omitempty"`
	Environment          []KeyValuePair        `json:"environment,omitempty"`
	InstanceType         string                `json:"instanceType,omitempty"`
	Memory               int32                 `json:"memory,omitempty"`
	ResourceRequirements []ResourceRequirement `json:"resourceRequirements,omitempty"`
	Vcpus                int32                 `json:"vcpus,omitempty"`
}

ContainerOverrides represents container overrides.

type ContainerProperties

type ContainerProperties struct {
	Command                      []string                      `json:"command,omitempty"`
	Environment                  []KeyValuePair                `json:"environment,omitempty"`
	ExecutionRoleARN             string                        `json:"executionRoleArn,omitempty"`
	FargatePlatformConfiguration *FargatePlatformConfiguration `json:"fargatePlatformConfiguration,omitempty"`
	Image                        string                        `json:"image,omitempty"`
	InstanceType                 string                        `json:"instanceType,omitempty"`
	JobRoleARN                   string                        `json:"jobRoleArn,omitempty"`
	LinuxParameters              *LinuxParameters              `json:"linuxParameters,omitempty"`
	LogConfiguration             *LogConfiguration             `json:"logConfiguration,omitempty"`
	Memory                       int32                         `json:"memory,omitempty"`
	MountPoints                  []MountPoint                  `json:"mountPoints,omitempty"`
	NetworkConfiguration         *NetworkConfiguration         `json:"networkConfiguration,omitempty"`
	Privileged                   bool                          `json:"privileged,omitempty"`
	ReadonlyRootFilesystem       bool                          `json:"readonlyRootFilesystem,omitempty"`
	ResourceRequirements         []ResourceRequirement         `json:"resourceRequirements,omitempty"`
	RuntimePlatform              *RuntimePlatform              `json:"runtimePlatform,omitempty"`
	Secrets                      []Secret                      `json:"secrets,omitempty"`
	Ulimits                      []Ulimit                      `json:"ulimits,omitempty"`
	User                         string                        `json:"user,omitempty"`
	Vcpus                        int32                         `json:"vcpus,omitempty"`
	Volumes                      []Volume                      `json:"volumes,omitempty"`
}

ContainerProperties represents container properties.

type CreateComputeEnvironmentInput

type CreateComputeEnvironmentInput struct {
	ComputeEnvironmentName string            `json:"computeEnvironmentName"`
	ComputeResources       *ComputeResource  `json:"computeResources,omitempty"`
	EksConfiguration       *EksConfiguration `json:"eksConfiguration,omitempty"`
	ServiceRole            string            `json:"serviceRole,omitempty"`
	State                  string            `json:"state,omitempty"`
	Tags                   map[string]string `json:"tags,omitempty"`
	Type                   string            `json:"type"`
	UnmanagedvCpus         int32             `json:"unmanagedvCpus,omitempty"`
}

CreateComputeEnvironmentInput is the request for CreateComputeEnvironment.

type CreateComputeEnvironmentOutput

type CreateComputeEnvironmentOutput struct {
	ComputeEnvironmentARN  string `json:"computeEnvironmentArn,omitempty"`
	ComputeEnvironmentName string `json:"computeEnvironmentName,omitempty"`
}

CreateComputeEnvironmentOutput is the response for CreateComputeEnvironment.

type CreateJobQueueInput

type CreateJobQueueInput struct {
	ComputeEnvironmentOrder  []ComputeEnvironmentOrder `json:"computeEnvironmentOrder"`
	JobQueueName             string                    `json:"jobQueueName"`
	JobStateTimeLimitActions []JobStateTimeLimitAction `json:"jobStateTimeLimitActions,omitempty"`
	Priority                 int32                     `json:"priority"`
	SchedulingPolicyARN      string                    `json:"schedulingPolicyArn,omitempty"`
	State                    string                    `json:"state,omitempty"`
	Tags                     map[string]string         `json:"tags,omitempty"`
}

CreateJobQueueInput is the request for CreateJobQueue.

type CreateJobQueueOutput

type CreateJobQueueOutput struct {
	JobQueueARN  string `json:"jobQueueArn,omitempty"`
	JobQueueName string `json:"jobQueueName,omitempty"`
}

CreateJobQueueOutput is the response for CreateJobQueue.

type DeleteComputeEnvironmentInput

type DeleteComputeEnvironmentInput struct {
	ComputeEnvironment string `json:"computeEnvironment"`
}

DeleteComputeEnvironmentInput is the request for DeleteComputeEnvironment.

type DeleteJobQueueInput

type DeleteJobQueueInput struct {
	JobQueue string `json:"jobQueue"`
}

DeleteJobQueueInput is the request for DeleteJobQueue.

type DescribeComputeEnvironmentsInput

type DescribeComputeEnvironmentsInput struct {
	ComputeEnvironments []string `json:"computeEnvironments,omitempty"`
	MaxResults          int32    `json:"maxResults,omitempty"`
	NextToken           string   `json:"nextToken,omitempty"`
}

DescribeComputeEnvironmentsInput is the request for DescribeComputeEnvironments.

type DescribeComputeEnvironmentsOutput

type DescribeComputeEnvironmentsOutput struct {
	ComputeEnvironments []ComputeEnvironment `json:"computeEnvironments,omitempty"`
	NextToken           string               `json:"nextToken,omitempty"`
}

DescribeComputeEnvironmentsOutput is the response for DescribeComputeEnvironments.

type DescribeJobQueuesInput

type DescribeJobQueuesInput struct {
	JobQueues  []string `json:"jobQueues,omitempty"`
	MaxResults int32    `json:"maxResults,omitempty"`
	NextToken  string   `json:"nextToken,omitempty"`
}

DescribeJobQueuesInput is the request for DescribeJobQueues.

type DescribeJobQueuesOutput

type DescribeJobQueuesOutput struct {
	JobQueues []JobQueue `json:"jobQueues,omitempty"`
	NextToken string     `json:"nextToken,omitempty"`
}

DescribeJobQueuesOutput is the response for DescribeJobQueues.

type DescribeJobsInput

type DescribeJobsInput struct {
	Jobs []string `json:"jobs"`
}

DescribeJobsInput is the request for DescribeJobs.

type DescribeJobsOutput

type DescribeJobsOutput struct {
	Jobs []Job `json:"jobs,omitempty"`
}

DescribeJobsOutput is the response for DescribeJobs.

type Device

type Device struct {
	ContainerPath string   `json:"containerPath,omitempty"`
	HostPath      string   `json:"hostPath,omitempty"`
	Permissions   []string `json:"permissions,omitempty"`
}

Device represents a device.

type Ec2Configuration

type Ec2Configuration struct {
	ImageIDOverride        string `json:"imageIdOverride,omitempty"`
	ImageKubernetesVersion string `json:"imageKubernetesVersion,omitempty"`
	ImageType              string `json:"imageType,omitempty"`
}

Ec2Configuration represents EC2 configuration.

type EfsVolumeConfiguration

type EfsVolumeConfiguration struct {
	AuthorizationConfig   *AuthorizationConfig `json:"authorizationConfig,omitempty"`
	FileSystemID          string               `json:"fileSystemId,omitempty"`
	RootDirectory         string               `json:"rootDirectory,omitempty"`
	TransitEncryption     string               `json:"transitEncryption,omitempty"`
	TransitEncryptionPort int32                `json:"transitEncryptionPort,omitempty"`
}

EfsVolumeConfiguration represents EFS volume configuration.

type EksAttemptContainerDetail

type EksAttemptContainerDetail struct {
	ExitCode int32  `json:"exitCode,omitempty"`
	Name     string `json:"name,omitempty"`
	Reason   string `json:"reason,omitempty"`
}

EksAttemptContainerDetail represents an EKS attempt container detail.

type EksAttemptDetail

type EksAttemptDetail struct {
	Containers   []EksAttemptContainerDetail `json:"containers,omitempty"`
	PodName      string                      `json:"podName,omitempty"`
	StartedAt    int64                       `json:"startedAt,omitempty"`
	StatusReason string                      `json:"statusReason,omitempty"`
	StoppedAt    int64                       `json:"stoppedAt,omitempty"`
}

EksAttemptDetail represents an EKS attempt detail.

type EksConfiguration

type EksConfiguration struct {
	EksClusterARN       string `json:"eksClusterArn,omitempty"`
	KubernetesNamespace string `json:"kubernetesNamespace,omitempty"`
}

EksConfiguration represents EKS configuration.

type EksContainer

type EksContainer struct {
	Args            []string                     `json:"args,omitempty"`
	Command         []string                     `json:"command,omitempty"`
	Env             []EksContainerEnvVar         `json:"env,omitempty"`
	Image           string                       `json:"image,omitempty"`
	ImagePullPolicy string                       `json:"imagePullPolicy,omitempty"`
	Name            string                       `json:"name,omitempty"`
	Resources       *EksContainerResources       `json:"resources,omitempty"`
	SecurityContext *EksContainerSecurityContext `json:"securityContext,omitempty"`
	VolumeMounts    []EksContainerVolumeMount    `json:"volumeMounts,omitempty"`
}

EksContainer represents an EKS container.

type EksContainerDetail

type EksContainerDetail struct {
	Args            []string                     `json:"args,omitempty"`
	Command         []string                     `json:"command,omitempty"`
	Env             []EksContainerEnvVar         `json:"env,omitempty"`
	ExitCode        int32                        `json:"exitCode,omitempty"`
	Image           string                       `json:"image,omitempty"`
	ImagePullPolicy string                       `json:"imagePullPolicy,omitempty"`
	Name            string                       `json:"name,omitempty"`
	Reason          string                       `json:"reason,omitempty"`
	Resources       *EksContainerResources       `json:"resources,omitempty"`
	SecurityContext *EksContainerSecurityContext `json:"securityContext,omitempty"`
	VolumeMounts    []EksContainerVolumeMount    `json:"volumeMounts,omitempty"`
}

EksContainerDetail represents an EKS container detail.

type EksContainerEnvVar

type EksContainerEnvVar struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

EksContainerEnvVar represents an EKS container environment variable.

type EksContainerOverride

type EksContainerOverride struct {
	Args      []string               `json:"args,omitempty"`
	Command   []string               `json:"command,omitempty"`
	Env       []EksContainerEnvVar   `json:"env,omitempty"`
	Image     string                 `json:"image,omitempty"`
	Name      string                 `json:"name,omitempty"`
	Resources *EksContainerResources `json:"resources,omitempty"`
}

EksContainerOverride represents an EKS container override.

type EksContainerResources

type EksContainerResources struct {
	Limits   map[string]string `json:"limits,omitempty"`
	Requests map[string]string `json:"requests,omitempty"`
}

EksContainerResources represents EKS container resources.

type EksContainerSecurityContext

type EksContainerSecurityContext struct {
	AllowPrivilegeEscalation bool  `json:"allowPrivilegeEscalation,omitempty"`
	Privileged               bool  `json:"privileged,omitempty"`
	ReadOnlyRootFilesystem   bool  `json:"readOnlyRootFilesystem,omitempty"`
	RunAsGroup               int64 `json:"runAsGroup,omitempty"`
	RunAsNonRoot             bool  `json:"runAsNonRoot,omitempty"`
	RunAsUser                int64 `json:"runAsUser,omitempty"`
}

EksContainerSecurityContext represents EKS container security context.

type EksContainerVolumeMount

type EksContainerVolumeMount struct {
	MountPath string `json:"mountPath,omitempty"`
	Name      string `json:"name,omitempty"`
	ReadOnly  bool   `json:"readOnly,omitempty"`
}

EksContainerVolumeMount represents an EKS container volume mount.

type EksEmptyDir

type EksEmptyDir struct {
	Medium    string `json:"medium,omitempty"`
	SizeLimit string `json:"sizeLimit,omitempty"`
}

EksEmptyDir represents an EKS empty dir volume.

type EksHostPath

type EksHostPath struct {
	Path string `json:"path,omitempty"`
}

EksHostPath represents an EKS host path volume.

type EksMetadata

type EksMetadata struct {
	Labels map[string]string `json:"labels,omitempty"`
}

EksMetadata represents EKS metadata.

type EksPodProperties

type EksPodProperties struct {
	Containers         []EksContainer `json:"containers,omitempty"`
	DNSPolicy          string         `json:"dnsPolicy,omitempty"`
	HostNetwork        bool           `json:"hostNetwork,omitempty"`
	Metadata           *EksMetadata   `json:"metadata,omitempty"`
	ServiceAccountName string         `json:"serviceAccountName,omitempty"`
	Volumes            []EksVolume    `json:"volumes,omitempty"`
}

EksPodProperties represents EKS pod properties.

type EksPodPropertiesDetail

type EksPodPropertiesDetail struct {
	Containers         []EksContainerDetail `json:"containers,omitempty"`
	DNSPolicy          string               `json:"dnsPolicy,omitempty"`
	HostNetwork        bool                 `json:"hostNetwork,omitempty"`
	Metadata           *EksMetadata         `json:"metadata,omitempty"`
	NodeName           string               `json:"nodeName,omitempty"`
	PodName            string               `json:"podName,omitempty"`
	ServiceAccountName string               `json:"serviceAccountName,omitempty"`
	Volumes            []EksVolume          `json:"volumes,omitempty"`
}

EksPodPropertiesDetail represents EKS pod properties detail.

type EksPodPropertiesOverride

type EksPodPropertiesOverride struct {
	Containers []EksContainerOverride `json:"containers,omitempty"`
}

EksPodPropertiesOverride represents EKS pod properties override.

type EksProperties

type EksProperties struct {
	PodProperties *EksPodProperties `json:"podProperties,omitempty"`
}

EksProperties represents EKS properties.

type EksPropertiesDetail

type EksPropertiesDetail struct {
	PodProperties *EksPodPropertiesDetail `json:"podProperties,omitempty"`
}

EksPropertiesDetail represents EKS properties detail.

type EksPropertiesOverride

type EksPropertiesOverride struct {
	PodProperties *EksPodPropertiesOverride `json:"podProperties,omitempty"`
}

EksPropertiesOverride represents EKS properties override.

type EksSecret

type EksSecret struct {
	Optional   bool   `json:"optional,omitempty"`
	SecretName string `json:"secretName,omitempty"`
}

EksSecret represents an EKS secret volume.

type EksVolume

type EksVolume struct {
	EmptyDir *EksEmptyDir `json:"emptyDir,omitempty"`
	HostPath *EksHostPath `json:"hostPath,omitempty"`
	Name     string       `json:"name,omitempty"`
	Secret   *EksSecret   `json:"secret,omitempty"`
}

EksVolume represents an EKS volume.

type Error

type Error struct {
	Code    string
	Message string
}

Error represents a Batch error.

func (*Error) Error

func (e *Error) Error() string

Error implements the error interface.

type ErrorResponse

type ErrorResponse struct {
	Type    string `json:"__type"`
	Message string `json:"message"`
}

ErrorResponse represents a Batch error response.

type EvaluateOnExit

type EvaluateOnExit struct {
	Action         string `json:"action,omitempty"`
	OnExitCode     string `json:"onExitCode,omitempty"`
	OnReason       string `json:"onReason,omitempty"`
	OnStatusReason string `json:"onStatusReason,omitempty"`
}

EvaluateOnExit represents an evaluate on exit action.

type FargatePlatformConfiguration

type FargatePlatformConfiguration struct {
	PlatformVersion string `json:"platformVersion,omitempty"`
}

FargatePlatformConfiguration represents Fargate platform configuration.

type Host

type Host struct {
	SourcePath string `json:"sourcePath,omitempty"`
}

Host represents a host volume.

type Job

type Job struct {
	ArrayProperties      *ArrayPropertiesDetail `json:"arrayProperties,omitempty"`
	Attempts             []AttemptDetail        `json:"attempts,omitempty"`
	Container            *ContainerDetail       `json:"container,omitempty"`
	CreatedAt            int64                  `json:"createdAt,omitempty"`
	DependsOn            []JobDependency        `json:"dependsOn,omitempty"`
	EksAttempts          []EksAttemptDetail     `json:"eksAttempts,omitempty"`
	EksProperties        *EksPropertiesDetail   `json:"eksProperties,omitempty"`
	IsCancelled          bool                   `json:"isCancelled,omitempty"`
	IsTerminated         bool                   `json:"isTerminated,omitempty"`
	JobARN               string                 `json:"jobArn,omitempty"`
	JobDefinition        string                 `json:"jobDefinition,omitempty"`
	JobID                string                 `json:"jobId,omitempty"`
	JobName              string                 `json:"jobName,omitempty"`
	JobQueue             string                 `json:"jobQueue,omitempty"`
	NodeDetails          *NodeDetails           `json:"nodeDetails,omitempty"`
	NodeProperties       *NodeProperties        `json:"nodeProperties,omitempty"`
	Parameters           map[string]string      `json:"parameters,omitempty"`
	PlatformCapabilities []string               `json:"platformCapabilities,omitempty"`
	PropagateTags        bool                   `json:"propagateTags,omitempty"`
	RetryStrategy        *RetryStrategy         `json:"retryStrategy,omitempty"`
	SchedulingPriority   int32                  `json:"schedulingPriority,omitempty"`
	ShareIdentifier      string                 `json:"shareIdentifier,omitempty"`
	StartedAt            int64                  `json:"startedAt,omitempty"`
	Status               string                 `json:"status,omitempty"`
	StatusReason         string                 `json:"statusReason,omitempty"`
	StoppedAt            int64                  `json:"stoppedAt,omitempty"`
	Tags                 map[string]string      `json:"tags,omitempty"`
	Timeout              *JobTimeout            `json:"timeout,omitempty"`
}

Job represents a Batch job.

type JobDefinition

type JobDefinition struct {
	ContainerProperties  *ContainerProperties `json:"containerProperties,omitempty"`
	EksProperties        *EksProperties       `json:"eksProperties,omitempty"`
	JobDefinitionARN     string               `json:"jobDefinitionArn,omitempty"`
	JobDefinitionName    string               `json:"jobDefinitionName,omitempty"`
	NodeProperties       *NodeProperties      `json:"nodeProperties,omitempty"`
	Parameters           map[string]string    `json:"parameters,omitempty"`
	PlatformCapabilities []string             `json:"platformCapabilities,omitempty"`
	PropagateTags        bool                 `json:"propagateTags,omitempty"`
	RetryStrategy        *RetryStrategy       `json:"retryStrategy,omitempty"`
	Revision             int32                `json:"revision,omitempty"`
	SchedulingPriority   int32                `json:"schedulingPriority,omitempty"`
	Status               string               `json:"status,omitempty"`
	Tags                 map[string]string    `json:"tags,omitempty"`
	Timeout              *JobTimeout          `json:"timeout,omitempty"`
	Type                 string               `json:"type,omitempty"`
}

JobDefinition represents a Batch job definition.

type JobDependency

type JobDependency struct {
	JobID string `json:"jobId,omitempty"`
	Type  string `json:"type,omitempty"`
}

JobDependency represents a job dependency.

type JobQueue

type JobQueue struct {
	ComputeEnvironmentOrder  []ComputeEnvironmentOrder `json:"computeEnvironmentOrder,omitempty"`
	JobQueueARN              string                    `json:"jobQueueArn,omitempty"`
	JobQueueName             string                    `json:"jobQueueName,omitempty"`
	JobStateTimeLimitActions []JobStateTimeLimitAction `json:"jobStateTimeLimitActions,omitempty"`
	Priority                 int32                     `json:"priority,omitempty"`
	SchedulingPolicyARN      string                    `json:"schedulingPolicyArn,omitempty"`
	State                    string                    `json:"state,omitempty"`
	Status                   string                    `json:"status,omitempty"`
	StatusReason             string                    `json:"statusReason,omitempty"`
	Tags                     map[string]string         `json:"tags,omitempty"`
}

JobQueue represents a Batch job queue.

type JobStateTimeLimitAction

type JobStateTimeLimitAction struct {
	Action         string `json:"action,omitempty"`
	MaxTimeSeconds int32  `json:"maxTimeSeconds,omitempty"`
	Reason         string `json:"reason,omitempty"`
	State          string `json:"state,omitempty"`
}

JobStateTimeLimitAction represents a job state time limit action.

type JobTimeout

type JobTimeout struct {
	AttemptDurationSeconds int32 `json:"attemptDurationSeconds,omitempty"`
}

JobTimeout represents a job timeout.

type KeyValuePair

type KeyValuePair struct {
	Name  string `json:"name,omitempty"`
	Value string `json:"value,omitempty"`
}

KeyValuePair represents a key-value pair.

type LaunchTemplate

type LaunchTemplate struct {
	LaunchTemplateID   string `json:"launchTemplateId,omitempty"`
	LaunchTemplateName string `json:"launchTemplateName,omitempty"`
	Version            string `json:"version,omitempty"`
}

LaunchTemplate represents a launch template.

type LinuxParameters

type LinuxParameters struct {
	Devices            []Device `json:"devices,omitempty"`
	InitProcessEnabled bool     `json:"initProcessEnabled,omitempty"`
	MaxSwap            int32    `json:"maxSwap,omitempty"`
	SharedMemorySize   int32    `json:"sharedMemorySize,omitempty"`
	Swappiness         int32    `json:"swappiness,omitempty"`
	Tmpfs              []Tmpfs  `json:"tmpfs,omitempty"`
}

LinuxParameters represents Linux parameters.

type LogConfiguration

type LogConfiguration struct {
	LogDriver     string            `json:"logDriver,omitempty"`
	Options       map[string]string `json:"options,omitempty"`
	SecretOptions []Secret          `json:"secretOptions,omitempty"`
}

LogConfiguration represents log configuration.

type MemoryStorage

type MemoryStorage struct {
	ComputeEnvironments map[string]*ComputeEnvironment `json:"computeEnvironments"` // key: name
	JobQueues           map[string]*JobQueue           `json:"jobQueues"`           // key: name
	JobDefinitions      map[string]*JobDefinition      `json:"jobDefinitions"`      // key: name:revision
	Jobs                map[string]*Job                `json:"jobs"`                // key: jobID
	JobDefRevisions     map[string]int32               `json:"jobDefRevisions"`     // key: name -> latest revision
	// contains filtered or unexported fields
}

MemoryStorage implements Storage with in-memory data structures.

func NewMemoryStorage

func NewMemoryStorage(opts ...Option) *MemoryStorage

NewMemoryStorage creates a new in-memory storage.

func (*MemoryStorage) Close added in v0.6.0

func (s *MemoryStorage) Close() error

Close saves the storage state to disk if persistence is enabled.

func (*MemoryStorage) CreateComputeEnvironment

func (s *MemoryStorage) CreateComputeEnvironment(_ context.Context, input *CreateComputeEnvironmentInput) (*ComputeEnvironment, error)

CreateComputeEnvironment creates a new compute environment.

func (*MemoryStorage) CreateJobQueue

func (s *MemoryStorage) CreateJobQueue(_ context.Context, input *CreateJobQueueInput) (*JobQueue, error)

CreateJobQueue creates a new job queue.

func (*MemoryStorage) DeleteComputeEnvironment

func (s *MemoryStorage) DeleteComputeEnvironment(_ context.Context, name string) error

DeleteComputeEnvironment deletes a compute environment.

func (*MemoryStorage) DeleteJobQueue

func (s *MemoryStorage) DeleteJobQueue(_ context.Context, name string) error

DeleteJobQueue deletes a job queue.

func (*MemoryStorage) DescribeComputeEnvironments

func (s *MemoryStorage) DescribeComputeEnvironments(_ context.Context, names []string) ([]ComputeEnvironment, error)

DescribeComputeEnvironments describes compute environments.

func (*MemoryStorage) DescribeJobQueues

func (s *MemoryStorage) DescribeJobQueues(_ context.Context, names []string) ([]JobQueue, error)

DescribeJobQueues describes job queues.

func (*MemoryStorage) DescribeJobs

func (s *MemoryStorage) DescribeJobs(_ context.Context, jobIDs []string) ([]Job, error)

DescribeJobs describes jobs.

func (*MemoryStorage) MarshalJSON added in v0.6.0

func (s *MemoryStorage) MarshalJSON() ([]byte, error)

MarshalJSON serializes the storage state to JSON.

func (*MemoryStorage) RegisterJobDefinition

func (s *MemoryStorage) RegisterJobDefinition(_ context.Context, input *RegisterJobDefinitionInput) (*JobDefinition, error)

RegisterJobDefinition registers a new job definition.

func (*MemoryStorage) SubmitJob

func (s *MemoryStorage) SubmitJob(_ context.Context, input *SubmitJobInput) (*Job, error)

SubmitJob submits a new job.

func (*MemoryStorage) TerminateJob

func (s *MemoryStorage) TerminateJob(_ context.Context, jobID, reason string) error

TerminateJob terminates a job.

func (*MemoryStorage) UnmarshalJSON added in v0.6.0

func (s *MemoryStorage) UnmarshalJSON(data []byte) error

UnmarshalJSON restores the storage state from JSON.

type MountPoint

type MountPoint struct {
	ContainerPath string `json:"containerPath,omitempty"`
	ReadOnly      bool   `json:"readOnly,omitempty"`
	SourceVolume  string `json:"sourceVolume,omitempty"`
}

MountPoint represents a mount point.

type NetworkConfiguration

type NetworkConfiguration struct {
	AssignPublicIP string `json:"assignPublicIp,omitempty"`
}

NetworkConfiguration represents network configuration.

type NetworkInterface

type NetworkInterface struct {
	AttachmentID       string `json:"attachmentId,omitempty"`
	Ipv6Address        string `json:"ipv6Address,omitempty"`
	PrivateIpv4Address string `json:"privateIpv4Address,omitempty"`
}

NetworkInterface represents a network interface.

type NodeDetails

type NodeDetails struct {
	IsMainNode bool  `json:"isMainNode,omitempty"`
	NodeIndex  int32 `json:"nodeIndex,omitempty"`
}

NodeDetails represents node details.

type NodeOverrides

type NodeOverrides struct {
	NodePropertyOverrides []NodePropertyOverride `json:"nodePropertyOverrides,omitempty"`
	NumNodes              int32                  `json:"numNodes,omitempty"`
}

NodeOverrides represents node overrides.

type NodeProperties

type NodeProperties struct {
	MainNode            int32               `json:"mainNode,omitempty"`
	NodeRangeProperties []NodeRangeProperty `json:"nodeRangeProperties,omitempty"`
	NumNodes            int32               `json:"numNodes,omitempty"`
}

NodeProperties represents node properties for multi-node parallel jobs.

type NodePropertyOverride

type NodePropertyOverride struct {
	ContainerOverrides *ContainerOverrides `json:"containerOverrides,omitempty"`
	TargetNodes        string              `json:"targetNodes,omitempty"`
}

NodePropertyOverride represents a node property override.

type NodeRangeProperty

type NodeRangeProperty struct {
	Container   *ContainerProperties `json:"container,omitempty"`
	TargetNodes string               `json:"targetNodes,omitempty"`
}

NodeRangeProperty represents a node range property.

type Option added in v0.6.0

type Option func(*MemoryStorage)

Option is a configuration option for MemoryStorage.

func WithDataDir added in v0.6.0

func WithDataDir(dir string) Option

WithDataDir enables persistent storage in the specified directory.

type RegisterJobDefinitionInput

type RegisterJobDefinitionInput struct {
	ContainerProperties  *ContainerProperties `json:"containerProperties,omitempty"`
	EksProperties        *EksProperties       `json:"eksProperties,omitempty"`
	JobDefinitionName    string               `json:"jobDefinitionName"`
	NodeProperties       *NodeProperties      `json:"nodeProperties,omitempty"`
	Parameters           map[string]string    `json:"parameters,omitempty"`
	PlatformCapabilities []string             `json:"platformCapabilities,omitempty"`
	PropagateTags        bool                 `json:"propagateTags,omitempty"`
	RetryStrategy        *RetryStrategy       `json:"retryStrategy,omitempty"`
	SchedulingPriority   int32                `json:"schedulingPriority,omitempty"`
	Tags                 map[string]string    `json:"tags,omitempty"`
	Timeout              *JobTimeout          `json:"timeout,omitempty"`
	Type                 string               `json:"type"`
}

RegisterJobDefinitionInput is the request for RegisterJobDefinition.

type RegisterJobDefinitionOutput

type RegisterJobDefinitionOutput struct {
	JobDefinitionARN  string `json:"jobDefinitionArn,omitempty"`
	JobDefinitionName string `json:"jobDefinitionName,omitempty"`
	Revision          int32  `json:"revision,omitempty"`
}

RegisterJobDefinitionOutput is the response for RegisterJobDefinition.

type ResourceRequirement

type ResourceRequirement struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

ResourceRequirement represents a resource requirement.

type RetryStrategy

type RetryStrategy struct {
	Attempts       int32            `json:"attempts,omitempty"`
	EvaluateOnExit []EvaluateOnExit `json:"evaluateOnExit,omitempty"`
}

RetryStrategy represents a retry strategy.

type RuntimePlatform

type RuntimePlatform struct {
	CPUArchitecture       string `json:"cpuArchitecture,omitempty"`
	OperatingSystemFamily string `json:"operatingSystemFamily,omitempty"`
}

RuntimePlatform represents a runtime platform.

type Secret

type Secret struct {
	Name      string `json:"name,omitempty"`
	ValueFrom string `json:"valueFrom,omitempty"`
}

Secret represents a secret.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service implements the Batch service.

func New

func New(storage Storage) *Service

New creates a new Batch service.

func (*Service) Close added in v0.6.0

func (s *Service) Close() error

Close saves the storage state if persistence is enabled.

func (*Service) CreateComputeEnvironment

func (s *Service) CreateComputeEnvironment(w http.ResponseWriter, r *http.Request)

CreateComputeEnvironment handles the CreateComputeEnvironment operation.

func (*Service) CreateJobQueue

func (s *Service) CreateJobQueue(w http.ResponseWriter, r *http.Request)

CreateJobQueue handles the CreateJobQueue operation.

func (*Service) DeleteComputeEnvironment

func (s *Service) DeleteComputeEnvironment(w http.ResponseWriter, r *http.Request)

DeleteComputeEnvironment handles the DeleteComputeEnvironment operation.

func (*Service) DeleteJobQueue

func (s *Service) DeleteJobQueue(w http.ResponseWriter, r *http.Request)

DeleteJobQueue handles the DeleteJobQueue operation.

func (*Service) DescribeComputeEnvironments

func (s *Service) DescribeComputeEnvironments(w http.ResponseWriter, r *http.Request)

DescribeComputeEnvironments handles the DescribeComputeEnvironments operation.

func (*Service) DescribeJobQueues

func (s *Service) DescribeJobQueues(w http.ResponseWriter, r *http.Request)

DescribeJobQueues handles the DescribeJobQueues operation.

func (*Service) DescribeJobs

func (s *Service) DescribeJobs(w http.ResponseWriter, r *http.Request)

DescribeJobs handles the DescribeJobs operation.

func (*Service) Name

func (s *Service) Name() string

Name returns the service name.

func (*Service) RegisterJobDefinition

func (s *Service) RegisterJobDefinition(w http.ResponseWriter, r *http.Request)

RegisterJobDefinition handles the RegisterJobDefinition operation.

func (*Service) RegisterRoutes

func (s *Service) RegisterRoutes(r service.Router)

RegisterRoutes registers the Batch routes. Batch uses REST JSON protocol with paths like /v1/createcomputeenvironment.

func (*Service) SubmitJob

func (s *Service) SubmitJob(w http.ResponseWriter, r *http.Request)

SubmitJob handles the SubmitJob operation.

func (*Service) TerminateJob

func (s *Service) TerminateJob(w http.ResponseWriter, r *http.Request)

TerminateJob handles the TerminateJob operation.

type Storage

type Storage interface {
	CreateComputeEnvironment(ctx context.Context, input *CreateComputeEnvironmentInput) (*ComputeEnvironment, error)
	DeleteComputeEnvironment(ctx context.Context, name string) error
	DescribeComputeEnvironments(ctx context.Context, names []string) ([]ComputeEnvironment, error)
	CreateJobQueue(ctx context.Context, input *CreateJobQueueInput) (*JobQueue, error)
	DeleteJobQueue(ctx context.Context, name string) error
	DescribeJobQueues(ctx context.Context, names []string) ([]JobQueue, error)
	RegisterJobDefinition(ctx context.Context, input *RegisterJobDefinitionInput) (*JobDefinition, error)
	SubmitJob(ctx context.Context, input *SubmitJobInput) (*Job, error)
	DescribeJobs(ctx context.Context, jobIDs []string) ([]Job, error)
	TerminateJob(ctx context.Context, jobID, reason string) error
}

Storage defines the interface for Batch storage operations.

type SubmitJobInput

type SubmitJobInput struct {
	ArrayProperties            *ArrayProperties       `json:"arrayProperties,omitempty"`
	ContainerOverrides         *ContainerOverrides    `json:"containerOverrides,omitempty"`
	DependsOn                  []JobDependency        `json:"dependsOn,omitempty"`
	EksPropertiesOverride      *EksPropertiesOverride `json:"eksPropertiesOverride,omitempty"`
	JobDefinition              string                 `json:"jobDefinition"`
	JobName                    string                 `json:"jobName"`
	JobQueue                   string                 `json:"jobQueue"`
	NodeOverrides              *NodeOverrides         `json:"nodeOverrides,omitempty"`
	Parameters                 map[string]string      `json:"parameters,omitempty"`
	PropagateTags              bool                   `json:"propagateTags,omitempty"`
	RetryStrategy              *RetryStrategy         `json:"retryStrategy,omitempty"`
	SchedulingPriorityOverride int32                  `json:"schedulingPriorityOverride,omitempty"`
	ShareIdentifier            string                 `json:"shareIdentifier,omitempty"`
	Tags                       map[string]string      `json:"tags,omitempty"`
	Timeout                    *JobTimeout            `json:"timeout,omitempty"`
}

SubmitJobInput is the request for SubmitJob.

type SubmitJobOutput

type SubmitJobOutput struct {
	JobARN  string `json:"jobArn,omitempty"`
	JobID   string `json:"jobId,omitempty"`
	JobName string `json:"jobName,omitempty"`
}

SubmitJobOutput is the response for SubmitJob.

type TerminateJobInput

type TerminateJobInput struct {
	JobID  string `json:"jobId"`
	Reason string `json:"reason"`
}

TerminateJobInput is the request for TerminateJob.

type Tmpfs

type Tmpfs struct {
	ContainerPath string   `json:"containerPath,omitempty"`
	MountOptions  []string `json:"mountOptions,omitempty"`
	Size          int32    `json:"size,omitempty"`
}

Tmpfs represents a tmpfs mount.

type Ulimit

type Ulimit struct {
	HardLimit int32  `json:"hardLimit,omitempty"`
	Name      string `json:"name,omitempty"`
	SoftLimit int32  `json:"softLimit,omitempty"`
}

Ulimit represents a ulimit.

type UpdatePolicy

type UpdatePolicy struct {
	JobExecutionTimeoutMinutes int64 `json:"jobExecutionTimeoutMinutes,omitempty"`
	TerminateJobsOnUpdate      bool  `json:"terminateJobsOnUpdate,omitempty"`
}

UpdatePolicy represents an update policy.

type Volume

type Volume struct {
	EfsVolumeConfiguration *EfsVolumeConfiguration `json:"efsVolumeConfiguration,omitempty"`
	Host                   *Host                   `json:"host,omitempty"`
	Name                   string                  `json:"name,omitempty"`
}

Volume represents a volume.

Jump to

Keyboard shortcuts

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