Skip to content

Commit 754d9f4

Browse files
committed
bug: flux module load/unload does not work in python
Signed-off-by: vsoch <[email protected]>
1 parent d4ad2b5 commit 754d9f4

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

ensemble/members/flux/minicluster.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,28 +61,16 @@ def grow(self, rule, record=None):
6161
"""
6262
Request to the API to grow the MiniCluster
6363
"""
64-
# We need to send over the name and namespace
6564
name = self.options["name"]
66-
namespace = self.options["namespace"]
67-
68-
# For now use the ensemble type as the name
69-
# TODO this needs to be caught and decided upon - retry?
70-
response = self.client.action_request(
71-
name=name, namespace=namespace, action="grow", payload={}
72-
)
65+
response = self.client.action_request(member=name, action="grow", payload={})
7366
print(response)
7467

7568
def shrink(self, rule, record=None):
7669
"""
7770
Request to the API to shrink the MiniCluster
7871
"""
79-
# We need to send over the name and namespace
8072
name = self.options["name"]
81-
namespace = self.options["namespace"]
82-
83-
response = self.client.action_request(
84-
name=name, namespace=namespace, action="shrink", payload={}
85-
)
73+
response = self.client.action_request(member=name, action="shrink", payload={})
8674
print(response)
8775

8876
@property

ensemble/members/flux/queue.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import shlex
23
import sys
34
import time
@@ -308,10 +309,9 @@ def setup_flux_heartbeat(self):
308309
return
309310

310311
# Customize the heartbeat duration by reloading the module
311-
self.handle.rpc("module.remove", {"name": "heartbeat"}).get()
312-
self.handle.rpc(
313-
"module.load", {"path": "heartbeat", "args": [f"period={self.cfg.heartbeat}s"]}
314-
).get()
312+
# We call to system flux since python can error
313+
assert os.system("flux module remove heartbeat") == 0
314+
assert os.system(f"flux module load heartbeat period={self.cfg.heartbeat}s") == 0
315315

316316
def heartbeat_callback(handle, msg_handler, msg, arg):
317317
print("💗 HEARTBEAT")

0 commit comments

Comments
 (0)