From e2d309650b5cef7794e270accf689ca9d0105a57 Mon Sep 17 00:00:00 2001 From: clore Date: Thu, 16 May 2024 15:17:11 +0000 Subject: [PATCH] use correct env for hive binaries --- clore_hosting/ws_interface.py | 2 +- lib/utils.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/clore_hosting/ws_interface.py b/clore_hosting/ws_interface.py index 2d7e542..cf54793 100644 --- a/clore_hosting/ws_interface.py +++ b/clore_hosting/ws_interface.py @@ -155,7 +155,7 @@ class WebSocketClient: if len(parsed_json["new_containers"]) > 0: # There should be at least one container self.containers_set = True self.containers=parsed_json["new_containers"] - log.success(container_str) + #log.success(container_str) elif "allow_oc" in parsed_json: # Enable OC self.oc_enabled=True await self.send(json.dumps({"allow_oc":True})) diff --git a/lib/utils.py b/lib/utils.py index 749dbf4..accb84a 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -91,6 +91,8 @@ def generate_random_string(length): characters = string.ascii_letters + string.digits return ''.join(random.choice(characters) for _ in range(length)) +HIVE_PATH="/hive/bin:/hive/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + def hive_set_miner_status(enabled=False): ### control miner state - OFF/ON screen_out = run_command("screen -ls") @@ -103,6 +105,6 @@ def hive_set_miner_status(enabled=False): if screen_line_parts[0].split('.',1)[1]=="miner": miner_screen_running=True if miner_screen_running and not enabled: - run_command("/hive/bin/miner stop") + run_command(f"/bin/bash -c \"PATH={HIVE_PATH} && sudo /hive/bin/miner stop\"") elif enabled and not miner_screen_running: - run_command("/hive/sbin/nvidia-oc && /hive/bin/miner start") \ No newline at end of file + run_command(f"/bin/bash -c \"PATH={HIVE_PATH} && sudo /hive/sbin/nvidia-oc && sudo /hive/bin/miner start\"") \ No newline at end of file