Skip to content

Commit b089b78

Browse files
author
Andrei Neagu
committed
Merge remote-tracking branch 'upstream/master' into pr-osparc-rabbit-replace-x-death
2 parents 3c5d301 + 26bc00b commit b089b78

File tree

28 files changed

+432
-133
lines changed

28 files changed

+432
-133
lines changed

.env-devel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ WEBSERVER_PROJECTS={}
395395
WEBSERVER_PROMETHEUS_API_VERSION=v1
396396
WEBSERVER_PROMETHEUS_URL=http://prometheus:9090
397397
WEBSERVER_PUBLICATIONS=1
398+
WEBSERVER_REALTIME_COLLABORATION='{"RTC_MAX_NUMBER_OF_USERS":3}'
398399
WEBSERVER_SCICRUNCH={}
399400
WEBSERVER_SESSION_SECRET_KEY='REPLACE_ME_with_result__Fernet_generate_key='
400401
WEBSERVER_SOCKETIO=1

packages/postgres-database/docker/Dockerfile

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,5 @@ COPY entrypoint.bash /home/entrypoint.bash
5555

5656
RUN chmod +x /home/entrypoint.bash
5757

58-
ENV POSTGRES_USER=scu \
59-
POSTGRES_PASSWORD=adminadmin \
60-
POSTGRES_HOST=postgres \
61-
POSTGRES_PORT=5432 \
62-
POSTGRES_DB=simcoredb
63-
6458
ENTRYPOINT [ "/bin/bash", "/home/entrypoint.bash" ]
6559
CMD [ "sc-pg", "upgrade" ]

services/dask-sidecar/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG PYTHON_VERSION="3.11.9"
55
ARG UV_VERSION="0.7"
66
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
77
# we docker image is built based on debian
8-
FROM --platform=${TARGETPLATFORM} python:${PYTHON_VERSION}-slim-bookworm AS base
8+
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
99
ARG TARGETPLATFORM
1010
ARG BUILDPLATFORM
1111
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log

services/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ services:
673673
SWARM_STACK_NAME: ${SWARM_STACK_NAME}
674674

675675
WEBSERVER_DEV_FEATURES_ENABLED: ${WEBSERVER_DEV_FEATURES_ENABLED}
676+
WEBSERVER_REALTIME_COLLABORATION: ${WEBSERVER_REALTIME_COLLABORATION}
676677

677678
WEBSERVER_LOGLEVEL: ${WEBSERVER_LOGLEVEL}
678679
WEBSERVER_PROFILING: ${WEBSERVER_PROFILING}

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/outputs/_manager.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def __init__(
118118

119119
self._port_key_tracker = _PortKeyTracker()
120120
self._task_uploading: Task | None = None
121+
self._task_uploading_followup: Task | None = None
121122
self._task_scheduler_worker: Task | None = None
122123
self._schedule_all_ports_for_upload: bool = False
123124

@@ -171,14 +172,22 @@ def _remove_downloads(future: Future) -> None:
171172
except Exception as e: # pylint: disable=broad-except
172173
self._last_upload_error_tracker[port_key] = e
173174

174-
create_task(self._port_key_tracker.remove_all_uploading())
175+
self._task_uploading_followup = create_task(
176+
self._port_key_tracker.remove_all_uploading()
177+
)
175178

176179
self._task_uploading.add_done_callback(_remove_downloads)
177180

178181
async def _uploading_task_cancel(self) -> None:
179182
if self._task_uploading is not None:
180183
await _cancel_task(self._task_uploading, self.task_cancellation_timeout_s)
181184
await self._port_key_tracker.move_all_uploading_to_pending()
185+
self._task_uploading = None
186+
if self._task_uploading_followup is not None:
187+
await _cancel_task(
188+
self._task_uploading_followup, self.task_cancellation_timeout_s
189+
)
190+
self._task_uploading_followup = None
182191

183192
async def _scheduler_worker(self) -> None:
184193
if await self._port_key_tracker.are_pending_ports_uploading():

services/migration/Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,7 @@ FROM base AS production
8484

8585
ENV PYTHONOPTIMIZE=TRUE
8686

87-
# testing defaults
88-
ENV POSTGRES_USER=scu \
89-
POSTGRES_PASSWORD=adminadmin \
90-
POSTGRES_HOST=postgres \
91-
POSTGRES_PORT=5432 \
92-
POSTGRES_DB=simcoredb \
93-
SC_DONE_MARK_FILE=migration.done
94-
87+
ENV SC_DONE_MARK_FILE=migration.done
9588

9689
WORKDIR /home/scu
9790

services/static-webserver/client/Makefile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ compile-dev: qx_packages source-output ## qx compiles host' 'source' -> host's '
3131
# qx compile 'source' $(flags) --> 'source-output' [itisfoundation/qooxdoo-kit:${QOOXDOO_KIT_TAG}]
3232
$(docker_compose) run --detach --rm --name=$(container_name) qooxdoo-kit \
3333
qx compile $(flags) \
34+
--set-env osparc.vcsOriginUrl="${VCS_URL}" \
3435
--set-env osparc.vcsRef="${VCS_REF}" \
3536
--set-env osparc.vcsRefClient="${VCS_REF_CLIENT}" \
36-
--set-env osparc.vcsStatusClient="${VCS_STATUS_CLIENT}" \
37-
--set-env osparc.vcsOriginUrl="${VCS_URL}"
37+
--set-env osparc.vcsStatusClient="${VCS_STATUS_CLIENT}"
3838

3939
.PHONY: follow-dev-logs
4040
follow-dev-logs: ## follow the logs of the qx compiler
@@ -44,8 +44,10 @@ follow-dev-logs: ## follow the logs of the qx compiler
4444
.PHONY: compile touch upgrade
4545
compile: ## qx compiles host' 'source' -> image's 'build-output'
4646
# qx compile 'source' within $(docker_image) image [itisfoundation/qooxdoo-kit:${QOOXDOO_KIT_TAG}]
47-
@docker buildx build --file $(docker_file) --tag $(docker_image) \
47+
@docker buildx build \
4848
--load \
49+
--file $(docker_file) \
50+
--tag $(docker_image) \
4951
--build-arg tag=${QOOXDOO_KIT_TAG} \
5052
--build-arg VCS_REF=${VCS_REF} \
5153
--build-arg VCS_REF_CLIENT=${VCS_REF_CLIENT} \
@@ -56,7 +58,13 @@ compile: ## qx compiles host' 'source' -> image's 'build-output'
5658

5759
touch: ## minimal image build with /project/output-build inside
5860
# touch /project/output-build such that multi-stage 'services/web/Dockerfile' can build development target (fixes #1097)
59-
@docker buildx build --load --file $(docker_file) --tag $(docker_image) --build-arg tag=${QOOXDOO_KIT_TAG} --target=touch .
61+
@docker buildx build \
62+
--load \
63+
--file $(docker_file) \
64+
--tag $(docker_image) \
65+
--build-arg tag=${QOOXDOO_KIT_TAG} \
66+
--target=touch \
67+
.
6068

6169
upgrade: ## upgrade to official version of the tool
6270
# upgrading to ${QOOXDOO_KIT_TAG}

services/static-webserver/client/source/class/osparc/dashboard/CardBase.js

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ qx.Class.define("osparc.dashboard.CardBase", {
2424
construct: function() {
2525
this.base(arguments);
2626

27+
if (osparc.utils.DisabledPlugins.isSimultaneousAccessEnabled()) {
28+
// "IN_USE" is not a blocker anymore
29+
const inUseIdx = qx.util.PropertyUtil.getProperties(osparc.dashboard.CardBase).blocked.check.indexOf("IN_USE");
30+
if (inUseIdx > -1) {
31+
qx.util.PropertyUtil.getProperties(osparc.dashboard.CardBase).blocked.check.splice(inUseIdx, 1);
32+
}
33+
}
34+
2735
[
2836
"pointerover",
2937
"focus"
@@ -768,13 +776,22 @@ qx.Class.define("osparc.dashboard.CardBase", {
768776
},
769777

770778
__applyState: function(state) {
771-
let lockInUse = false;
779+
let projectInUse = false;
772780
if ("locked" in state && "value" in state["locked"]) {
773-
lockInUse = state["locked"]["value"];
781+
projectInUse = state["locked"]["value"];
774782
}
775-
this.setBlocked(lockInUse ? "IN_USE" : false);
776-
if (lockInUse) {
777-
this.__showBlockedCardFromStatus("IN_USE", state["locked"]);
783+
784+
if (osparc.utils.DisabledPlugins.isSimultaneousAccessEnabled()) {
785+
if (projectInUse && state["locked"]["status"] === "OPENED") {
786+
this.__showWhoIsIn(state["locked"]["owner"]);
787+
} else {
788+
this.__showWhoIsIn(null);
789+
}
790+
} else {
791+
this.setBlocked(projectInUse ? "IN_USE" : false);
792+
if (projectInUse) {
793+
this.__showBlockedCardFromStatus("IN_USE", state["locked"]);
794+
}
778795
}
779796

780797
const pipelineState = ("state" in state) ? state["state"]["value"] : undefined;
@@ -854,6 +871,30 @@ qx.Class.define("osparc.dashboard.CardBase", {
854871
});
855872
},
856873

874+
__showWhoIsIn: function(whoIsIn) {
875+
let users = [];
876+
if (whoIsIn) {
877+
// replace this once the backend returns a list of group__ids
878+
const allUsers = [
879+
{ name: "Alice", avatar: "https://i.pravatar.cc/150?img=1" },
880+
{ name: "Bob", avatar: "https://i.pravatar.cc/150?img=2" },
881+
{ name: "Charlie", avatar: "https://i.pravatar.cc/150?img=3" },
882+
{ name: "Dana", avatar: "https://i.pravatar.cc/150?img=4" },
883+
{ name: "Eve", avatar: "https://i.pravatar.cc/150?img=5" },
884+
{ name: "Frank", avatar: "https://i.pravatar.cc/150?img=6" },
885+
];
886+
// Random number of users between 1 and 6
887+
const randomCount = Math.floor(Math.random() * 6) + 1;
888+
// Shuffle the array and take the first randomCount users
889+
const shuffled = allUsers.sort(() => 0.5 - Math.random());
890+
users = shuffled.slice(0, randomCount);
891+
}
892+
if (osparc.utils.DisabledPlugins.isSimultaneousAccessEnabled() && this.getResourceType() === "study") {
893+
const avatarGroup = this.getChildControl("avatar-group");
894+
avatarGroup.setUsers(users);
895+
}
896+
},
897+
857898
__showBlockedCardFromStatus: function(reason, moreInfo) {
858899
switch (reason) {
859900
case "IN_USE":

0 commit comments

Comments
 (0)