forked from M-Labs/artiq
1
0
Fork 0

master: shorten RPC target names

This commit is contained in:
Sébastien Bourdeauducq 2024-02-27 15:20:48 +08:00
parent 3609f95207
commit 92eb3947a4
6 changed files with 15 additions and 15 deletions

View File

@ -255,7 +255,7 @@ class SimpleApplet:
if self.embed is None:
dataset_ctl = RPCClient()
self.loop.run_until_complete(dataset_ctl.connect_rpc(
self.args.server, self.args.port_control, "master_dataset_db"))
self.args.server, self.args.port_control, "dataset_db"))
self.req = AppletRequestRPC(self.loop, dataset_ctl)
else:
self.req = AppletRequestIPC(self.ipc)

View File

@ -33,7 +33,7 @@ class DatasetCtl:
try:
remote = RPCClient()
await remote.connect_rpc(self.master_host, self.master_port,
"master_dataset_db")
"dataset_db")
try:
if op_name == "set":
await remote.set(key_or_mod, value, persist, metadata)

View File

@ -127,7 +127,7 @@
"# let's connect to the master\n",
"\n",
"schedule, exps, datasets = [\n",
" Client(\"::1\", 3251, \"master_\" + i) for i in\n",
" Client(\"::1\", 3251, i) for i in\n",
" \"schedule experiment_db dataset_db\".split()]\n",
"\n",
"print(\"current schedule\")\n",

View File

@ -343,13 +343,13 @@ def main():
else:
port = 3251 if args.port is None else args.port
target_name = {
"submit": "master_schedule",
"delete": "master_schedule",
"set_dataset": "master_dataset_db",
"del_dataset": "master_dataset_db",
"scan_devices": "master_device_db",
"scan_repository": "master_experiment_db",
"ls": "master_experiment_db",
"submit": "schedule",
"delete": "schedule",
"set_dataset": "dataset_db",
"del_dataset": "dataset_db",
"scan_devices": "device_db",
"scan_repository": "experiment_db",
"ls": "experiment_db",
"terminate": "master_management",
}[action]
remote = Client(args.server, port, target_name)

View File

@ -143,7 +143,7 @@ def main():
for target in "schedule", "experiment_db", "dataset_db", "device_db":
client = AsyncioClient()
loop.run_until_complete(client.connect_rpc(
args.server, args.port_control, "master_" + target))
args.server, args.port_control, target))
atexit.register(client.close_rpc)
rpc_clients[target] = client

View File

@ -133,10 +133,10 @@ def main():
server_control = RPCServer({
"master_management": master_management,
"master_device_db": device_db,
"master_dataset_db": dataset_db,
"master_schedule": scheduler,
"master_experiment_db": experiment_db,
"device_db": device_db,
"dataset_db": dataset_db,
"schedule": scheduler,
"experiment_db": experiment_db,
}, allow_parallel=True)
loop.run_until_complete(server_control.start(
bind, args.port_control))