Class: Google::Apis::BatchV1::TaskGroup
- Inherits:
-
Object
- Object
- Google::Apis::BatchV1::TaskGroup
- 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
-
#name ⇒ String
Output only.
-
#parallelism ⇒ Fixnum
Max number of tasks that can run in parallel.
-
#permissive_ssh ⇒ Boolean
(also: #permissive_ssh?)
When true, Batch will configure SSH to allow passwordless login between VMs running the Batch tasks in the same TaskGroup.
-
#require_hosts_file ⇒ Boolean
(also: #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.
-
#run_as_non_root ⇒ Boolean
(also: #run_as_non_root?)
Optional.
-
#scheduling_policy ⇒ String
Scheduling policy for Tasks in the TaskGroup.
-
#task_count ⇒ Fixnum
Number of Tasks in the TaskGroup.
-
#task_count_per_node ⇒ Fixnum
Max number of tasks that can be run on a VM at the same time.
-
#task_environments ⇒ Array<Google::Apis::BatchV1::Environment>
An array of environment variable mappings, which are passed to Tasks with matching indices.
-
#task_spec ⇒ Google::Apis::BatchV1::TaskSpec
Spec of a task Corresponds to the JSON property
taskSpec
.
Instance Method Summary collapse
-
#initialize(**args) ⇒ TaskGroup
constructor
A new instance of TaskGroup.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ TaskGroup
Returns a new instance of TaskGroup.
2453 2454 2455 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2453 def initialize(**args) update!(**args) end |
Instance Attribute Details
#name ⇒ String
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
2383 2384 2385 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2383 def name @name end |
#parallelism ⇒ Fixnum
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
2391 2392 2393 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2391 def parallelism @parallelism end |
#permissive_ssh ⇒ Boolean 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
2397 2398 2399 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2397 def permissive_ssh @permissive_ssh end |
#require_hosts_file ⇒ Boolean 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. The host file supports up to 1000 VMs.
Corresponds to the JSON property requireHostsFile
2405 2406 2407 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2405 def require_hosts_file @require_hosts_file end |
#run_as_non_root ⇒ Boolean Also known as: run_as_non_root?
Optional. If not set or set to false, Batch uses the root user to execute
runnables. If set to true, Batch runs the runnables using a non-root user.
Currently, the non-root user Batch used is generated by OS Login. For more
information, see About OS Login.
Corresponds to the JSON property runAsNonRoot
2415 2416 2417 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2415 def run_as_non_root @run_as_non_root end |
#scheduling_policy ⇒ String
Scheduling policy for Tasks in the TaskGroup. The default value is
AS_SOON_AS_POSSIBLE.
Corresponds to the JSON property schedulingPolicy
2422 2423 2424 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2422 def scheduling_policy @scheduling_policy end |
#task_count ⇒ Fixnum
Number of Tasks in the TaskGroup. Default is 1.
Corresponds to the JSON property taskCount
2427 2428 2429 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2427 def task_count @task_count end |
#task_count_per_node ⇒ Fixnum
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
2434 2435 2436 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2434 def task_count_per_node @task_count_per_node end |
#task_environments ⇒ Array<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
2446 2447 2448 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2446 def task_environments @task_environments end |
#task_spec ⇒ Google::Apis::BatchV1::TaskSpec
Spec of a task
Corresponds to the JSON property taskSpec
2451 2452 2453 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2451 def task_spec @task_spec end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 |
# File 'lib/google/apis/batch_v1/classes.rb', line 2458 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) @run_as_non_root = args[:run_as_non_root] if args.key?(:run_as_non_root) @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 |