Skip to content

Commit 3032d16

Browse files
committed
feat: add script namer for custom name
Signed-off-by: vsoch <[email protected]>
1 parent b99e771 commit 3032d16

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fractale/transformer/flux/workload.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33

44
from fractale.logger import LogColors
5+
from fractale.logger.generate import JobNamer
56
from fractale.transformer.base import TransformerBase
67

78

@@ -17,6 +18,7 @@ def run(self, matches, jobspec):
1718
"""
1819
Parse the jobspec into tasks for flux.
1920
"""
21+
namer = JobNamer()
2022
# Here we want to group by cluster
2123
# We need to artificially parse the match metadata
2224
# This is handled by the solver, because each solver can
@@ -41,8 +43,12 @@ def run(self, matches, jobspec):
4143

4244
# I'm going to be careful about updating files
4345
files = jobspec["attributes"]["system"].get("files") or {}
44-
files["batch-script"] = data
46+
47+
# Generate a name for the script
48+
script_name = namer.generate() + ".sh"
49+
files[script_name] = data
4550
jobspec["attributes"]["system"]["files"] = files
51+
jobspec["tasks"][0]["command"] = ["/bin/bash", f"./{script_name}"]
4652
yield jobspec
4753

4854
@property

0 commit comments

Comments
 (0)