-
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 #5 from compspec/add-python-example
example: running from within python
- Loading branch information
Showing
8 changed files
with
115 additions
and
9 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
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,54 @@ | ||
version: 1 | ||
resources: | ||
- count: 4 | ||
type: node | ||
with: | ||
- count: 1 | ||
label: fractal-descriptive | ||
type: slot | ||
with: | ||
- count: 4 | ||
type: core | ||
|
||
task: | ||
transform: | ||
- step: write | ||
filename: install.sh | ||
- step: submit | ||
filename: install.sh | ||
wait: true | ||
- step: write | ||
filename: job.sh | ||
- step: submit | ||
filename: job.sh | ||
|
||
scripts: | ||
- name: install.sh | ||
content: | | ||
#!/bin/bash | ||
echo "This is an install step" | ||
- name: job.sh | ||
content: | | ||
#!/bin/bash | ||
echo "This is task ${FLUX_TASK_RANK}" | ||
if [[ "${FLUX_TASK_RANK}" == "0" ]]; then | ||
echo "Hello I am the leader: $(hostname)" | ||
else | ||
echo "Hello I am a follower: $(hostname)" | ||
fi | ||
count: | ||
per_slot: 1 | ||
resources: | ||
hardware: | ||
hardware.gpu.available: 'no' | ||
software: | ||
go: "1.20" | ||
io.archspec: | ||
cpu.target: amd64 | ||
os: | ||
os.name: Ubuntu 22.04.3 LTS | ||
os.release: 22.04.3 | ||
os.vendor: ubuntu | ||
slot: fractal-descriptive |
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 @@ | ||
import os | ||
from jobspec.plugin import get_transformer_registry | ||
|
||
here = os.path.abspath(os.path.dirname(__file__)) | ||
jobspec_file = os.path.join(here, "jobspec.yaml") | ||
|
||
def main(): | ||
|
||
# Get the registry | ||
registry = get_transformer_registry() | ||
|
||
# The cool thing about transformers is that you can have | ||
# one tiny server that acts an an interface to several cloud (or other) | ||
# APIs. A transformer doesn't have to be for cluster batch, it could | ||
# be for an API to an emphemeral resource | ||
plugin = registry.get_plugin("flux")() | ||
|
||
# Run the plugin with the jobspec | ||
plugin.run(jobspec_file) | ||
|
||
if __name__ == "__main__": | ||
main() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,4 +1,4 @@ | ||
__version__ = "0.0.1" | ||
__version__ = "0.0.11" | ||
AUTHOR = "Vanessa Sochat" | ||
AUTHOR_EMAIL = "[email protected]" | ||
NAME = "jobspec" | ||
|