Skip to content

Commit

Permalink
Merge branch 'master' into pr-osparc-add-folder-get
Browse files Browse the repository at this point in the history
  • Loading branch information
matusdrobuliak66 authored Aug 13, 2024
2 parents a9766a7 + 2682a07 commit b96df56
Show file tree
Hide file tree
Showing 35 changed files with 595 additions and 211 deletions.
3 changes: 3 additions & 0 deletions packages/pytest-simcore/src/pytest_simcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import pytest

# NOTE: this ensures that assertion printouts are nicely formated and complete see https://lorepirri.com/pytest-register-assert-rewrite.html
pytest.register_assert_rewrite("pytest_simcore.helpers")

__version__: str = version("pytest-simcore")


Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# pytest_simcore.docker_compose fixture module config variables
import pytest

FIXTURE_CONFIG_CORE_SERVICES_SELECTION = "pytest_simcore_core_services_selection"
FIXTURE_CONFIG_OPS_SERVICES_SELECTION = "pytest_simcore_ops_services_selection"

# NOTE: this ensures that assertion printouts are nicely formated and complete see https://lorepirri.com/pytest-register-assert-rewrite.html
pytest.register_assert_rewrite("pytest_simcore.helpers")
2 changes: 1 addition & 1 deletion requirements/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sqlalchemy<2.0

# SEE https://github.com/pytest-dev/pytest-asyncio/issues/706
# Many tests fail with `RuntimeError: There is no current event loop in thread 'MainThread'`
pytest-asyncio<0.22
pytest-asyncio<0.24

#
# Bugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def get_dynamic_proxy_spec(
f"traefik.http.routers.{scheduler_data.proxy_service_name}.entrypoints": "http",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.priority": "10",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.rule": f"hostregexp(`{scheduler_data.node_uuid}.services.{{host:.+}}`)",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.middlewares": f"{dynamic_services_scheduler_settings.SWARM_STACK_NAME}_gzip@docker, {scheduler_data.proxy_service_name}-security-headers",
f"traefik.http.routers.{scheduler_data.proxy_service_name}.middlewares": f"{dynamic_services_scheduler_settings.SWARM_STACK_NAME}_gzip@swarm, {scheduler_data.proxy_service_name}-security-headers",
"dynamic_type": "dynamic-sidecar", # tagged as dynamic service
}
| StandardSimcoreDockerLabels(
Expand Down
2 changes: 1 addition & 1 deletion services/director/src/simcore_service_director/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def _create_docker_service_params(
f"traefik.http.routers.{service_name}.rule": f"PathPrefix(`/x/{node_uuid}`)",
f"traefik.http.routers.{service_name}.entrypoints": "http",
f"traefik.http.routers.{service_name}.priority": "10",
f"traefik.http.routers.{service_name}.middlewares": f"{config.SWARM_STACK_NAME}_gzip@docker",
f"traefik.http.routers.{service_name}.middlewares": f"{config.SWARM_STACK_NAME}_gzip@swarm",
},
"networks": [internal_network_id] if internal_network_id else [],
}
Expand Down
16 changes: 8 additions & 8 deletions services/docker-compose-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ services:
environment:
- >-
REDIS_HOSTS=
resources:${REDIS_HOST}:${REDIS_PORT}:0,
locks:${REDIS_HOST}:${REDIS_PORT}:1,
validation_codes:${REDIS_HOST}:${REDIS_PORT}:2,
scheduled_maintenance:${REDIS_HOST}:${REDIS_PORT}:3,
user_notifications:${REDIS_HOST}:${REDIS_PORT}:4,
announcements:${REDIS_HOST}:${REDIS_PORT}:5,
distributed_identifiers:${REDIS_HOST}:${REDIS_PORT}:6,
deferred_tasks:${REDIS_HOST}:${REDIS_PORT}:7
resources:${REDIS_HOST}:${REDIS_PORT}:0:${REDIS_PASSWORD},
locks:${REDIS_HOST}:${REDIS_PORT}:1:${REDIS_PASSWORD},
validation_codes:${REDIS_HOST}:${REDIS_PORT}:2:${REDIS_PASSWORD},
scheduled_maintenance:${REDIS_HOST}:${REDIS_PORT}:3:${REDIS_PASSWORD},
user_notifications:${REDIS_HOST}:${REDIS_PORT}:4:${REDIS_PASSWORD},
announcements:${REDIS_HOST}:${REDIS_PORT}:5:${REDIS_PASSWORD},
distributed_identifiers:${REDIS_HOST}:${REDIS_PORT}:6:${REDIS_PASSWORD},
deferred_tasks:${REDIS_HOST}:${REDIS_PORT}:7:${REDIS_PASSWORD}
# If you add/remove a db, do not forget to update the --databases entry in the docker-compose.yml
ports:
- "18081:8081"
Expand Down
6 changes: 3 additions & 3 deletions services/docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.rule=hostregexp(`{host:.+}`) && PathPrefix(`/dev/`)
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.priority=3
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker, ${SWARM_STACK_NAME}_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_webserver_local.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry

wb-api-server:
environment:
Expand Down Expand Up @@ -233,7 +233,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.service=api@internal
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.rule=PathPrefix(`/dashboard`) || PathPrefix(`/api`)
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.entrypoints=traefik_monitor
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.middlewares=${SWARM_STACK_NAME}_gzip@docker
- traefik.http.routers.${SWARM_STACK_NAME}_api_internal.middlewares=${SWARM_STACK_NAME}_gzip@swarm
- traefik.http.services.${SWARM_STACK_NAME}_api_internal.loadbalancer.server.port=8080

whoami:
Expand All @@ -247,4 +247,4 @@ services:
- traefik.http.services.${SWARM_STACK_NAME}_whoami.loadbalancer.server.port=80
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.rule=PathPrefix(`/whoami`)
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.entrypoints=traefik_monitor
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.middlewares=${SWARM_STACK_NAME}_gzip@docker
- traefik.http.routers.${SWARM_STACK_NAME}_whoami.middlewares=${SWARM_STACK_NAME}_gzip@swarm
31 changes: 16 additions & 15 deletions services/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.rule=hostregexp(`{host:.+}`) && (Path(`/`, `/v0`) || PathPrefix(`/v0/`) || Path(`/api/v0/openapi.json`))
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.entrypoints=simcore_api
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.priority=1
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.middlewares=${SWARM_STACK_NAME}_gzip@docker,ratelimit-${SWARM_STACK_NAME}_api-server,inflightreq-${SWARM_STACK_NAME}_api-server
- traefik.http.routers.${SWARM_STACK_NAME}_api-server.middlewares=${SWARM_STACK_NAME}_gzip@swarm,ratelimit-${SWARM_STACK_NAME}_api-server,inflightreq-${SWARM_STACK_NAME}_api-server
networks:
- default

Expand Down Expand Up @@ -521,7 +521,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.service=${SWARM_STACK_NAME}_static_webserver
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.priority=2
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker,${SWARM_STACK_NAME}_static_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_static_webserver.middlewares=${SWARM_STACK_NAME}_gzip@swarm,${SWARM_STACK_NAME}_static_webserver_retry
# catchall for legacy services (this happens if a backend disappears and a frontend tries to reconnect, the right return value is a 503)
- traefik.http.routers.${SWARM_STACK_NAME}_legacy_services_catchall.service=${SWARM_STACK_NAME}_legacy_services_catchall
- traefik.http.routers.${SWARM_STACK_NAME}_legacy_services_catchall.priority=1
Expand Down Expand Up @@ -749,7 +749,7 @@ services:
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.rule=hostregexp(`{host:.+}`) && (Path(`/`, `/v0`,`/socket.io/`,`/static-frontend-data.json`, `/study/{study_uuid:\b[0-9a-f]{8}\b-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-\b[0-9a-f]{12}\b}`, `/view`, `/#/view`, `/#/error`) || PathPrefix(`/v0/`))
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.entrypoints=http
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.priority=2
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@docker, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@docker, ${SWARM_STACK_NAME}_webserver_retry
- traefik.http.routers.${SWARM_STACK_NAME}_webserver.middlewares=${SWARM_STACK_NAME}_gzip@swarm, ${SWARM_STACK_NAME_NO_HYPHEN}_sslheader@swarm, ${SWARM_STACK_NAME}_webserver_retry
networks: &webserver_networks
- default
- interactive_services_subnet
Expand Down Expand Up @@ -1160,7 +1160,7 @@ services:
retries: 50

traefik:
image: "traefik:v2.9.8@sha256:553239e27c4614d0477651415205b9b119f7a98f698e6562ef383c9d8ff3b6e6"
image: "traefik:v3.1.2@sha256:ec1a82940b8e00eaeef33fb4113aa1d1573b2ebb6440e10c023743fe96f08475"
init: true
hostname: "{{.Node.Hostname}}-{{.Task.Slot}}"
command:
Expand All @@ -1169,7 +1169,7 @@ services:
- "--ping=true"
- "--entryPoints.ping.address=:9082"
- "--ping.entryPoint=ping"
- "--log.level=WARNING"
- "--log.level=WARN" # WARN, not WARNING
- "--accesslog=false"
- "--metrics.prometheus=true"
- "--metrics.prometheus.addEntryPointsLabels=true"
Expand All @@ -1182,17 +1182,18 @@ services:
- "--entryPoints.simcore_api.forwardedHeaders.insecure"
- "--entryPoints.traefik_monitor.address=:8080"
- "--entryPoints.traefik_monitor.forwardedHeaders.insecure"
- "--providers.docker.endpoint=unix:///var/run/docker.sock"
- "--providers.docker.network=${SWARM_STACK_NAME}_default"
- "--providers.docker.swarmMode=true"
- "--providers.swarm.endpoint=unix:///var/run/docker.sock"
- "--providers.swarm.network=${SWARM_STACK_NAME}_default"
# https://github.com/traefik/traefik/issues/7886
- "--providers.docker.swarmModeRefreshSeconds=1"
- "--providers.docker.exposedByDefault=false"
- "--providers.docker.constraints=Label(`io.simcore.zone`, `${TRAEFIK_SIMCORE_ZONE}`)"
- "--tracing=true"
- "--tracing.jaeger=true"
- "--tracing.jaeger.samplingServerURL=http://jaeger:5778/sampling"
- "--tracing.jaeger.localAgentHostPort=jaeger:6831"
- "--providers.swarm.refreshSeconds=1"
- "--providers.swarm.exposedByDefault=false"
- "--providers.swarm.constraints=Label(`io.simcore.zone`, `${TRAEFIK_SIMCORE_ZONE}`)"
- "--core.defaultRuleSyntax=v2"
- "--tracing"
- "--tracing.addinternals"
- "--tracing.otlp=true"
- "--tracing.otlp.http=true"
# - "--tracing.otlp.http.endpoint=0.0.0.0:4318/v1/traces"
volumes:
# So that Traefik can listen to the Docker events
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ qx.Class.define("osparc.data.Resources", {
getWithWallet2: {
method: "GET",
url: statics.API + "/services/-/resource-usages?wallet_id={walletId}&offset={offset}&limit={limit}"
},
getUsagePerService: {
method: "GET",
url: statics.API + "/services/-/aggregated-usages?wallet_id={walletId}&aggregated_by=services&time_period={timePeriod}"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ qx.Class.define("osparc.data.model.Node", {
if (outputs) {
let hasOutputs = false;
Object.keys(this.getOutputs()).forEach(outputKey => {
if (Object.hasOwn(outputs, outputKey)) {
if (outputKey in outputs) {
this.setOutputs({
...this.getOutputs(),
[outputKey]: {
Expand Down Expand Up @@ -1094,7 +1094,11 @@ qx.Class.define("osparc.data.model.Node", {
};
this.fireDataEvent("showInLogger", msgData);

this.getIframeHandler().startPolling();
if (this.getIframeHandler()) {
this.getIframeHandler().startPolling();
} else {
console.error(this.getLabel() + " iframe handler not ready");
}
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ qx.Class.define("osparc.data.model.Workbench", {
init: null,
nullable: false,
event: "changeStudy"
},

deserialized: {
check: "Boolean",
init: false,
nullable: false,
event: "changeDeserialized"
}
},

Expand Down Expand Up @@ -662,6 +669,7 @@ qx.Class.define("osparc.data.model.Workbench", {
this.__deserializeEdges(workbenchInitData);
workbenchInitData = null;
workbenchUIInitData = null;
this.setDeserialized(true);
});
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,23 +364,6 @@ qx.Class.define("osparc.desktop.MainPage", {
});
},

closeStudy: function(studyId) {
if (studyId === undefined) {
if (this.__studyEditor && this.__studyEditor.getStudy()) {
studyId = this.__studyEditor.getStudy().getUuid();
} else {
return;
}
}
const params = {
url: {
"studyId": studyId
},
data: osparc.utils.Utils.getClientSessionID()
};
osparc.data.Resources.fetch("studies", "close", params);
},

__getStudyEditor: function() {
if (this.__studyEditor) {
return this.__studyEditor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ qx.Class.define("osparc.desktop.SlideshowView", {
startSlides: function() {
// If the study is not initialized this will fail
if (!this.isPropertyInitialized("study")) {
console.error("study is not initialized");
return;
}
const study = this.getStudy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,8 @@ qx.Class.define("osparc.desktop.StudyEditor", {
},
data: osparc.utils.Utils.getClientSessionID()
};
osparc.data.Resources.fetch("studies", "close", params);
osparc.data.Resources.fetch("studies", "close", params)
.catch(err => console.error(err));
},

closeEditor: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ qx.Class.define("osparc.desktop.credits.CreditsIndicatorButton", {
height: 24
});

this.__creditsContainer = new osparc.desktop.credits.CreditsNavBarContainer();
this.__creditsContainer.exclude();

this.addListener("tap", this.__buttonTapped, this);
},

Expand All @@ -53,6 +50,11 @@ qx.Class.define("osparc.desktop.credits.CreditsIndicatorButton", {
},

__showCreditsContainer: function() {
if (!this.__creditsContainer) {
this.__creditsContainer = new osparc.desktop.credits.CreditsSummary();
this.__creditsContainer.exclude();
}

const tapListener = event => {
// In case a notification was tapped propagate the event so it can be handled by the NotificationUI
if (osparc.utils.Utils.isMouseOnElement(this.__creditsContainer, event)) {
Expand Down

This file was deleted.

Loading

0 comments on commit b96df56

Please sign in to comment.