Skip to content

Commit 7df1d0a

Browse files
author
Pedro Crespo
committed
Merge remote-tracking branch 'upstream/master' into staging
Conflicts: services/web/client/source/class/qxapp/data/model/Node.js services/web/client/source/class/qxapp/file/FilePicker.js services/web/client/source/class/qxapp/theme/Decoration.js services/web/server/tests/integration/conftest.py
2 parents d8dcf15 + 6b1a26e commit 7df1d0a

File tree

115 files changed

+4967
-4573
lines changed

Some content is hidden

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

115 files changed

+4967
-4573
lines changed

.github/CODEOWNERS

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1+
# Maps code in repository with maintainers
12
# Order is important. The last matching pattern has the most precedence.
23

34
# files and folders recursively
4-
/api/ @sanderegg, @pcrespov
5-
/ops/ @sanderegg, @pcrespov
6-
/docs/ @pcrespov
7-
/packages/service-library @pcrespov
8-
/services/dy* @sanderegg
9-
/services/sidecar @pcrespov, @mguidon
10-
/services/web/client @odeimaiz, @oetiker, @ignapas
11-
/services/web/server @pcrespov
12-
/services/storage @mguidon
5+
/.travis.yml @sanderegg
6+
/api/ @sanderegg, @pcrespov
7+
/ops/ @sanderegg, @pcrespov
8+
/docs/ @pcrespov
9+
/packages/service-library @pcrespov
10+
/scripts/json-schema-to-openapi-schema @sanderegg
11+
/services/dy* @sanderegg
12+
/services/sidecar @pcrespov, @mguidon
13+
/services/web/client @odeimaiz, @oetiker, @ignapas
14+
/services/web/server @pcrespov
15+
/services/storage @mguidon
1316

14-
requirements/* @pcrespov
15-
/.travis.yml @sanderegg
17+
requirements/* @pcrespov

api/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Concept
44

5-
REST APIs and models (defined as openAPI- or JSON-schemas) are defined in a central location (/apis) to allow for "design-first" development.
5+
REST APIs and models (defined as openAPI- or JSON-schemas) are defined in a central location [``api/specs``](api/specs) to allow for **design-first development**.
66

77
# Development guidelines
88

@@ -64,8 +64,11 @@ In that case, a version subfolder shall be added in the __/shared/__ subfolder a
6464
Mixing JSONSchema with OpenAPI schema needs some additional steps:
6565

6666
1. Define the JSONSchema schema.
67-
2. Convert the JSONSchema formatted file to OpenAPI formatted file using the [converter](../scripts/jsonschema/openapi_converter).
68-
3. In the openapi specifications file ref the converted OpenAPI schema file.
67+
2. Convert the JSONSchema formatted file to OpenAPI formatted file using a [converter](scripts/json-schema-to-openapi-schema) tool.
68+
3. In the openapi specifications file ref the converted OpenAPI schema file
69+
70+
This is automated for instance in [api/specs/webserver/v0/components/schemas/Makefile](api/specs/webserver/v0/components/schemas/Makefile)
71+
6972

7073
## Using the openAPI
7174

@@ -83,5 +86,5 @@ The current python-based packages use the aiohttp-apiset library to create route
8386

8487
## references
8588

86-
- [defining reusable components - good practices](https://dev.to/mikeralphson/defining-reusable-components-with-the-openapi-specification-4077)
89+
- [Defining reusable components - good practices](https://dev.to/mikeralphson/defining-reusable-components-with-the-openapi-specification-4077)
8790
- [official guidelines on OAS re-usability](https://github.com/OAI/OpenAPI-Specification/blob/master/guidelines/v2.0/REUSE.md)

api/specs/director/v0/openapi.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,6 @@ paths:
226226
responses:
227227
"204":
228228
description: Succesfully stopped and removed the service from the oSparc platform
229-
content:
230-
application/json:
231-
schema:
232-
$ref: '../../shared/schemas/response204.yaml#/components/schemas/Response204Enveloped'
233229
"400":
234230
description: Malformed function call, missing field
235231
content:

api/specs/shared/schemas/Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: all build clean help
2+
3+
objects = $(wildcard *.json)
4+
outputs := $(objects:.json=-converted.yaml)
5+
6+
TOOL_IMAGE_NAME := json-schema-to-openapi-schema
7+
8+
9+
# target: all – convert all json-schemas to open-api compatible and formats them in yaml
10+
all: check $(outputs)
11+
12+
%-converted.yaml:%.json
13+
docker run \
14+
-v ${CURDIR}:/input \
15+
-v ${CURDIR}:/output \
16+
$(TOOL_IMAGE_NAME)
17+
18+
# target: check – Checks whether tool is installed
19+
check:
20+
@docker history $(TOOL_IMAGE_NAME) 2>/dev/null \
21+
&& echo "$(TOOL_IMAGE_NAME) is in place" \
22+
|| echo "MISSING $(TOOL_IMAGE_NAME) tool. SEE "scripts/$(TOOL_IMAGE_NAME)" to build it"
23+
24+
# target: clean – Cleans all *-converted.yaml
25+
clean: check
26+
- rm $(outputs)
27+
28+
# target: help – Display all callable targets
29+
help:
30+
@echo
31+
@egrep "^\s*#\s*target\s*:\s*" [Mm]akefile \
32+
| sed -r "s/^\s*#\s*target\s*:\s*//g"
33+
@echo

api/specs/shared/schemas/node-meta-v0.0.1-converted.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ properties:
138138
patternProperties:
139139
.+:
140140
type: string
141-
pattern: '^[_a-z0-9]+$'
141+
pattern: '^[-_a-zA-Z0-9]+$'
142142
example:
143143
- dir/input1.txt: key_1
144144
dir33/input2.txt: key2
@@ -204,6 +204,7 @@ properties:
204204
label: The Rat
205205
- key: dog
206206
label: Bello the Dog
207+
additionalProperties: true
207208
outputs:
208209
type: object
209210
description: definition of the outputs of this node
@@ -255,7 +256,8 @@ properties:
255256
patternProperties:
256257
.+:
257258
type: string
258-
pattern: '^[_a-z0-9]+$'
259+
pattern: '^[-_a-zA-Z0-9]+$'
259260
example:
260261
- dir/input1.txt: key_1
261262
dir33/input2.txt: key2
263+
additionalProperties: true

api/specs/shared/schemas/response204.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
.PHONY: all build clean help
2+
3+
objects = $(wildcard *.json)
4+
outputs := $(objects:.json=-converted.yaml)
5+
6+
TOOL_IMAGE_NAME := json-schema-to-openapi-schema
7+
8+
9+
# target: all – convert all json-schemas to open-api compatible and formats them in yaml
10+
all: check $(outputs)
11+
12+
%-converted.yaml:%.json
13+
docker run \
14+
-v ${CURDIR}:/input \
15+
-v ${CURDIR}:/output \
16+
$(TOOL_IMAGE_NAME)
17+
18+
# target: check – Checks whether tool is installed
19+
check:
20+
@docker history $(TOOL_IMAGE_NAME) 2>/dev/null \
21+
&& echo "$(TOOL_IMAGE_NAME) is in place" \
22+
|| echo "MISSING $(TOOL_IMAGE_NAME) tool. SEE "scripts/$(TOOL_IMAGE_NAME)" to build it"
23+
24+
# target: clean – Cleans all *-converted.yaml
25+
clean: check
26+
- rm $(outputs)
27+
28+
# target: help – Display all callable targets
29+
help:
30+
@echo
31+
@egrep "^\s*#\s*target\s*:\s*" [Mm]akefile \
32+
| sed -r "s/^\s*#\s*target\s*:\s*//g"
33+
@echo

api/specs/webserver/v0/components/schemas/pipeline.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ components:
66
- data
77
properties:
88
data:
9-
$ref: '#/components/schemas/PipelineCreatedType'
9+
$ref: '#/components/schemas/PipelineCreatedSchema'
1010
error:
1111
nullable: true
1212
default: null
13-
14-
PipelineCreatedType:
13+
14+
PipelineCreatedSchema:
1515
type: object
1616
required:
1717
- pipeline_name

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

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ required:
66
- uuid
77
- name
88
- description
9-
- notes
109
- prjOwner
11-
- collaborators
1210
- creationDate
1311
- lastChangeDate
1412
- thumbnail
@@ -30,39 +28,21 @@ properties:
3028
description: longer one-line description about the project
3129
example:
3230
- Dabbling in temporal transitions ...
33-
notes:
34-
type: string
35-
description: longer project description. using common mark
36-
example:
37-
- |-
38-
# title
39-
Some Text `with` common mark markup
4031
prjOwner:
4132
type: string
4233
description: user uuid
43-
collaborators:
44-
type: object
45-
description: UUIDs of the users/groups who should get access to this
46-
x-patternProperties:
47-
^\S+$:
48-
type: array
49-
items:
50-
type: string
51-
enum:
52-
- read
53-
- write
5434
creationDate:
5535
type: string
5636
description: project creation date
5737
pattern: >-
58-
\d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[1-9])(:(\d|[0-5]\d)){2}Z
38+
\d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[1-9])(:(\d|[0-5]\d)){2}(\.\d{3})?Z
5939
example:
6040
- '2018-07-01T11:13:43Z'
6141
lastChangeDate:
6242
type: string
6343
description: last save date
6444
pattern: >-
65-
\d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[1-9])(:(\d|[0-5]\d)){2}Z
45+
\d{4}-(12|11|10|0?[1-9])-(31|30|[0-2]?\d)T(2[0-3]|1\d|0?[1-9])(:(\d|[0-5]\d)){2}(\.\d{3})?Z
6646
example:
6747
- '2018-07-01T11:13:43Z'
6848
thumbnail:
@@ -79,15 +59,18 @@ properties:
7959
required:
8060
- key
8161
- version
62+
- label
8263
- position
8364
properties:
8465
key:
8566
type: string
8667
description: distinctive name for the node based on the docker registry path
87-
pattern: '^(service)/(computational|dynamic)(/[^\s/]+)+$'
68+
pattern: >-
69+
^(simcore)/(services)(/demodec)?/(comp|dynamic|frontend)(/[^\s/]+)+$
8870
example:
89-
- service/computational/sleeper
90-
- service/dynamic/3dviewer
71+
- simcore/services/comp/sleeper
72+
- simcore/services/dynamic/3dviewer
73+
- simcore/services/frontend/file-picker
9174
version:
9275
type: string
9376
description: semantic version number of the node
@@ -96,6 +79,18 @@ properties:
9679
example:
9780
- 1.0.0
9881
- 0.0.1
82+
label:
83+
type: string
84+
progress:
85+
type: number
86+
maximum: 100
87+
minimum: 0
88+
description: the node progress value
89+
thumbnail:
90+
type: string
91+
description: url of the latest screenshot of the node
92+
example:
93+
- 'https://placeimg.com/171/96/tech/grayscale/?0.jpg'
9994
inputs:
10095
type: object
10196
description: values of input properties
@@ -107,6 +102,7 @@ properties:
107102
- boolean
108103
- string
109104
- number
105+
- 'null'
110106
- type: object
111107
additionalProperties: false
112108
required:
@@ -124,9 +120,33 @@ properties:
124120
- path
125121
properties:
126122
store:
127-
type: string
123+
type:
124+
- string
125+
- integer
128126
path:
129127
type: string
128+
inputAccess:
129+
description: map with key - access level pairs
130+
type: object
131+
patternProperties:
132+
'^[-_a-zA-Z0-9]+$':
133+
type: string
134+
enum:
135+
- Invisible
136+
- ReadOnly
137+
- ReadAndWrite
138+
default: ReadAndWrite
139+
example:
140+
- ReadOnly
141+
inputNodes:
142+
type: array
143+
items:
144+
type: string
145+
pattern: ^\S+$
146+
description: node IDs of where the node is connected to
147+
example:
148+
- nodeUuid1
149+
- nodeUuid2
130150
outputs:
131151
type: object
132152
patternProperties:
@@ -137,24 +157,26 @@ properties:
137157
- boolean
138158
- string
139159
- number
160+
- 'null'
140161
- type: object
141162
additionalProperties: false
142163
required:
143164
- store
144165
- path
145166
properties:
146167
store:
147-
type: string
168+
type:
169+
- string
170+
- integer
148171
path:
149172
type: string
150-
links:
151-
type: array
152-
items:
153-
type: string
154-
description: node IDs of where the node is connected to
155-
example:
156-
- nodeUuid1
157-
- nodeUuid2
173+
outputNode:
174+
type: boolean
175+
parent:
176+
type:
177+
- string
178+
- 'null'
179+
pattern: ^\S+$
158180
position:
159181
type: object
160182
additionalProperties: false
@@ -166,3 +188,4 @@ properties:
166188
type: integer
167189
'y':
168190
type: integer
191+
additionalProperties: true

0 commit comments

Comments
 (0)