Skip to content

Commit 64b7b1d

Browse files
authored
Merge pull request #958 from ITISFoundation/freeze-to-staging-190718
Freeze to staging 190718 - New: Storage extension for deep copy of project files (#952) - Enhancement: Auto retrieve (#946)
2 parents 0e7dc80 + 5b0f71a commit 64b7b1d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1148
-421
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

api/specs/storage/v0/openapi.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,68 @@ paths:
273273
default:
274274
$ref: '#/components/responses/DefaultErrorResponse'
275275

276+
/simcore-s3/folders:
277+
post:
278+
tags:
279+
- users
280+
summary: Deep copies of all data from source to destination project in s3
281+
operationId: copy_folders_from_project
282+
parameters:
283+
- name: user_id
284+
in: query
285+
required: true
286+
schema:
287+
type: integer
288+
requestBody:
289+
content:
290+
application/json:
291+
schema:
292+
type: object
293+
properties:
294+
source:
295+
$ref: './openapi.yaml#/components/schemas/Project'
296+
destination:
297+
$ref: './openapi.yaml#/components/schemas/Project'
298+
nodes_map:
299+
type: object
300+
description: maps source and destination node uuids
301+
additionalProperties:
302+
type: string
303+
responses:
304+
'201':
305+
description: Data from destination project copied and returns project
306+
content:
307+
application/json:
308+
schema:
309+
$ref: './openapi.yaml#/components/schemas/Project'
310+
default:
311+
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
312+
313+
/simcore-s3/folders/{folder_id}:
314+
delete:
315+
tags:
316+
- users
317+
summary: Deletes all objects with folder_id prefix
318+
operationId: delete_folders_of_project
319+
parameters:
320+
- name: folder_id
321+
in: path
322+
required: true
323+
schema:
324+
type: string
325+
- name: user_id
326+
in: query
327+
required: true
328+
schema:
329+
type: string
330+
responses:
331+
'204':
332+
description: folder has been successfully deleted
333+
276334
components:
335+
schemas:
336+
Project:
337+
$ref: '../../webserver/v0/openapi-projects.yaml#/components/schemas/Project'
277338
responses:
278339
OK_NoContent_204:
279340
description: everything is OK, but there is no content to return

api/tests/conftest.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
OPENAPI_MAIN_FILENAME = 'openapi.yaml'
1919

2020

21-
def current_dir():
22-
return Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
21+
current_dir = Path(sys.argv[0] if __name__ == "__main__" else __file__).resolve().parent
2322

2423

2524
@pytest.fixture(scope='session')
2625
def here():
27-
return current_dir()
26+
return current_dir
2827

2928

3029
@pytest.fixture(scope='session')
@@ -91,7 +90,7 @@ def list_openapi_tails():
9190
SEE api_specs_tail to get one at a time
9291
"""
9392
tails = []
94-
specs_dir = _api_specs_dir_impl(current_dir())
93+
specs_dir = _api_specs_dir_impl(current_dir)
9594
for tail in _all_api_specs_tails_impl(specs_dir):
9695
specs = load_specs( specs_dir / tail)
9796
if not is_json_schema(specs):

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

0 commit comments

Comments
 (0)