Class: AWSCDK::Batch::LinuxParametersProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
batch/linux_parameters_props.rb

Overview

The properties for defining Linux-specific options that are applied to the container.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(init_process_enabled: nil, max_swap: nil, shared_memory_size: nil, swappiness: nil) ⇒ LinuxParametersProps

Returns a new instance of LinuxParametersProps.

Parameters:

  • init_process_enabled (Boolean, nil) (defaults to: nil)

    Specifies whether to run an init process inside the container that forwards signals and reaps processes.

  • max_swap (AWSCDK::Size, nil) (defaults to: nil)

    The total amount of swap memory a container can use.

  • shared_memory_size (AWSCDK::Size, nil) (defaults to: nil)

    The value for the size of the /dev/shm volume.

  • swappiness (Numeric, nil) (defaults to: nil)

    This allows you to tune a container's memory swappiness behavior.



11
12
13
14
15
16
17
18
19
20
# File 'batch/linux_parameters_props.rb', line 11

def initialize(init_process_enabled: nil, max_swap: nil, shared_memory_size: nil, swappiness: nil)
  @init_process_enabled = init_process_enabled
  Jsii::Type.check_type(@init_process_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "initProcessEnabled") unless @init_process_enabled.nil?
  @max_swap = max_swap
  Jsii::Type.check_type(@max_swap, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "maxSwap") unless @max_swap.nil?
  @shared_memory_size = shared_memory_size
  Jsii::Type.check_type(@shared_memory_size, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5TaXplIn0=")), "sharedMemorySize") unless @shared_memory_size.nil?
  @swappiness = swappiness
  Jsii::Type.check_type(@swappiness, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "swappiness") unless @swappiness.nil?
end

Instance Attribute Details

#init_process_enabledBoolean? (readonly)

Note:

Default: false

Specifies whether to run an init process inside the container that forwards signals and reaps processes.

Returns:

  • (Boolean, nil)


26
27
28
# File 'batch/linux_parameters_props.rb', line 26

def init_process_enabled
  @init_process_enabled
end

#max_swapAWSCDK::Size? (readonly)

Note:

Default: No swap.

The total amount of swap memory a container can use.

This parameter will be translated to the --memory-swap option to docker run.

This parameter is only supported when you are using the EC2 launch type. Accepted values are positive integers.

Returns:



37
38
39
# File 'batch/linux_parameters_props.rb', line 37

def max_swap
  @max_swap
end

#shared_memory_sizeAWSCDK::Size? (readonly)

Note:

Default: No shared memory.

The value for the size of the /dev/shm volume.

Returns:



42
43
44
# File 'batch/linux_parameters_props.rb', line 42

def shared_memory_size
  @shared_memory_size
end

#swappinessNumeric? (readonly)

Note:

Default: 60

This allows you to tune a container's memory swappiness behavior.

This parameter maps to the --memory-swappiness option to docker run. The swappiness relates to the kernel's tendency to swap memory. A value of 0 will cause swapping to not happen unless absolutely necessary. A value of 100 will cause pages to be swapped very aggressively.

This parameter is only supported when you are using the EC2 launch type. Accepted values are whole numbers between 0 and 100. If a value is not specified for maxSwap then this parameter is ignored.

Returns:

  • (Numeric, nil)


57
58
59
# File 'batch/linux_parameters_props.rb', line 57

def swappiness
  @swappiness
end

Class Method Details

.jsii_propertiesObject



59
60
61
62
63
64
65
66
# File 'batch/linux_parameters_props.rb', line 59

def self.jsii_properties
  {
    :init_process_enabled => "initProcessEnabled",
    :max_swap => "maxSwap",
    :shared_memory_size => "sharedMemorySize",
    :swappiness => "swappiness",
  }
end

Instance Method Details

#to_jsiiObject



68
69
70
71
72
73
74
75
76
77
# File 'batch/linux_parameters_props.rb', line 68

def to_jsii
  result = {}
  result.merge!({
    "initProcessEnabled" => @init_process_enabled,
    "maxSwap" => @max_swap,
    "sharedMemorySize" => @shared_memory_size,
    "swappiness" => @swappiness,
  })
  result.compact
end