Skip to content

Commit 5b0f71a

Browse files
authored
Auto retrieve (#946)
* Call /retrieve after updating database every time data field is changed * Updated demo with new templates in master * Update also comp_pipeline and comp_tasks tables, when saving study * list only file-picker in the getBuiltInServices * Added access privileges to update pipeline and cleanup computation_handlers * - Split handlers from API in computational subsystem * Created mocker for computational subsystem in test_projects * Fixes test_project_workflow * Fixes bad merge 205cea5 * retrieveInput calls are now POSTed and include an array of keys to retrieve in the body
1 parent 1777706 commit 5b0f71a

File tree

20 files changed

+457
-382
lines changed

20 files changed

+457
-382
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ setup-check: .env .vscode/settings.json
291291
## -------------------------------
292292
# Auxiliary targets.
293293

294+
.PHONY: reset
295+
# target: reset – Restart docker daemon
296+
reset:
297+
sudo systemctl restart docker
298+
294299
.PHONY: clean
295300
# target: clean – Cleans all unversioned files in project
296301
clean: remove-intermediate-file

scripts/demo/confirmations-invitations.csv

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@ code,user_id,action,data,created_at
22
AOuAejUGDv34i9QtxYK61V7GZmCE4B,1,INVITATION,"{
33
""guest"": ""[email protected]"" ,
44
""host"" : ""[email protected]""
5-
}",2019-07-08 13:18:16.368438
5+
}",2019-07-15 18:17:33.934830
66
uQhnK20tuXWdleIRhZaBcmrWaIrb2p,1,INVITATION,"{
77
""guest"": ""[email protected]"" ,
88
""host"" : ""[email protected]""
9-
}",2019-07-08 13:18:16.368446
9+
}",2019-07-15 18:17:33.934839
1010
weedI0YvR6tMA7XEpaxgJZT2Z8SCUy,1,INVITATION,"{
1111
""guest"": ""[email protected]"" ,
1212
""host"" : ""[email protected]""
13-
}",2019-07-08 13:18:16.368449
13+
}",2019-07-15 18:17:33.934843
1414
Q9m5C98ALYZDr1BjilkaaXWSMKxU21,1,INVITATION,"{
1515
""guest"": ""[email protected]"" ,
1616
""host"" : ""[email protected]""
17-
}",2019-07-08 13:18:16.368453
17+
}",2019-07-15 18:17:33.934846
1818
jvhSQfoAAfin4htKgvvRYi3pkYdPhM,1,INVITATION,"{
1919
""guest"": ""[email protected]"" ,
2020
""host"" : ""[email protected]""
21-
}",2019-07-08 13:18:16.368459
21+
}",2019-07-15 18:17:33.934850

scripts/demo/create_portal_markdown.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
log = logging.getLogger(__name__)
4545

4646
params = {}
47-
params["154fb4ad-4913-478f-af04-19725db901a7"] = {'stimulation_period_secs': '1200'}
47+
params["194bb264-a717-11e9-9dff-02420aff2767"] = {'stimulation_mode': '1', 'stimulation_level': '0.5'}
4848

4949
@contextmanager
5050
def _open(filepath):
@@ -62,10 +62,13 @@ def write_list(hostname, url, data, fh):
6262
print("## studies available @{}".format(hostname), file=fh)
6363
print("", file=fh)
6464
for prj in data:
65+
prj['msg'] = ''
6566
study_url = origin.with_path("study/{uuid}".format(**prj))
6667
if prj['uuid'] in params:
67-
study_url = study_url.with_query(**params[prj['uuid']])
68-
print("- [{name}]({study_url})".format(study_url=str(study_url), **prj), file=fh)
68+
prj_params = params[prj['uuid']]
69+
study_url = study_url.with_query(**prj_params)
70+
prj['msg'] = 'with ' + "and ".join([f"{k}={v} " for k,v in prj_params.items()])
71+
print("- [{name}]({study_url}) {msg}".format(study_url=str(study_url), **prj), file=fh)
6972
print("", file=fh)
7073

7174

scripts/demo/portal_markdown.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- Generated by create_portal_markdown.py on 2019-07-08 15:15:04.106152 -->
1+
<!-- Generated by create_portal_markdown.py on 2019-07-15 16:17:33.906421 -->
22
# THE PORTAL Emulator
33

44
This pages is for testing purposes for issue [#715](https://github.com/ITISFoundation/osparc-simcore/issues/715)
@@ -8,11 +8,11 @@ This pages is for testing purposes for issue [#715](https://github.com/ITISFound
88

99
## studies available @master
1010

11-
- [ISAN2019: 3D Paraview](http://master.osparc.io/study/template-uuid-518d-a25d-8887bcae93f8)
12-
- [ISAN: MattWard use case](http://master.osparc.io/study/template-uuid-5a9e-9580-c53d92d18803)
13-
- [ISAN2019 - opencor-py model](http://master.osparc.io/study/154fb4ad-4913-478f-af04-19725db901a7?stimulation_period_secs=1200)
14-
- [ISAN: 2D Plot](http://master.osparc.io/study/template-uuid-5716-bedd-b409bb021760)
15-
- [ISAN: UCDavis use case: 0D](http://master.osparc.io/study/template-uuid-5d82-b08d-d39c436ca738)
11+
- [ISAN2019: 3D Paraview](http://master.osparc.io/study/template-uuid-518d-a25d-8887bcae93f8)
12+
- [ISAN: osparc-opencor](http://master.osparc.io/study/194bb264-a717-11e9-9dff-02420aff2767?stimulation_mode=1&stimulation_level=0.5) with stimulation_mode=1 and stimulation_level=0.5
13+
- [ISAN: 2D Plot](http://master.osparc.io/study/template-uuid-5716-bedd-b409bb021760)
14+
- [ISAN: UCDavis use case: 0D](http://master.osparc.io/study/template-uuid-5d82-b08d-d39c436ca738)
15+
- [ISAN: MattWard use case](http://master.osparc.io/study/template-uuid-5a9e-9580-c53d92d18803)
1616

1717
## studies available @staging
1818

scripts/demo/template-projects/converter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def load_projects(csv_path:Path ):
3535

3636
# process
3737
for db_prj in db_projects:
38-
if int(db_prj['published'])==1:
38+
if int(db_prj.get('published', 0) or 0)==1:
3939
prj = _convert_to_schema_names(db_prj)
4040

4141
# jsonifies

scripts/demo/template-projects/templates_in_master.csv

Lines changed: 7 additions & 5 deletions
Large diffs are not rendered by default.

scripts/demo/template-projects/templates_in_master.json

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -78,77 +78,52 @@
7878
}
7979
},
8080
{
81-
"uuid": "template-uuid-5a9e-9580-c53d92d18803",
82-
"name": "ISAN: MattWard use case",
83-
"description": "MattWard Solver/PostPro viewer",
84-
"thumbnail": "https://user-images.githubusercontent.com/33152403/60168942-073a5580-9806-11e9-9162-3683dcff0711.png",
85-
"prjOwner": "[email protected]",
86-
"creationDate": "2019-06-06 14:33:58.681",
87-
"lastChangeDate": "2019-06-06 14:34:01.617",
88-
"workbench": {
89-
"template-uuid-523c-8caa-4ca36c927ca2": {
90-
"key": "simcore/services/dynamic/mattward-viewer",
91-
"version": "2.9.0",
92-
"label": "MattWard",
93-
"inputs": {},
94-
"inputNodes": [],
95-
"outputNode": false,
96-
"outputs": {},
97-
"progress": 55,
98-
"thumbnail": "",
99-
"position": {
100-
"x": 100,
101-
"y": 100
102-
}
103-
}
104-
}
105-
},
106-
{
107-
"uuid": "154fb4ad-4913-478f-af04-19725db901a7",
108-
"name": "ISAN2019 - opencor-py model",
109-
"description": "Computes the cardiac myocyte action potential for the sympathetic drive input setting on the MAP-Core portal.",
110-
"thumbnail": "https://opencor.ws/res/pics/logo.png",
81+
"uuid": "194bb264-a717-11e9-9dff-02420aff2767",
82+
"name": "ISAN: osparc-opencor",
83+
"description": "We are using the Fabbri et al (2017) sinoatrial cell model: https://models.physiomeproject.org/e/568\n\nThe model includes autonomic modulation via inclusion of the effects of ACh on If, ICaL, SR calcium uptake, and IK,ACh; and the effect of isoprenaline on If, ICaL, INaK, maximal Ca uptake, and IKs. We are varying the concentration of ACh according to the stimulation level, while isoprenaline is encoded to be \"on\" or \"off\" only (we use the \"on\" version in this exemplar). The range of ACh we're allowing is beyond what has been presented in the paper.",
84+
"thumbnail": "https://user-images.githubusercontent.com/33152403/61133437-be4cf700-a4bd-11e9-8b2a-c6425e15abea.png",
11185
"prjOwner": "[email protected]",
112-
"creationDate": "2019-06-18 15:20:16.567",
113-
"lastChangeDate": "2019-06-18 15:59:21.708",
86+
"creationDate": "2019-07-15 15:42:06.208",
87+
"lastChangeDate": "2019-07-15 15:42:06.208",
11488
"workbench": {
115-
"template-uuid-4179-bc47-0905e6726758": {
89+
"f631a142-d3b6-435d-abfb-8ad4acb91a70": {
11690
"key": "simcore/services/comp/osparc-opencor",
117-
"version": "0.2.1",
91+
"version": "0.3.0",
11892
"label": "osparc-opencor",
11993
"inputs": {
120-
"stimulation_period": "{{stimulation_period_secs}}"
94+
"stimulation_mode": "{{stimulation_mode}}",
95+
"stimulation_level": "{{stimulation_level}}"
12196
},
12297
"inputNodes": [],
12398
"outputNode": false,
12499
"outputs": {},
125-
"progress": 100,
100+
"progress": 0,
126101
"thumbnail": "",
127102
"position": {
128-
"x": 314,
129-
"y": 263
103+
"x": 587,
104+
"y": 279
130105
}
131106
},
132-
"template-uuid-4f4e-a1ae-429146d466b8": {
133-
"key": "simcore/services/dynamic/jupyter-base-notebook",
134-
"version": "2.10.0",
135-
"label": "jupyter-base-notebook",
107+
"744c9209-0450-4272-8357-4a08cf7f8458": {
108+
"key": "simcore/services/dynamic/raw-graphs",
109+
"version": "2.10.2",
110+
"label": "2D plot",
136111
"inputs": {
137112
"input_1": {
138-
"nodeUuid": "template-uuid-4179-bc47-0905e6726758",
139-
"output": "membrane_potential_json"
113+
"nodeUuid": "f631a142-d3b6-435d-abfb-8ad4acb91a70",
114+
"output": "membrane_potential_csv"
140115
}
141116
},
142117
"inputNodes": [
143-
"template-uuid-4179-bc47-0905e6726758"
118+
"f631a142-d3b6-435d-abfb-8ad4acb91a70"
144119
],
145120
"outputNode": false,
146121
"outputs": {},
147122
"progress": 100,
148-
"thumbnail": "https://opencor.ws/res/pics/logo.png",
123+
"thumbnail": "",
149124
"position": {
150-
"x": 631,
151-
"y": 259
125+
"x": 933,
126+
"y": 228
152127
}
153128
}
154129
}
@@ -298,5 +273,31 @@
298273
}
299274
}
300275
}
276+
},
277+
{
278+
"uuid": "template-uuid-5a9e-9580-c53d92d18803",
279+
"name": "ISAN: MattWard use case",
280+
"description": "MattWard Solver/PostPro viewer",
281+
"thumbnail": "https://user-images.githubusercontent.com/33152403/60168942-073a5580-9806-11e9-9162-3683dcff0711.png",
282+
"prjOwner": "[email protected]",
283+
"creationDate": "2019-06-06 14:33:58.681",
284+
"lastChangeDate": "2019-06-06 14:34:01.617",
285+
"workbench": {
286+
"template-uuid-523c-8caa-4ca36c927ca2": {
287+
"key": "simcore/services/dynamic/mattward-viewer",
288+
"version": "2.9.0",
289+
"label": "MattWard",
290+
"inputs": {},
291+
"inputNodes": [],
292+
"outputNode": false,
293+
"outputs": {},
294+
"progress": 55,
295+
"thumbnail": "",
296+
"position": {
297+
"x": 100,
298+
"y": 100
299+
}
300+
}
301+
}
301302
}
302303
]

services/web/client/source/class/qxapp/component/form/renderer/PropForm.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
4646
},
4747

4848
events: {
49-
"removeLink" : "qx.event.type.Data"
49+
"removeLink" : "qx.event.type.Data",
50+
"dataFieldModified": "qx.event.type.Data"
5051
},
5152

5253
properties: {
@@ -61,15 +62,20 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
6162
}
6263
},
6364

65+
// eslint-disable-next-line qx-rules/no-refs-in-members
6466
members: {
67+
_gridPos: {
68+
label: 0,
69+
entryField: 1
70+
},
6571
addItems: function(items, names, title, itemOptions, headerOptions) {
6672
// add the header
6773
if (title !== null) {
6874
this._add(
6975
this._createHeader(title), {
7076
row: this._row,
71-
column: 0,
72-
colSpan: 3
77+
column: this._gridPos.label,
78+
colSpan: Object.keys(this._gridPos).length
7379
}
7480
);
7581
this._row++;
@@ -81,12 +87,12 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
8187
let label = this._createLabel(names[i], item);
8288
this._add(label, {
8389
row: this._row,
84-
column: 0
90+
column: this._gridPos.label
8591
});
8692
label.setBuddy(item);
8793
this._add(new qxapp.component.form.FieldWHint(null, item.description, item), {
8894
row: this._row,
89-
column: 1
95+
column: this._gridPos.entryField
9096
});
9197
this._row++;
9298
this._connectVisibility(item, label);
@@ -150,20 +156,25 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
150156
if (child.getField && child.getField().key === portId) {
151157
const layoutProps = child.getLayoutProperties();
152158
this._remove(child);
153-
let hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
159+
160+
const hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(5));
154161
hBox.add(this._form.getControlLink(portId), {
155162
flex: 1
156163
});
157-
let unlinkBtn = new qx.ui.form.Button(this.tr("Unlink"), "@FontAwesome5Solid/unlink/14");
164+
165+
const unlinkBtn = new qx.ui.form.Button(this.tr("Unlink"), "@FontAwesome5Solid/unlink/14");
158166
unlinkBtn.addListener("execute", function() {
159167
this.fireDataEvent("removeLink", portId);
160168
}, this);
161169
hBox.add(unlinkBtn);
170+
162171
hBox.key = portId;
163172
this._addAt(hBox, i, {
164173
row: layoutProps.row,
165-
column: 1
174+
column: this._gridPos.entryField
166175
});
176+
177+
this.fireDataEvent("dataFieldModified", portId);
167178
}
168179
}
169180
},
@@ -177,8 +188,10 @@ qx.Class.define("qxapp.component.form.renderer.PropForm", {
177188
this._remove(child);
178189
this._addAt(new qxapp.component.form.FieldWHint(null, this._form.getControl(portId).description, this._form.getControl(portId)), i, {
179190
row: layoutProps.row,
180-
column: 1
191+
column: this._gridPos.entryField
181192
});
193+
194+
this.fireDataEvent("dataFieldModified", portId);
182195
}
183196
}
184197
},

services/web/client/source/class/qxapp/data/Store.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ qx.Class.define("qxapp.data.Store", {
120120
type: "data:*/*"
121121
}
122122
}
123-
}, {
123+
}];
124+
return builtInServices;
125+
},
126+
127+
getBuiltInServices2: function() {
128+
const builtInServices = [{
124129
key: "simcore/services/frontend/nodes-group",
125130
version: "1.0.0",
126131
type: "group",

0 commit comments

Comments
 (0)