Skip to content

Commit 62dc8b9

Browse files
authored
Merge pull request #984 from ITISFoundation/freeze-to-merge-staging
Freeze to merge staging - Hotfix storage fix deep copy path (#979) - Fix bugs (#980) - Configuration switch WEBSERVER_STUDIES_ACCESS_ENABLED to enable/disable study access (#981)
2 parents 37f9e05 + 33aa0e0 commit 62dc8b9

File tree

11 files changed

+76
-57
lines changed

11 files changed

+76
-57
lines changed

.env-devel

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,46 @@ GF_SMTP_HOST=mail.speag.com:25
1313

1414
MAINTENANCE_PASSWORD=z43
1515

16-
PUBLISHED_HOST_NAME=localhost
17-
18-
POSTGRES_ENDPOINT=postgres:5432
19-
POSTGRES_USER=simcore
20-
POSTGRES_PASSWORD=simcore
2116
POSTGRES_DB=simcoredb
17+
POSTGRES_ENDPOINT=postgres:5432
18+
# ensure consistency with POSTGRES_ variables: postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}
19+
POSTGRES_EXPORTER_DATA_SOURCE_NAME=postgresql://simcore:simcore@postgres:5432/simcoredb?sslmode=disable
2220
POSTGRES_HOST=postgres
21+
POSTGRES_PASSWORD=simcore
2322
POSTGRES_PORT=5432
23+
POSTGRES_USER=simcore
2424

25-
# ensure consistency with POSTGRES_ variables: postgresql+psycopg2://{user}:{password}@{host}:{port}/{database}
26-
POSTGRES_EXPORTER_DATA_SOURCE_NAME=postgresql://simcore:simcore@postgres:5432/simcoredb?sslmode=disable
25+
PUBLISHED_HOST_NAME=localhost
2726

28-
RABBIT_HOST=rabbit
29-
RABBIT_PORT=5672
3027
RABBITMQ_USER=simcore
28+
RABBITMQ_LOG_CHANNEL=comp.backend.channels.log
3129
RABBITMQ_PASSWORD=simcore
3230
RABBITMQ_PROGRESS_CHANNEL=comp.backend.channels.progress
33-
RABBITMQ_LOG_CHANNEL=comp.backend.channels.log
3431

35-
STORAGE_ENDPOINT=storage:8080
32+
RABBIT_HOST=rabbit
33+
RABBIT_PORT=5672
34+
3635

37-
REGISTRY_URL=masu.speag.com
3836
REGISTRY_AUTH=True
39-
REGISTRY_USER=z43
4037
REGISTRY_PW=z43
4138
REGISTRY_SSL=True
39+
REGISTRY_URL=masu.speag.com
40+
REGISTRY_USER=z43
41+
4242

43-
S3_ENDPOINT=minio:9000
4443
S3_ACCESS_KEY=12345678
45-
S3_SECRET_KEY=12345678
4644
S3_BUCKET_NAME=simcore
45+
S3_ENDPOINT=minio:9000
46+
S3_SECRET_KEY=12345678
4747
S3_SECURE=0
4848

49+
4950
SMTP_HOST=mail.speag.com
5051
SMTP_PORT=25
5152

53+
STORAGE_ENDPOINT=storage:8080
54+
5255
WEBSERVER_LOGIN_REGISTRATION_INVITATION_REQUIRED=1
5356
# python3 -c "from cryptography.fernet import Fernet; print(Fernet.generate_key())"
5457
WEBSERVER_SESSION_SECRET_KEY=REPLACE ME with a key of at least length 32.
58+
WEBSERVER_STUDIES_ACCESS_ENABLED=0

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,11 @@ up-devel: up-swarm-devel
136136
up-swarm: .env docker-swarm-check
137137
${DOCKER} swarm init
138138
${DOCKER_COMPOSE} -f services/docker-compose.yml -f services/docker-compose-tools.yml config > $(TEMPCOMPOSE).tmp-compose.yml ;
139-
@cat $(TEMPCOMPOSE).tmp-compose.yml
140139
@${DOCKER} stack deploy -c $(TEMPCOMPOSE).tmp-compose.yml ${SWARM_STACK_NAME}
141140

142141
up-swarm-devel: .env docker-swarm-check $(CLIENT_WEB_OUTPUT)
143142
${DOCKER} swarm init
144143
${DOCKER_COMPOSE} -f services/docker-compose.yml -f services/docker-compose.devel.yml -f services/docker-compose-tools.yml config > $(TEMPCOMPOSE).tmp-compose.yml
145-
@cat $(TEMPCOMPOSE).tmp-compose.yml
146144
@${DOCKER} stack deploy -c $(TEMPCOMPOSE).tmp-compose.yml ${SWARM_STACK_NAME}
147145

148146
.PHONY: up-webclient-devel

api/specs/webserver/v0/components/schemas/project-v0.0.1-converted.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ properties:
114114
output:
115115
type: string
116116
- type: object
117-
additionalProperties: false
117+
additionalProperties: true
118118
required:
119119
- store
120120
- path
@@ -125,6 +125,8 @@ properties:
125125
- integer
126126
path:
127127
type: string
128+
label:
129+
type: string
128130
inputAccess:
129131
description: map with key - access level pairs
130132
type: object
@@ -159,7 +161,7 @@ properties:
159161
- number
160162
- 'null'
161163
- type: object
162-
additionalProperties: false
164+
additionalProperties: true
163165
required:
164166
- store
165167
- path
@@ -170,6 +172,8 @@ properties:
170172
- integer
171173
path:
172174
type: string
175+
label:
176+
type: string
173177
outputNode:
174178
type: boolean
175179
parent:

api/specs/webserver/v0/components/schemas/project-v0.0.1.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
},
147147
{
148148
"type": "object",
149-
"additionalProperties": false,
149+
"additionalProperties": true,
150150
"required": [
151151
"store",
152152
"path"
@@ -157,6 +157,9 @@
157157
},
158158
"path": {
159159
"type": "string"
160+
},
161+
"label": {
162+
"type": "string"
160163
}
161164
}
162165
}
@@ -206,7 +209,7 @@
206209
},
207210
{
208211
"type": "object",
209-
"additionalProperties": false,
212+
"additionalProperties": true,
210213
"required": [
211214
"store",
212215
"path"
@@ -217,6 +220,9 @@
217220
},
218221
"path": {
219222
"type": "string"
223+
},
224+
"label": {
225+
"type": "string"
220226
}
221227
}
222228
}

services/web/client/source/class/qxapp/component/service/NodeStatus.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ qx.Class.define("qxapp.component.service.NodeStatus", {
102102
this.__node.bind("progress", this.__label, "value", {
103103
converter: progress => {
104104
if (progress === 100) {
105-
const file = node.getOutputValues().outFile.path;
106-
const splitFilename = file.split("/");
105+
const outInfo = node.getOutputValues().outFile;
106+
if ("label" in outInfo) {
107+
return outInfo.label;
108+
}
109+
const splitFilename = outInfo.path.split("/");
107110
return splitFilename[splitFilename.length-1];
108111
}
109112
return this.tr("Select a file");

services/web/client/source/class/qxapp/component/widget/inputs/NodeOutputTreeItem.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ qx.Class.define("qxapp.component.widget.inputs.NodeOutputTreeItem", {
110110
this.__valueLabel.setValue(value);
111111
},
112112
_transformValue: function(value) {
113+
if (value.getLabel) {
114+
return value.getLabel();
115+
}
113116
if (value.getPath) {
114117
const fileName = value.getPath().split("/");
115118
if (fileName.length) {

services/web/client/source/class/qxapp/component/widget/logger/LoggerView.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -266,18 +266,22 @@ qx.Class.define("qxapp.component.widget.logger.LoggerView", {
266266
},
267267

268268
__addLogs: function(nodeId, msgs = [""], logLevel = 0) {
269-
const workbench = this.getWorkbench();
270-
const node = workbench.getNode(nodeId);
271269
let label = null;
272-
if (node) {
273-
label = node.getLabel();
274-
node.addListener("changeLabel", e => {
275-
const newLabel = e.getData();
276-
this.__logModel.nodeLabelChanged(nodeId, newLabel);
277-
this.__updateTable();
278-
}, this);
279-
} else {
270+
if (nodeId === "root") {
280271
label = "Workbench";
272+
} else {
273+
const workbench = this.getWorkbench();
274+
const node = workbench.getNode(nodeId);
275+
if (node) {
276+
label = node.getLabel();
277+
node.addListener("changeLabel", e => {
278+
const newLabel = e.getData();
279+
this.__logModel.nodeLabelChanged(nodeId, newLabel);
280+
this.__updateTable();
281+
}, this);
282+
} else {
283+
return;
284+
}
281285
}
282286

283287
const nodeColor = this.__getNodesColor(nodeId);

services/web/client/source/class/qxapp/desktop/StudyEditor.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,11 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
363363
null,
364364
this.__retrieveInputs.bind(this, node, portKey)
365365
);
366-
this.getLogger().debug(null, "Updating pipeline");
366+
this.getLogger().debug("root", "Updating pipeline");
367367
},
368368

369369
__retrieveInputs: function(node, portKey = null) {
370-
this.getLogger().debug(null, "Retrieveing inputs");
370+
this.getLogger().debug("root", "Retrieveing inputs");
371371
if (node) {
372372
node.retrieveInputs(portKey);
373373
}
@@ -417,14 +417,14 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
417417
const req = new qxapp.io.request.ApiRequest(url, "POST");
418418
req.addListener("success", this.__onPipelinesubmitted, this);
419419
req.addListener("error", e => {
420-
this.getLogger().error(null, "Error submitting pipeline");
420+
this.getLogger().error("root", "Error submitting pipeline");
421421
}, this);
422422
req.addListener("fail", e => {
423-
this.getLogger().error(null, "Failed submitting pipeline");
423+
this.getLogger().error("root", "Failed submitting pipeline");
424424
}, this);
425425
req.send();
426426

427-
this.getLogger().info(null, "Starting pipeline");
427+
this.getLogger().info("root", "Starting pipeline");
428428
return true;
429429
},
430430

@@ -441,28 +441,28 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
441441
});
442442
req.addListener("success", this.__onPipelineStopped, this);
443443
req.addListener("error", e => {
444-
this.getLogger().error(null, "Error stopping pipeline");
444+
this.getLogger().error("root", "Error stopping pipeline");
445445
}, this);
446446
req.addListener("fail", e => {
447-
this.getLogger().error(null, "Failed stopping pipeline");
447+
this.getLogger().error("root", "Failed stopping pipeline");
448448
}, this);
449449
// req.send();
450450

451-
this.getLogger().info(null, "Stopping pipeline. Not yet implemented");
451+
this.getLogger().info("root", "Stopping pipeline. Not yet implemented");
452452
return true;
453453
},
454454

455455
__onPipelinesubmitted: function(e) {
456456
const resp = e.getTarget().getResponse();
457457
const pipelineId = resp.data["project_id"];
458-
this.getLogger().debug(null, "Pipeline ID " + pipelineId);
458+
this.getLogger().debug("root", "Pipeline ID " + pipelineId);
459459
const notGood = [null, undefined, -1];
460460
if (notGood.includes(pipelineId)) {
461461
this.__pipelineId = null;
462-
this.getLogger().error(null, "Submition failed");
462+
this.getLogger().error("root", "Submition failed");
463463
} else {
464464
this.__pipelineId = pipelineId;
465-
this.getLogger().info(null, "Pipeline started");
465+
this.getLogger().info("root", "Pipeline started");
466466
}
467467
},
468468

@@ -515,7 +515,7 @@ qx.Class.define("qxapp.desktop.StudyEditor", {
515515
}
516516
}, this);
517517
resource.addListenerOnce("putError", ev => {
518-
this.getLogger().error(null, "Error updating pipeline");
518+
this.getLogger().error("root", "Error updating pipeline");
519519
}, this);
520520
resource.put({
521521
"project_id": prjUuid

services/web/client/source/class/qxapp/file/FilePicker.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("qxapp.file.FilePicker", {
6868
addBtn.addListener("fileAdded", e => {
6969
const fileMetadata = e.getData();
7070
if ("location" in fileMetadata && "path" in fileMetadata) {
71-
this.__setOutputFile(fileMetadata["location"], fileMetadata["path"]);
71+
this.__setOutputFile(fileMetadata["location"], fileMetadata["path"], fileMetadata["name"]);
7272
}
7373
this.__initResources(fileMetadata["location"]);
7474
}, this);
@@ -140,11 +140,7 @@ qx.Class.define("qxapp.file.FilePicker", {
140140
const data = this.__filesTree.getSelectedFile();
141141
if (data && data["isFile"]) {
142142
const selectedItem = data["selectedItem"];
143-
const outputFile = this.__getOutputFile();
144-
outputFile.value = {
145-
store: selectedItem.getLocation(),
146-
path: selectedItem.getFileId()
147-
};
143+
this.__setOutputFile(selectedItem.getLocation(), selectedItem.getFileId(), selectedItem.getLabel());
148144
this.getNode().setProgress(100);
149145
this.getNode().repopulateOutputPortData();
150146
this.fireEvent("finished");
@@ -156,12 +152,13 @@ qx.Class.define("qxapp.file.FilePicker", {
156152
return outputs["outFile"];
157153
},
158154

159-
__setOutputFile: function(store, path) {
155+
__setOutputFile: function(store, path, label) {
160156
if (store && path) {
161-
const outputs = this.getNode().getOutputs();
162-
outputs["value"]["outFile"] = {
157+
const outputs = this.__getOutputFile();
158+
outputs["value"] = {
163159
store,
164-
path
160+
path,
161+
label
165162
};
166163
}
167164
},

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def create_schema():
4545
"client_outdir": T.String(),
4646
"log_level": T.Enum(*logging._nameToLevel.keys()), # pylint: disable=protected-access
4747
"testing": T.Bool(),
48-
"studies_access_enabled": T.Bool(),
48+
T.Key("studies_access_enabled", default=False): T.Or(T.Bool(), T.Int),
4949
T.Key("monitoring_enabled", default=False): T.Or(T.Bool(), T.Int), # Int added to use environs
5050
}),
5151
db_config.CONFIG_SECTION_NAME: db_config.schema,

0 commit comments

Comments
 (0)