Skip to content

Commit a58c578

Browse files
authored
Fixes on publish studies handling (#1632)
* Increases pool size in storage and webserver services * Fixes typo * Fixes typo in webclient * renamed variables
1 parent 18fa7aa commit a58c578

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

services/director/src/simcore_service_director/producer.py

+13-9
Original file line numberDiff line numberDiff line change
@@ -439,31 +439,34 @@ async def _get_service_state(
439439
tasks = await client.tasks.list(filters={"service": service_name})
440440
# only keep the ones with the right service ID (we're being a bit picky maybe)
441441
tasks = [x for x in tasks if x["ServiceID"] == service["ID"]]
442+
442443
# we are only interested in the last task which has index 0
443444
if tasks:
444445
last_task = tasks[0]
445446
task_state = last_task["Status"]["State"]
446447
log.debug("%s %s", service["ID"], task_state)
447-
simcore_state = ServiceState.STARTING
448-
simcore_message = (
448+
449+
last_task_state = ServiceState.STARTING # default
450+
last_task_error_msg = (
449451
last_task["Status"]["Err"] if "Err" in last_task["Status"] else ""
450452
)
451453
if task_state in ("failed", "rejected"):
452454
log.error(
453455
"service %s failed with %s", service_name, last_task["Status"]
454456
)
455-
simcore_state = ServiceState.FAILED
457+
last_task_state = ServiceState.FAILED
456458
elif task_state in ("pending"):
457-
simcore_state = ServiceState.PENDING
459+
last_task_state = ServiceState.PENDING
458460
elif task_state in ("assigned", "accepted", "preparing"):
459-
simcore_state = ServiceState.PULLING
461+
last_task_state = ServiceState.PULLING
460462
elif task_state in ("ready", "starting"):
461-
simcore_state = ServiceState.STARTING
463+
last_task_state = ServiceState.STARTING
462464
elif task_state in ("running"):
463-
simcore_state = ServiceState.RUNNING
465+
last_task_state = ServiceState.RUNNING
464466
elif task_state in ("complete", "shutdown"):
465-
simcore_state = ServiceState.COMPLETE
466-
return (simcore_state, simcore_message)
467+
last_task_state = ServiceState.COMPLETE
468+
return (last_task_state, last_task_error_msg)
469+
467470
# allows dealing with other events instead of wasting time here
468471
await asyncio.sleep(1) # 1s
469472
log.debug("Waited for service %s to start", service_name)
@@ -600,6 +603,7 @@ async def _start_docker_service(
600603
service = await client.services.inspect(service["ID"])
601604
service_name = service["Spec"]["Name"]
602605
service_state, service_msg = await _get_service_state(client, service)
606+
603607
# wait for service to start
604608
# await _wait_until_service_running_or_failed(client, service, node_uuid)
605609
log.debug("Service %s successfully started", service_name)

services/storage/src/simcore_service_storage/data/docker-prod-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ postgres:
1515
password: ${POSTGRES_PASSWORD}
1616
host: ${POSTGRES_HOST}
1717
port: ${POSTGRES_PORT}
18-
minsize: 4
19-
maxsize: 4
18+
minsize: 10
19+
maxsize: 15
2020
s3:
2121
endpoint: ${S3_ENDPOINT}
2222
access_key: ${S3_ACCESS_KEY}

services/web/client/source/class/osparc/dashboard/StudyBrowser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
230230
},
231231

232232
__getStudyAndStart: function(loadStudyId) {
233-
osparc.store.Store.getStudyWState(loadStudyId, true)
233+
osparc.store.Store.getInstance().getStudyWState(loadStudyId, true)
234234
.then(studyData => {
235235
this.__startStudy(studyData);
236236
})

services/web/server/src/simcore_service_webserver/computation_comp_tasks_listening_task.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ async def listen(app: web.Application):
8181
task_output = node_data["outputs"]
8282
node_id = node_data["node_id"]
8383
project_id = node_data["project_id"]
84+
8485
# FIXME: we do not know who triggered these changes. we assume the user had the rights to do so
8586
# therefore we'll use the prj_owner user id. This should be fixed when the new sidecar comes in
8687
# and comp_tasks/comp_pipeline get deprecated.
@@ -89,7 +90,7 @@ async def listen(app: web.Application):
8990
result = await conn.execute(
9091
select([projects]).where(projects.c.uuid == project_id)
9192
)
92-
the_project: RowProxy = result.fetchone()
93+
the_project: RowProxy = await result.fetchone()
9394
if not the_project:
9495
log.warning(
9596
"Project %s was not found and cannot be updated", project_id

services/web/server/src/simcore_service_webserver/config/server-docker-prod.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ db:
3131
password: ${POSTGRES_PASSWORD}
3232
host: ${POSTGRES_HOST}
3333
port: ${POSTGRES_PORT}
34-
minsize: 4
34+
minsize: 10
3535
maxsize: 15
3636
resource_manager:
3737
enabled: True

0 commit comments

Comments
 (0)