Skip to content

Commit 47a7b96

Browse files
new build
1 parent 716247d commit 47a7b96

File tree

10 files changed

+36
-30
lines changed

10 files changed

+36
-30
lines changed

asset-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.02152627.css",
4-
"main.js": "/static/js/main.ad988b9d.js",
4+
"main.js": "/static/js/main.cea76b7b.js",
55
"static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
66
"static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
77
"static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
@@ -36,10 +36,10 @@
3636
"static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
3737
"index.html": "/index.html",
3838
"main.02152627.css.map": "/static/css/main.02152627.css.map",
39-
"main.ad988b9d.js.map": "/static/js/main.ad988b9d.js.map"
39+
"main.cea76b7b.js.map": "/static/js/main.cea76b7b.js.map"
4040
},
4141
"entrypoints": [
4242
"static/css/main.02152627.css",
43-
"static/js/main.ad988b9d.js"
43+
"static/js/main.cea76b7b.js"
4444
]
45-
}
45+
}

contrib/automations/dosing/turbidostat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fields:
1919
label: Target OD
2020
type: numeric
2121
- key: volume
22-
default: 2.0
22+
default: 1.0
2323
unit: mL
2424
label: Volume
2525
type: numeric

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.ad988b9d.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.cea76b7b.js"></script><link href="/static/css/main.02152627.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

pioreactorui/api.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ def broadcast_get_across_cluster(endpoint: str, timeout: float = 1.0, return_raw
7171
)
7272

7373

74-
def broadcast_post_across_cluster(endpoint: str, json: dict | None = None) -> Result:
74+
def broadcast_post_across_cluster(
75+
endpoint: str, json: dict | None = None, params: dict | None = None
76+
) -> Result:
7577
assert endpoint.startswith("/unit_api")
76-
return tasks.multicast_post_across_cluster(endpoint, get_all_workers(), json=json)
78+
return tasks.multicast_post_across_cluster(
79+
endpoint, get_all_workers(), json=json, params=params
80+
)
7781

7882

7983
def broadcast_delete_across_cluster(endpoint: str, json: dict | None = None) -> Result:
@@ -91,7 +95,7 @@ def stop_all_jobs_in_experiment(experiment: str) -> ResponseReturnValue:
9195
"""Kills all jobs for workers assigned to experiment"""
9296
workers_in_experiment = get_all_workers_in_experiment(experiment)
9397
tasks.multicast_post_across_cluster(
94-
f"/unit_api/jobs/stop", workers_in_experiment, params={'experiment': experiment}
98+
"/unit_api/jobs/stop", workers_in_experiment, params={"experiment": experiment}
9599
)
96100

97101
# sometimes the leader isn't part of the experiment, but a profile associated with the experiment is running:
@@ -109,17 +113,17 @@ def stop_all_jobs_on_worker_for_experiment(
109113
) -> ResponseReturnValue:
110114
"""Kills all jobs for worker assigned to experiment"""
111115
if pioreactor_unit == UNIVERSAL_IDENTIFIER:
112-
broadcast_post_across_cluster(f"/unit_api/jobs/stop", params={'experiment': experiment})
116+
broadcast_post_across_cluster("/unit_api/jobs/stop", params={"experiment": experiment})
113117
else:
114118
tasks.multicast_post_across_cluster(
115-
f"/unit_api/jobs/stop", [pioreactor_unit], params={'experiment': experiment}
119+
"/unit_api/jobs/stop", [pioreactor_unit], params={"experiment": experiment}
116120
)
117121

118122
return Response(status=202)
119123

120124

121125
@api.route(
122-
"/workers/<pioreactor_unit>/jobs/stop/job_name/<job>/experiments/<experiment>",
126+
"/workers/<pioreactor_unit>/jobs/stop/job_name/<job_name>/experiments/<experiment>",
123127
methods=["PATCH", "POST"],
124128
)
125129
@api.route(
@@ -137,7 +141,7 @@ def stop_job_on_unit(pioreactor_unit: str, experiment: str, job_name: str) -> Re
137141
except Exception:
138142
# TODO: make this $broadcastable
139143
tasks.multicast_post_across_cluster(
140-
f"/unit_api/jobs/stop", [pioreactor_unit], params={'job_name': job_name}
144+
"/unit_api/jobs/stop", [pioreactor_unit], params={"job_name": job_name}
141145
)
142146
abort(500)
143147

@@ -480,15 +484,15 @@ def get_logs_for_unit(pioreactor_unit: str) -> ResponseReturnValue:
480484
def publish_new_log(pioreactor_unit: str, experiment: str) -> ResponseReturnValue:
481485
body = request.get_json()
482486

483-
topic = f"pioreactor/{pioreactor_unit}/{experiment}/logs/ui/info"
487+
topic = f"pioreactor/{pioreactor_unit}/{experiment}/logs/ui/{body['level'].lower()}"
484488
client.publish(
485489
topic,
486490
msg_to_JSON(
487491
msg=body["message"],
488-
source="user",
489-
level="INFO",
492+
source=body["source"],
493+
level=body["level"].upper(),
490494
timestamp=body["timestamp"],
491-
task=body["source"] or "",
495+
task=body["task"] or "",
492496
),
493497
)
494498
return Response(status=202)
@@ -1261,7 +1265,7 @@ def create_experiment() -> ResponseReturnValue:
12611265
@api.route("/experiments/<experiment>", methods=["DELETE"])
12621266
def delete_experiment(experiment: str) -> ResponseReturnValue:
12631267
row_count = modify_app_db("DELETE FROM experiments WHERE experiment=?;", (experiment,))
1264-
broadcast_post_across_cluster(f"/unit_api/jobs/stop", params={"experiment": experiment})
1268+
broadcast_post_across_cluster("/unit_api/jobs/stop", params={"experiment": experiment})
12651269

12661270
if row_count > 0:
12671271
return Response(status=200)
@@ -2089,7 +2093,7 @@ def remove_worker_from_experiment(experiment: str, pioreactor_unit: str) -> Resp
20892093
)
20902094
if row_count > 0:
20912095
tasks.multicast_post_across_cluster(
2092-
f"/unit_api/jobs/stop", [pioreactor_unit], params={'experiment': experiment}
2096+
"/unit_api/jobs/stop", [pioreactor_unit], params={"experiment": experiment}
20932097
)
20942098
publish_to_experiment_log(
20952099
f"Removed {pioreactor_unit} from {experiment}.",
@@ -2109,7 +2113,7 @@ def remove_workers_from_experiment(experiment: str) -> ResponseReturnValue:
21092113
"DELETE FROM experiment_worker_assignments WHERE experiment = ?",
21102114
(experiment,),
21112115
)
2112-
task = broadcast_post_across_cluster(f"/unit_api/jobs/stop", params={'experiment': experiment})
2116+
task = broadcast_post_across_cluster("/unit_api/jobs/stop", params={"experiment": experiment})
21132117
publish_to_experiment_log(
21142118
f"Removed all workers from {experiment}.",
21152119
experiment=experiment,

pioreactorui/structs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ class BackgroundJobDescriptor(Struct, forbid_unknown_fields=True): # type: igno
3737
class AutomationFieldsDescriptor(Struct, forbid_unknown_fields=True): # type: ignore
3838
key: str
3939
default: t.Union[str, float, int, None]
40-
unit: t.Optional[str]
4140
label: str
4241
disabled: bool = False
42+
unit: t.Optional[str] = None
4343
type: t.Literal["numeric", "string"] = "numeric" # TODO we will include boolean
4444

4545

pioreactorui/tasks.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,11 @@ def write_config_and_sync(
336336

337337

338338
@huey.task(priority=10)
339-
def post_to_worker(worker: str, endpoint: str, json: dict | None = None) -> tuple[str, Any]:
339+
def post_to_worker(
340+
worker: str, endpoint: str, json: dict | None = None, params: dict | None = None
341+
) -> tuple[str, Any]:
340342
try:
341-
r = post_into(resolve_to_address(worker), endpoint, json=json, timeout=1)
343+
r = post_into(resolve_to_address(worker), endpoint, json=json, params=params, timeout=1)
342344
r.raise_for_status()
343345
return worker, r.json()
344346
except (HTTPErrorStatus, HTTPException) as e:
@@ -355,12 +357,12 @@ def post_to_worker(worker: str, endpoint: str, json: dict | None = None) -> tupl
355357

356358
@huey.task(priority=5)
357359
def multicast_post_across_cluster(
358-
endpoint: str, workers: list[str], json: dict | None = None
360+
endpoint: str, workers: list[str], json: dict | None = None, params: dict | None = None
359361
) -> dict[str, Any]:
360362
# this function "consumes" one huey thread waiting fyi
361363
assert endpoint.startswith("/unit_api")
362364

363-
tasks = post_to_worker.map(((worker, endpoint, json) for worker in workers))
365+
tasks = post_to_worker.map(((worker, endpoint, json, params) for worker in workers))
364366

365367
return {
366368
worker: response for (worker, response) in tasks.get(blocking=True, timeout=30)

static/js/main.ad988b9d.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/main.cea76b7b.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)