def __init__(self, redis_name, redis_port): self.admin = HamsConnection(DockerContainerManager()) self.mutex = Lock() #self.redis_name=redis_name #self.redis_port=redis_port self.redis_client = redis_client.RedisClient(self.admin.logger, redis_name, redis_port)
def signal_handler(signal, frame): print("Stopping Hams...") hams_conn = HamsConnection(DockerContainerManager()) hams_conn.stop_all() sys.exit(0)
import numpy as np import signal import sys # Stop Hams on Ctrl-C def signal_handler(signal, frame): print("Stopping Hams...") hams_conn = HamsConnection(DockerContainerManager()) hams_conn.stop_all() sys.exit(0) if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) hams_conn = HamsConnection(DockerContainerManager()) hams_conn.start_hams() f = open("../applications/simpledag/dag_description", "r") dag_description = f.read() f.close() hams_conn.deploy_DAG("simpledag", "test", dag_description) #time.sleep(2) # For batch inputs set this number > 1 # batch_size = 1 # try: # while True:
from __future__ import print_function from hams_admin import HamsConnection, DockerContainerManager from hams_admin.deployers import python as python_deployer import json import requests from datetime import datetime import time import numpy as np import signal import sys if __name__ == '__main__': hams_conn = HamsConnection(DockerContainerManager()) # python_deployer.create_endpoint(hams_conn, "simple-example", "doubles", # feature_sum) hams_conn.connect_host("202.45.128.174", "2375") hams_conn.connect_host("202.45.128.175", "2375") hams_conn.stop_all(graceful=False) time.sleep(2)
def feature_sum(xs): return [str(sum(x)) for x in xs] # Stop Hams on Ctrl-C def signal_handler(signal, frame): print("Stopping Hams...") hams_conn = HamsConnection(DockerContainerManager()) hams_conn.stop_all() sys.exit(0) if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) hams_conn = HamsConnection(DockerContainerManager()) hams_conn.start_hams() # python_deployer.create_endpoint(hams_conn, "simple-example", "doubles", # feature_sum) time.sleep(2) # For batch inputs set this number > 1 # batch_size = 1 # try: # while True: # if batch_size > 1: # predict( # hams_conn.get_query_addr(), # [list(np.random.random(200)) for i in range(batch_size)],
import json import requests from datetime import datetime import time import numpy as np import signal import sys # Stop Hams on Ctrl-C def signal_handler(signal, frame): print("Stopping Hams...") hams_conn = HamsConnection(DockerContainerManager()) hams_conn.stop_all() sys.exit(0) if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) hams_conn = HamsConnection(DockerContainerManager()) hams_conn.start_hams() f = open("../applications/translation/dag_description", "r") dag_description = f.read() f.close() hams_conn.connect_host("202.45.128.174", "2375") hams_conn.connect_host("202.45.128.175", "2375") hams_conn.deploy_DAG("translation", "test", dag_description)
import requests from datetime import datetime import time import numpy as np import signal import sys # Stop Hams on Ctrl-C def signal_handler(signal, frame): print("Stopping Hams...") hams_conn = HamsConnection(DockerContainerManager()) hams_conn.stop_all() sys.exit(0) if __name__ == '__main__': signal.signal(signal.SIGINT, signal_handler) hams_conn = HamsConnection(DockerContainerManager()) hams_conn.start_hams() f = open("../applications/Fatigue/dag_formatted_Fatigue","r") dag_description = f.read() f.close() hams_conn.deploy_DAG("Fatigue", "test", dag_description,runtime="nvidia")
from __future__ import print_function from hams_admin import HamsConnection, DockerContainerManager from hams_admin.deployers import python as python_deployer import json import requests from datetime import datetime import time import numpy as np import signal import sys if __name__ == '__main__': hams_conn = HamsConnection(DockerContainerManager()) # python_deployer.create_endpoint(hams_conn, "simple-example", "doubles", # feature_sum) hams_conn.stop_all(graceful=False) time.sleep(2)