diff --git a/packages/models-library/src/models_library/rabbitmq_messages.py b/packages/models-library/src/models_library/rabbitmq_messages.py index 07dab962281..355389584d3 100644 --- a/packages/models-library/src/models_library/rabbitmq_messages.py +++ b/packages/models-library/src/models_library/rabbitmq_messages.py @@ -85,6 +85,7 @@ class ProgressType(StrAutoEnum): SERVICE_OUTPUTS_PULLING = auto() SERVICE_STATE_PULLING = auto() SERVICE_IMAGES_PULLING = auto() + SERVICE_CONTAINERS_STARTING = auto() SERVICE_STATE_PUSHING = auto() SERVICE_OUTPUTS_PUSHING = auto() diff --git a/packages/service-library/src/servicelib/docker_utils.py b/packages/service-library/src/servicelib/docker_utils.py index 3b3159d5916..ff5ea9fcc7e 100644 --- a/packages/service-library/src/servicelib/docker_utils.py +++ b/packages/service-library/src/servicelib/docker_utils.py @@ -176,12 +176,19 @@ async def _parse_pull_information( layer_id_to_size.setdefault( parsed_progress.id, _PulledStatus(0) ).extracted = layer_id_to_size[parsed_progress.id].size + case "already exists": + assert parsed_progress.id # nosec + layer_id_to_size.setdefault( + parsed_progress.id, _PulledStatus(0) + ).extracted = layer_id_to_size[parsed_progress.id].size + layer_id_to_size.setdefault( + parsed_progress.id, _PulledStatus(0) + ).downloaded = layer_id_to_size[parsed_progress.id].size case progress_status if any( msg in progress_status for msg in [ "status: downloaded newer image for ", "status: image is up to date for ", - "already exists", ] ): for layer_pull_status in layer_id_to_size.values(): diff --git a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py index 9c13cfc5417..e2be39b99a9 100644 --- a/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py +++ b/services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/long_running_tasks.py @@ -168,24 +168,27 @@ async def task_create_service_containers( assert shared_store.compose_spec # nosec - async with event_propagation_disabled(app), _reset_on_error(shared_store): + async with event_propagation_disabled(app), _reset_on_error( + shared_store + ), ProgressBarData( + num_steps=4, + progress_report_cb=functools.partial( + post_progress_message, + app, + ProgressType.SERVICE_CONTAINERS_STARTING, + ), + description=IDStr("starting software"), + ) as progress_bar: with log_context(_logger, logging.INFO, "load user services preferences"): if user_services_preferences.is_feature_enabled(app): await user_services_preferences.load_user_services_preferences(app) + await progress_bar.update() # removes previous pending containers progress.update(message="cleanup previous used resources") result = await docker_compose_rm(shared_store.compose_spec, settings) _raise_for_errors(result, "rm") - - progress.update(message="pulling images", percent=ProgressPercent(0.01)) - await post_sidecar_log_message( - app, "pulling service images", log_level=logging.INFO - ) - await docker_compose_pull(app, shared_store.compose_spec) - await post_sidecar_log_message( - app, "service images ready", log_level=logging.INFO - ) + await progress_bar.update() progress.update( message="creating and starting containers", percent=ProgressPercent(0.90) @@ -194,6 +197,7 @@ async def task_create_service_containers( app, "starting service containers", log_level=logging.INFO ) await _retry_docker_compose_create(shared_store.compose_spec, settings) + await progress_bar.update() progress.update( message="ensure containers are started", percent=ProgressPercent(0.95) diff --git a/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js b/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js index 00e62187c8a..27c04a156b9 100644 --- a/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js +++ b/services/static-webserver/client/source/class/osparc/data/model/NodeProgressSequence.js @@ -96,6 +96,16 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { apply: "__applyImagesPulling" }, + startingSoftware: { + check: "Object", + init: { + progressLabel: qx.locale.Manager.tr("Waiting ..."), + value: 0 + }, + nullable: false, + apply: "__applyStartingSoftware" + }, + inputsPulling: { check: "Object", init: { @@ -135,6 +145,7 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { __pullingOutputsLayout: null, __pullingStateLayout: null, __pullingImagesLayout: null, + __startingSoftwareLayout: null, __pullingInputsLayout: null, __disclaimerTimer: null, __disclaimerText: null, @@ -168,6 +179,7 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { this.setOutputsPulling(defaultVals); this.setStatePulling(defaultVals); this.setImagesPulling(defaultVals); + this.setStartingSoftware(defaultVals); this.setInputsPulling(defaultVals); }, @@ -203,6 +215,9 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { case "SERVICE_IMAGES_PULLING": this.setImagesPulling(progress); break; + case "SERVICE_CONTAINERS_STARTING": + this.setStartingSoftware(progress); + break; case "SERVICE_INPUTS_PULLING": this.setInputsPulling(progress); break; @@ -213,13 +228,14 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { this.__mainLoadingPage = new qx.ui.container.Composite(new qx.ui.layout.VBox(8)); const sequenceLoadingPage = new osparc.widget.ProgressSequence(qx.locale.Manager.tr("LOADING ...")); - const nTasks = 6; + const nTasks = 7; this.__overallProgressBar = sequenceLoadingPage.addOverallProgressBar(nTasks); this.__clusterUpScalingLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Increasing system capacity ...")); this.__pullingSidecarLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Setting up key components ...")); this.__pullingOutputsLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Retrieving your output data ...")); this.__pullingStateLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Retrieving your work ...")); this.__pullingImagesLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Installing software ...")); + this.__startingSoftwareLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Starting software ...")); this.__pullingInputsLayout = sequenceLoadingPage.addNewTask(qx.locale.Manager.tr("Retrieving your input data ...")); this.__mainLoadingPage.addAt(sequenceLoadingPage, 0, { flex: 1 @@ -298,6 +314,16 @@ qx.Class.define("osparc.data.model.NodeProgressSequence", { this.__computeOverallProgress(); }, + __applyStartingSoftware: function(value) { + if (value.value > 0) { + const defaultEndVals = this.getDefaultEndValues(); + this.setSidecarPulling(defaultEndVals); + } + osparc.widget.ProgressSequence.updateTaskProgress(this.__startingSoftwareLayout, value); + + this.__computeOverallProgress(); + }, + __applyInputsPulling: function(value) { if (value.value > 0) { const defaultEndVals = this.getDefaultEndValues();