-
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.
Merge pull request #2 from compspec/add-batch-support
feat: support for batch and stage
- Loading branch information
Showing
20 changed files
with
312 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ build | |
dist | ||
env | ||
.eggs | ||
__pycache__ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# TODO test these out on on x86, then create arm specs | ||
version: 1 | ||
resources: | ||
- count: 4 | ||
type: node | ||
with: | ||
- count: 1 | ||
label: hello-world | ||
type: slot | ||
with: | ||
- count: 4 | ||
type: core | ||
|
||
task: | ||
transform: | ||
- step: write | ||
filename: batch.sh | ||
executable: true | ||
|
||
- step: batch | ||
filename: batch.sh | ||
# wait: true | ||
|
||
scripts: | ||
- name: batch.sh | ||
content: | | ||
#!/bin/bash | ||
flux submit -N 1 --watch echo what is the meaning | ||
flux submit -N 1 --watch echo of all of this | ||
count: | ||
per_slot: 1 | ||
resources: | ||
hardware: | ||
hardware.gpu.available: 'no' | ||
io.archspec: | ||
cpu.target: amd64 | ||
slot: hello-world |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
from .empty import EmptyStep | ||
from .fileio import WriterStep |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import os | ||
import stat | ||
|
||
import jobspec.utils as utils | ||
|
||
from .base import StepBase | ||
|
||
|
||
class EmptyStep(StepBase): | ||
""" | ||
An empty step is used to declare that a step should be skipped | ||
""" | ||
|
||
def run(self, stage, *args, **kwargs): | ||
""" | ||
do nothing. | ||
""" | ||
pass |
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,21 @@ | ||
def find_resources(flat, resource, slot, last_one=False): | ||
""" | ||
Unwrap a nested resource | ||
""" | ||
# We found a dominant subsystem resource | ||
if "type" in resource and resource["type"] != "slot": | ||
flat[resource["type"]] = resource["count"] | ||
|
||
# The previous was the found slot, return | ||
if last_one: | ||
return True | ||
|
||
# We found the slot, this is where we stop | ||
if "type" in resource and resource["type"] == "slot": | ||
last_one = True | ||
|
||
# More traversing... | ||
if "with" in resource: | ||
for r in resource["with"]: | ||
find_resources(flat, r, slot, last_one) | ||
return flat |
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
Binary file not shown.
Binary file not shown.
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
Oops, something went wrong.