def del_all(self): for w in self.worker: dp_jobrun = w[0] worker_relay = w[1] worker_relay_ID = w[2] if worker_relay != None: cmd = worker_relay + "/CONFIG put relay " + worker_relay_ID ret = scdc.dataset_cmd(None, cmd, None, None) if not ret: print("error: unregistering at relay failed! (cmd: '" + cmd + "')") scdc.dataprov_close(dp_jobrun)
scdc.log_init("log_FILE", sys.stdout, sys.stderr) printmsg("scdc init") scdc.init() basepath = "rel" dp_rel = scdc.dataprov_open(basepath, "jobrun_relay") np_tcp = scdc.nodeport_open("tcp:max_connections:", 2) signal.signal(signal.SIGABRT, sighandler) signal.signal(signal.SIGTERM, sighandler) signal.signal(signal.SIGINT, sighandler) scdc.nodeport_start(np_tcp, scdc.NODEPORT_START_LOOP_UNTIL_CANCEL) # running scdc.nodeport_stop(np_tcp) scdc.nodeport_close(np_tcp) scdc.dataprov_close(dp_rel) printmsg("scdc release") scdc.release() scdc.log_release()
dp_job = scdc.dataprov_open(basepath, "jobrun", runcmd, workdir) # configure local jobrun data provider scdc.dataset_cmd(None, "scdc:///" + basepath + "/CONFIG put max_parallel_jobs 2", None, None) scdc.dataset_cmd(None, "scdc:///" + basepath + "/CONFIG put show_output 1", None, None) scdc.dataset_cmd(None, "scdc:///" + basepath + "/CONFIG put xterm 1", None, None) np_tcp = scdc.nodeport_open("tcp:max_connections:", 2) signal.signal(signal.SIGABRT, sighandler) signal.signal(signal.SIGTERM, sighandler) signal.signal(signal.SIGINT, sighandler) scdc.nodeport_start(np_tcp, scdc.NODEPORT_START_LOOP_UNTIL_CANCEL) # running scdc.nodeport_stop(np_tcp) scdc.nodeport_close(np_tcp) scdc.dataprov_close(dp_job) printmsg("scdc release") scdc.release()
# remove the data stored cmd = "rm " + target if not scdc.dataset_cmd(ds, cmd, None, None): print("ERROR: command '" + cmd + "' failed!") break else: print("removing data with command '" + cmd + "': OK") if dbstore: # become admin on db service cmd = "cd admin" if not scdc.dataset_cmd(ds, cmd, None, None): print("ERROR: command '" + cmd +"' failed!") break else: print("becoming admin with command '" + cmd + "': OK") # remove storage table (do not care whether fails or not) cmd = "rm storage_demo" scdc.dataset_cmd(ds, cmd, None, None) # close dataset scdc.dataset_close(ds); # always quit the loop and the end break scdc.dataprov_close(dpFS) scdc.dataprov_close(dpDB)
def simpat_release(): scdc.dataprov_close(simpat_dp)
Z_TRACE("start hook demo") Z_TRACE() scdc.init() dp_hook = scdc.dataprov_open("hookdemo", "hook:id", hookdemo.hook, 0x2501) if NODEPORT_TCP != None: np_tcp = scdc.nodeport_open("tcp:max_connections", 2) if NODEPORT_STREAM != None: np_stream = scdc.nodeport_open("stream:cmd_handler", cmd_handler, None) scdc.nodeport_start(np_tcp, NODEPORT_TCP) scdc.nodeport_start(np_stream, NODEPORT_STREAM) scdc.nodeport_stop(np_stream) scdc.nodeport_stop(np_tcp) scdc.nodeport_close(np_stream) scdc.nodeport_close(np_tcp) scdc.dataprov_close(dp_hook) scdc.release() #scdc.log_release() Z_TRACE("quit hook demo") Z_TRACE()
def release(self): print("release_relay:") scdc.dataprov_close(self.dp_relay)