Class: Google::Apis::BatchV1::TaskGroup

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/batch_v1/classes.rb,
lib/google/apis/batch_v1/representations.rb,
lib/google/apis/batch_v1/representations.rb

Overview

A TaskGroup defines one or more Tasks that all share the same TaskSpec.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ TaskGroup

Returns a new instance of TaskGroup.



2295
2296
2297
# File 'lib/google/apis/batch_v1/classes.rb', line 2295

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#nameString

Output only. TaskGroup name. The system generates this field based on parent Job name. For example: "projects/123456/locations/us-west1/jobs/job01/ taskGroups/group01". Corresponds to the JSON property name

Returns:

  • (String)


2235
2236
2237
# File 'lib/google/apis/batch_v1/classes.rb', line 2235

def name
  @name
end

#parallelismFixnum

Max number of tasks that can run in parallel. Default to min(task_count, parallel tasks per job limit). See: Job Limits. Field parallelism must be 1 if the scheduling_policy is IN_ORDER. Corresponds to the JSON property parallelism

Returns:

  • (Fixnum)


2243
2244
2245
# File 'lib/google/apis/batch_v1/classes.rb', line 2243

def parallelism
  @parallelism
end

#permissive_sshBoolean Also known as: permissive_ssh?

When true, Batch will configure SSH to allow passwordless login between VMs running the Batch tasks in the same TaskGroup. Corresponds to the JSON property permissiveSsh

Returns:

  • (Boolean)


2249
2250
2251
# File 'lib/google/apis/batch_v1/classes.rb', line 2249

def permissive_ssh
  @permissive_ssh
end

#require_hosts_fileBoolean Also known as: require_hosts_file?

When true, Batch will populate a file with a list of all VMs assigned to the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path of that file. Defaults to false. Corresponds to the JSON property requireHostsFile

Returns:

  • (Boolean)


2257
2258
2259
# File 'lib/google/apis/batch_v1/classes.rb', line 2257

def require_hosts_file
  @require_hosts_file
end

#scheduling_policyString

Scheduling policy for Tasks in the TaskGroup. The default value is AS_SOON_AS_POSSIBLE. Corresponds to the JSON property schedulingPolicy

Returns:

  • (String)


2264
2265
2266
# File 'lib/google/apis/batch_v1/classes.rb', line 2264

def scheduling_policy
  @scheduling_policy
end

#task_countFixnum

Number of Tasks in the TaskGroup. Default is 1. Corresponds to the JSON property taskCount

Returns:

  • (Fixnum)


2269
2270
2271
# File 'lib/google/apis/batch_v1/classes.rb', line 2269

def task_count
  @task_count
end

#task_count_per_nodeFixnum

Max number of tasks that can be run on a VM at the same time. If not specified, the system will decide a value based on available compute resources on a VM and task requirements. Corresponds to the JSON property taskCountPerNode

Returns:

  • (Fixnum)


2276
2277
2278
# File 'lib/google/apis/batch_v1/classes.rb', line 2276

def task_count_per_node
  @task_count_per_node
end

#task_environmentsArray<Google::Apis::BatchV1::Environment>

An array of environment variable mappings, which are passed to Tasks with matching indices. If task_environments is used then task_count should not be specified in the request (and will be ignored). Task count will be the length of task_environments. Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in addition to any environment variables set in task_environments, specifying the number of Tasks in the Task's parent TaskGroup, and the specific Task's index in the TaskGroup (0 through BATCH_TASK_COUNT - 1). Corresponds to the JSON property taskEnvironments



2288
2289
2290
# File 'lib/google/apis/batch_v1/classes.rb', line 2288

def task_environments
  @task_environments
end

#task_specGoogle::Apis::BatchV1::TaskSpec

Spec of a task Corresponds to the JSON property taskSpec



2293
2294
2295
# File 'lib/google/apis/batch_v1/classes.rb', line 2293

def task_spec
  @task_spec
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
# File 'lib/google/apis/batch_v1/classes.rb', line 2300

def update!(**args)
  @name = args[:name] if args.key?(:name)
  @parallelism = args[:parallelism] if args.key?(:parallelism)
  @permissive_ssh = args[:permissive_ssh] if args.key?(:permissive_ssh)
  @require_hosts_file = args[:require_hosts_file] if args.key?(:require_hosts_file)
  @scheduling_policy = args[:scheduling_policy] if args.key?(:scheduling_policy)
  @task_count = args[:task_count] if args.key?(:task_count)
  @task_count_per_node = args[:task_count_per_node] if args.key?(:task_count_per_node)
  @task_environments = args[:task_environments] if args.key?(:task_environments)
  @task_spec = args[:task_spec] if args.key?(:task_spec)
end