forked from GoogleCloudPlatform/ramble
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial proof of concept for workload_groups
This change add a new directive: `workload_groups` It is intended to give the user a way to group workloads together, and unlocks a key CUJ where inherited applications want to apply variables defined in parent classes
- Loading branch information
Showing
4 changed files
with
156 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
var/ramble/repos/builtin.mock/applications/workload-groups-inherited/application.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2022-2024 The Ramble Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
from ramble.appkit import * | ||
|
||
from ramble.app.builtin.mock.workload_groups import WorkloadGroups | ||
|
||
|
||
class WorkloadGroupsInherited(WorkloadGroups): | ||
name = "workload-groups-inherited" | ||
|
||
workload('test_wl3', executable='baz') | ||
|
||
# Test populated group applies existing vars to new workload | ||
workload_group('test_wlg', | ||
workloads=['test_wl3'], | ||
mode='append') |
32 changes: 32 additions & 0 deletions
32
var/ramble/repos/builtin.mock/applications/workload-groups/application.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2022-2024 The Ramble Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
from ramble.appkit import * | ||
|
||
|
||
class WorkloadGroups(ExecutableApplication): | ||
name = "workload-groups" | ||
|
||
executable('foo', 'echo "bar"', use_mpi=False) | ||
executable('bar', 'echo "baz"', use_mpi=False) | ||
|
||
workload('test_wl', executable='foo') | ||
workload('test_wl2', executable='bar') | ||
|
||
# Test empty group | ||
workload_group('empty', | ||
workloads=[]) | ||
|
||
# Test populated group | ||
workload_group('test_wlg', | ||
workloads=['test_wl', 'test_wl2']) | ||
|
||
# Test workload_variable that uses a group | ||
workload_variable('test_var', default='2.0', | ||
description='Test workload vars and groups', | ||
workload_group='test_wlg') |