Skip to content

Commit db9c2dd

Browse files
authored
✨ Is353/meta function nodes (⚠️ devops) (ITISFoundation#2756)
1 parent 77add1f commit db9c2dd

File tree

82 files changed

+1869
-581
lines changed

Some content is hidden

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

82 files changed

+1869
-581
lines changed

.codeclimate.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,5 @@ exclude_patterns:
8080
- "**/pytest-simcore/"
8181
- "**/pytest_plugin/"
8282
- "**/sandbox/"
83+
- packages/models-library/src/models_library/utils/fastapi_encoders.py
8384
- services/web/server/src/simcore_service_webserver/exporter/formatters/sds/xlsx/templates/code_description.py

.env-devel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ DIRECTOR_V2_DEV_FEATURES_ENABLED=0
2828

2929
DYNAMIC_SIDECAR_IMAGE=${DOCKER_REGISTRY:-itisfoundation}/dynamic-sidecar:${DOCKER_IMAGE_TAG:-latest}
3030

31+
FUNCTION_SERVICES_AUTHORS='{"UN": {"name": "Unknown", "email": "[email protected]", "affiliation": "unknown"}}'
32+
3133
POSTGRES_DB=simcoredb
3234
POSTGRES_ENDPOINT=postgres:5432
3335
POSTGRES_HOST=postgres

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Makefile @pcrespov, @sanderegg
3030
/services/storage/ @mguidon, @pcrespov
3131
/services/static-webserver @GitHK
3232
/services/web/client/ @odeimaiz, @ignapas
33-
/services/web/server/ @pcrespov, @sanderegg
33+
/services/web/server/ @pcrespov, @sanderegg, @GitHK
3434
/tests/environment-setup/ @pcrespov
3535
/tests/performance/ @pcrespov
3636
/tests/public-api/ @pcrespov

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ properties:
137137
type:
138138
type: string
139139
pattern: >-
140-
^(number|integer|boolean|string|data:([^/\s,]+/[^/\s,]+|\[[^/\s,]+/[^/\s,]+(,[^/\s]+/[^/,\s]+)*\]))$
140+
^(number|integer|boolean|string|ref_contentSchema|data:([^/\s,]+/[^/\s,]+|\[[^/\s,]+/[^/\s,]+(,[^/\s]+/[^/,\s]+)*\]))$
141141
description: >-
142142
data type expected on this input glob matching for data type is
143143
allowed
@@ -154,6 +154,12 @@ properties:
154154
- data:text/plain
155155
- data:application/hdf5
156156
- data:application/[email protected]
157+
contentSchema:
158+
title: Content Schema
159+
description: >-
160+
jsonschema of the content at this input/output. Required when
161+
type='ref_contentSchema'
162+
type: object
157163
fileToKeyMap:
158164
description: Place the data associated with the named keys in files
159165
type: object
@@ -263,7 +269,8 @@ properties:
263269
- Age in seconds since 1970
264270
type:
265271
type: string
266-
pattern: ^(number|integer|boolean|string|data:[^/\s,]+/[^/\s,]+)$
272+
pattern: >-
273+
^(number|integer|boolean|string|ref_contentSchema|data:[^/\s,]+/[^/\s,]+)$
267274
description: data type expected on this output
268275
example:
269276
- number
@@ -274,6 +281,12 @@ properties:
274281
- 'data:application/vnd.ms-excel '
275282
- data:text/plain
276283
- data:application/hdf5
284+
contentSchema:
285+
title: Content Schema
286+
description: >-
287+
jsonschema of this input/output. Required when
288+
type='ref_contentSchema'
289+
type: object
277290
fileToKeyMap:
278291
description: >-
279292
Place the data stored in the named files and store it in the

api/specs/common/schemas/node-meta-v0.0.1.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
},
201201
"type": {
202202
"type": "string",
203-
"pattern": "^(number|integer|boolean|string|data:([^/\\s,]+/[^/\\s,]+|\\[[^/\\s,]+/[^/\\s,]+(,[^/\\s]+/[^/,\\s]+)*\\]))$",
203+
"pattern": "^(number|integer|boolean|string|ref_contentSchema|data:([^/\\s,]+/[^/\\s,]+|\\[[^/\\s,]+/[^/\\s,]+(,[^/\\s]+/[^/,\\s]+)*\\]))$",
204204
"description": "data type expected on this input glob matching for data type is allowed",
205205
"examples": [
206206
"number",
@@ -216,6 +216,11 @@
216216
"data:application/[email protected]"
217217
]
218218
},
219+
"contentSchema": {
220+
"title": "Content Schema",
221+
"description": "jsonschema of the content at this input/output. Required when type='ref_contentSchema'",
222+
"type": "object"
223+
},
219224
"fileToKeyMap": {
220225
"description": "Place the data associated with the named keys in files",
221226
"type": "object",
@@ -372,7 +377,7 @@
372377
},
373378
"type": {
374379
"type": "string",
375-
"pattern": "^(number|integer|boolean|string|data:[^/\\s,]+/[^/\\s,]+)$",
380+
"pattern": "^(number|integer|boolean|string|ref_contentSchema|data:[^/\\s,]+/[^/\\s,]+)$",
376381
"description": "data type expected on this output",
377382
"examples": [
378383
"number",
@@ -385,6 +390,11 @@
385390
"data:application/hdf5"
386391
]
387392
},
393+
"contentSchema": {
394+
"title": "Content Schema",
395+
"description": "jsonschema of this input/output. Required when type='ref_contentSchema'",
396+
"type": "object"
397+
},
388398
"fileToKeyMap": {
389399
"description": "Place the data stored in the named files and store it in the locations pointed to by the respective output key.",
390400
"type": "object",
@@ -464,4 +474,4 @@
464474
}
465475
}
466476
}
467-
}
477+
}

api/specs/common/schemas/project-v0.0.1-converted.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ properties:
182182
format: uri
183183
label:
184184
type: string
185+
- type: array
186+
items: {}
185187
inputAccess:
186188
description: map with key - access level pairs
187189
type: object
@@ -246,6 +248,8 @@ properties:
246248
format: uri
247249
label:
248250
type: string
251+
- type: array
252+
items: {}
249253
outputNode:
250254
type: boolean
251255
deprecated: true

api/specs/common/schemas/project-v0.0.1.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@
243243
"type": "string"
244244
}
245245
}
246+
},
247+
{
248+
"type": "array",
249+
"items": {}
246250
}
247251
]
248252
}
@@ -338,6 +342,10 @@
338342
"type": "string"
339343
}
340344
}
345+
},
346+
{
347+
"type": "array",
348+
"items": {}
341349
}
342350
]
343351
}
@@ -678,4 +686,4 @@
678686
"description": "Object containing Quality Assessment related data"
679687
}
680688
}
681-
}
689+
}

packages/README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,21 @@ Every folder contains a python package with the following properties:
1212
# creates and activates venv
1313
make .venv
1414
source .venv/bin/activate
15-
1615
cd packages/my-package
17-
18-
# for development
16+
```
17+
then for development
18+
```cmd
1919
pip install -r requirements/dev.txt
20-
21-
# for CI, we freeze dependencies and install tests
22-
pip install -r requirements/base.txt
23-
pip install .[test]
20+
pytest tests
21+
```
22+
or simply (does a bit more than above)
23+
```
24+
make install-dev
25+
make tests
2426
```
2527

28+
29+
2630
- it can be a package with or without with *entrypoints*.
2731
- a **library** has no entrypoints
2832
- a collection of functions/classes organized in namespaces
@@ -37,11 +41,3 @@ Every folder contains a python package with the following properties:
3741
# or as a lib
3842
>> import mylib
3943
```
40-
41-
42-
## TODO
43-
44-
- [ ] cookiecutters to assist creation of modules w/ or w/o entrypoints
45-
46-
47-
[simcore]:https://github.com/pcrespov/osparc-simcore

packages/dask-task-models-library/src/dask_task_models_library/container_tasks/io.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
from contextlib import suppress
33
from pathlib import Path
4-
from typing import Any, Dict, Optional, Union, cast
4+
from typing import Any, Dict, List, Optional, Union, cast
55

66
from models_library.generics import DictModel
77
from models_library.services import PROPERTY_KEY_RE
@@ -75,7 +75,16 @@ class Config:
7575

7676

7777
PortKey = constr(regex=PROPERTY_KEY_RE)
78-
PortValue = Union[StrictBool, StrictInt, StrictFloat, StrictStr, FileUrl, None]
78+
PortValue = Union[
79+
StrictBool,
80+
StrictInt,
81+
StrictFloat,
82+
StrictStr,
83+
FileUrl,
84+
List[Any],
85+
Dict[str, Any],
86+
None,
87+
]
7988

8089

8190
class TaskInputData(DictModel[PortKey, PortValue]):

packages/models-library/src/models_library/basic_regex.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@
1919

2020

2121
VERSION_RE = r"^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$"
22+
23+
24+
# Regex to detect whether a string can be used as a variable identifier (see tests)
25+
# - cannot start with spaces, _ (we only want public) or numbers
26+
# https://docs.python.org/3/reference/lexical_analysis.html#identifiers
27+
PUBLIC_VARIABLE_NAME_RE = r"^[^_\W0-9]\w*$"

0 commit comments

Comments
 (0)