Skip to content

Commit d589b74

Browse files
authored
Merge pull request #10 from sanderegg/reverse_proxy_director_update
updated director such that the route running_services get returns the service and the necessary details
2 parents dad2661 + b8c1cd2 commit d589b74

File tree

71 files changed

+1411
-353
lines changed

Some content is hidden

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

71 files changed

+1411
-353
lines changed

api/specs/director/v0/openapi.yaml

+37-13
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ info:
1212
url: https://github.com/ITISFoundation/osparc-simcore/blob/master/LICENSE
1313

1414
servers:
15-
- description: API server
16-
url: '/v0'
1715
- description: Development server
1816
url: http://{host}:{port}/{version}
1917
variables:
@@ -25,6 +23,16 @@ servers:
2523
default: 'v0'
2624
enum:
2725
- 'v0'
26+
- description: Production server
27+
url: http://director:{port}/{version}
28+
variables:
29+
port:
30+
default: '8001'
31+
version:
32+
default: 'v0'
33+
enum:
34+
- 'v0'
35+
2836

2937
# tags are used for organizing operations
3038
tags:
@@ -182,12 +190,12 @@ paths:
182190
parameters:
183191
- $ref: '#/components/parameters/ServiceUuid'
184192
responses:
185-
"204":
186-
description: OK service exists and runs
193+
"200":
194+
description: OK service exists and runs. Returns service location.
187195
content:
188196
application/json:
189197
schema:
190-
$ref: '../../shared/schemas/response204.yaml#/components/schemas/Response204Enveloped'
198+
$ref: '../../shared/schemas/running_service.yaml#/components/schemas/RunningServiceEnveloped'
191199
"400":
192200
description: Malformed function call, missing field
193201
content:
@@ -258,7 +266,7 @@ components:
258266
required: true
259267
schema:
260268
type: string
261-
format: uuid
269+
# format: uuid
262270
example: 123e4567-e89b-12d3-a456-426655440000
263271

264272
ServiceKeyPath:
@@ -268,8 +276,11 @@ components:
268276
required: true
269277
schema:
270278
type: string
271-
format: url
272-
example: simcore/services/dynamic/3d-viewer
279+
description: distinctive name for the node based on the docker registry path
280+
pattern: '^(simcore)/(services)/(comp|dynamic)(/[^\s/]+)+$'
281+
example:
282+
- simcore/services/comp/itis/sleeper
283+
- simcore/services/dynamic/3dviewer
273284

274285
ServiceKey:
275286
in: query
@@ -278,8 +289,11 @@ components:
278289
required: true
279290
schema:
280291
type: string
281-
format: url
282-
example: simcore/services/dynamic/3d-viewer
292+
description: distinctive name for the node based on the docker registry path
293+
pattern: '^(simcore)/(services)/(comp|dynamic)(/[^\s/]+)+$'
294+
example:
295+
- simcore/services/comp/itis/sleeper
296+
- simcore/services/dynamic/3dviewer
283297

284298
ServiceType:
285299
in: query
@@ -303,7 +317,7 @@ components:
303317
required: true
304318
schema:
305319
type: string
306-
format: uuid
320+
# format: uuid
307321
example: 123e4567-e89b-12d3-a456-426655440000
308322

309323
ServiceVersionPath:
@@ -313,7 +327,12 @@ components:
313327
required: true
314328
schema:
315329
type: string
316-
example: "1.4"
330+
description: semantic version number
331+
pattern: >-
332+
^(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-]+)*)?$
333+
example:
334+
- 1.0.0
335+
- 0.0.1
317336

318337
ServiceVersion:
319338
in: query
@@ -322,4 +341,9 @@ components:
322341
required: false
323342
schema:
324343
type: string
325-
example: "1.4"
344+
description: semantic version number
345+
pattern: >-
346+
^(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-]+)*)?$
347+
example:
348+
- 1.0.0
349+
- 0.0.1

api/specs/shared/schemas/running_service.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ components:
1616
required:
1717
- published_port
1818
- service_uuid
19+
- service_key
20+
- service_version
1921
properties:
2022
published_port:
2123
description: The ports where the service provides its interface
@@ -30,5 +32,20 @@ components:
3032
service_uuid:
3133
description: The UUID attached to this service
3234
type: string
33-
format: UUID
35+
# format: UUID
3436
example: 123e4567-e89b-12d3-a456-426655440000
37+
service_key:
38+
type: string
39+
description: distinctive name for the node based on the docker registry path
40+
pattern: '^(simcore)/(services)/(comp|dynamic)(/[^\s/]+)+$'
41+
example:
42+
- simcore/services/comp/itis/sleeper
43+
- simcore/services/dynamic/3dviewer
44+
service_version:
45+
type: string
46+
description: semantic version number
47+
pattern: >-
48+
^(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-]+)*)?$
49+
example:
50+
- 1.0.0
51+
- 0.0.1

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

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ Token:
3232
service: 'github-api-v1'
3333
token_key: N1BP5ZSpB
3434

35+
36+
TokenId:
37+
description: toke identifier
38+
type: string
39+
# format: uuid
40+
41+
3542
# enveloped and array versions --------------------------
3643

3744
ProfileEnveloped:
@@ -70,3 +77,14 @@ TokensArrayEnveloped:
7077
error:
7178
nullable: true
7279
default: null
80+
81+
TokenIdEnveloped:
82+
type: object
83+
required:
84+
- data
85+
properties:
86+
data:
87+
$ref: '#/TokenId'
88+
error:
89+
nullable: true
90+
default: null

api/specs/webserver/v0/openapi-user.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ paths:
4444
responses:
4545
'201':
4646
description: token created
47+
content:
48+
application/json:
49+
schema:
50+
$ref: './components/schemas/my.yaml#/TokenIdEnveloped'
51+
4752
default:
4853
$ref: './openapi.yaml#/components/responses/DefaultErrorResponse'
4954

packages/director-sdk/codegen.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#/bin/bash
2-
exec ../../scripts/openapi/openapi_codegen.sh \
3-
-i ../../services/director/src/simcore_service_director/oas3/v0/openapi.yaml \
2+
docker build ../../scripts/openapi/oas_resolver -t oas_resolver
3+
docker run -v ${PWD}/../../api/specs:/input -v ${PWD}:/output oas_resolver /input/director/v0/openapi.yaml /output/output_file.yaml
4+
5+
../../scripts/openapi/openapi_codegen.sh \
6+
-i output_file.yaml \
47
-o . \
58
-g python \
69
-c ./codegen_config.json
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.2
1+
3.3.3

packages/director-sdk/python/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This is the oSparc's director API
33

44
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
55

6-
- API version: 1.0.0
6+
- API version: 0.1.0
77
- Package version: 1.0.0
88
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
99

packages/director-sdk/python/docs/InlineResponse201Data.md

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Name | Type | Description | Notes
55
------------ | ------------- | ------------- | -------------
66
**entry_point** | **str** | The entry point where the service provides its interface if specified | [optional]
77
**published_port** | **int** | The ports where the service provides its interface |
8+
**service_key** | **str** | distinctive name for the node based on the docker registry path |
89
**service_uuid** | **str** | The UUID attached to this service |
10+
**service_version** | **str** | semantic version number |
911

1012
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
1113

packages/director-sdk/python/docs/UsersApi.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ except ApiException as e:
8787

8888
Name | Type | Description | Notes
8989
------------- | ------------- | ------------- | -------------
90-
**service_uuid** | [**str**](.md)| The uuid of the service |
90+
**service_uuid** | **str**| The uuid of the service |
9191

9292
### Return type
9393

@@ -105,7 +105,7 @@ No authorization required
105105
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
106106

107107
# **running_interactive_services_get**
108-
> InlineResponse204 running_interactive_services_get(service_uuid)
108+
> InlineResponse201 running_interactive_services_get(service_uuid)
109109
110110
Succesfully returns if a service with the defined uuid is up and running
111111

@@ -135,11 +135,11 @@ except ApiException as e:
135135

136136
Name | Type | Description | Notes
137137
------------- | ------------- | ------------- | -------------
138-
**service_uuid** | [**str**](.md)| The uuid of the service |
138+
**service_uuid** | **str**| The uuid of the service |
139139

140140
### Return type
141141

142-
[**InlineResponse204**](InlineResponse204.md)
142+
[**InlineResponse201**](InlineResponse201.md)
143143

144144
### Authorization
145145

@@ -170,9 +170,9 @@ from pprint import pprint
170170
# create an instance of the API class
171171
api_instance = simcore_director_sdk.UsersApi()
172172
user_id = asdfgj233 # str | The ID of the user that starts the service
173-
service_key = simcore/services/dynamic/3d-viewer # str | The key (url) of the service
173+
service_key = ["simcore/services/comp/itis/sleeper","simcore/services/dynamic/3dviewer"] # str | The key (url) of the service
174174
service_uuid = 123e4567-e89b-12d3-a456-426655440000 # str | The uuid to assign the service with
175-
service_tag = 1.4 # str | The tag/version of the service (optional)
175+
service_tag = ["1.0.0","0.0.1"] # str | The tag/version of the service (optional)
176176

177177
try:
178178
# Starts an interactive service in the oSparc platform and returns its entrypoint
@@ -188,7 +188,7 @@ Name | Type | Description | Notes
188188
------------- | ------------- | ------------- | -------------
189189
**user_id** | **str**| The ID of the user that starts the service |
190190
**service_key** | **str**| The key (url) of the service |
191-
**service_uuid** | [**str**](.md)| The uuid to assign the service with |
191+
**service_uuid** | **str**| The uuid to assign the service with |
192192
**service_tag** | **str**| The tag/version of the service | [optional]
193193

194194
### Return type
@@ -223,8 +223,8 @@ from pprint import pprint
223223

224224
# create an instance of the API class
225225
api_instance = simcore_director_sdk.UsersApi()
226-
service_key = simcore/services/dynamic/3d-viewer # str | The key (url) of the service
227-
service_version = 1.4 # str | The tag/version of the service
226+
service_key = ["simcore/services/comp/itis/sleeper","simcore/services/dynamic/3dviewer"] # str | The key (url) of the service
227+
service_version = ["1.0.0","0.0.1"] # str | The tag/version of the service
228228

229229
try:
230230
# Returns details of the selected service if available in the oSparc platform

packages/director-sdk/python/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This is the oSparc's director API # noqa: E501
77
8-
OpenAPI spec version: 1.0.0
8+
OpenAPI spec version: 0.1.0
99
1010
Generated by: https://openapi-generator.tech
1111
"""

packages/director-sdk/python/simcore_director_sdk/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
This is the oSparc's director API # noqa: E501
99
10-
OpenAPI spec version: 1.0.0
10+
OpenAPI spec version: 0.1.0
1111
1212
Generated by: https://openapi-generator.tech
1313
"""

packages/director-sdk/python/simcore_director_sdk/api/users_api.py

+12-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
This is the oSparc's director API # noqa: E501
77
8-
OpenAPI spec version: 1.0.0
8+
OpenAPI spec version: 0.1.0
99
1010
Generated by: https://openapi-generator.tech
1111
"""
@@ -228,7 +228,7 @@ def running_interactive_services_get(self, service_uuid, **kwargs): # noqa: E50
228228
229229
:param async_req bool
230230
:param str service_uuid: The uuid of the service (required)
231-
:return: InlineResponse204
231+
:return: InlineResponse201
232232
If the method is called asynchronously,
233233
returns the request thread.
234234
"""
@@ -250,7 +250,7 @@ def running_interactive_services_get_with_http_info(self, service_uuid, **kwargs
250250
251251
:param async_req bool
252252
:param str service_uuid: The uuid of the service (required)
253-
:return: InlineResponse204
253+
:return: InlineResponse201
254254
If the method is called asynchronously,
255255
returns the request thread.
256256
"""
@@ -305,7 +305,7 @@ def running_interactive_services_get_with_http_info(self, service_uuid, **kwargs
305305
body=body_params,
306306
post_params=form_params,
307307
files=local_var_files,
308-
response_type='InlineResponse204', # noqa: E501
308+
response_type='InlineResponse201', # noqa: E501
309309
auth_settings=auth_settings,
310310
async_req=local_var_params.get('async_req'),
311311
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
@@ -386,6 +386,10 @@ def running_interactive_services_post_with_http_info(self, user_id, service_key,
386386
local_var_params['service_uuid'] is None):
387387
raise ValueError("Missing the required parameter `service_uuid` when calling `running_interactive_services_post`") # noqa: E501
388388

389+
if 'service_key' in local_var_params and not re.search('^(simcore)\/(services)\/(comp|dynamic)(\/[^\\s\/]+)+$', local_var_params['service_key']): # noqa: E501
390+
raise ValueError("Invalid value for parameter `service_key` when calling `running_interactive_services_post`, must conform to the pattern `/^(simcore)\/(services)\/(comp|dynamic)(\/[^\\s\/]+)+$/`") # noqa: E501
391+
if 'service_tag' in local_var_params and not re.search('^(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-]+)*)?$', local_var_params['service_tag']): # noqa: E501
392+
raise ValueError("Invalid value for parameter `service_tag` when calling `running_interactive_services_post`, must conform to the pattern `/^(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-]+)*)?$/`") # noqa: E501
389393
collection_formats = {}
390394

391395
path_params = {}
@@ -494,6 +498,10 @@ def services_by_key_version_get_with_http_info(self, service_key, service_versio
494498
local_var_params['service_version'] is None):
495499
raise ValueError("Missing the required parameter `service_version` when calling `services_by_key_version_get`") # noqa: E501
496500

501+
if 'service_key' in local_var_params and not re.search('^(simcore)\/(services)\/(comp|dynamic)(\/[^\\s\/]+)+$', local_var_params['service_key']): # noqa: E501
502+
raise ValueError("Invalid value for parameter `service_key` when calling `services_by_key_version_get`, must conform to the pattern `/^(simcore)\/(services)\/(comp|dynamic)(\/[^\\s\/]+)+$/`") # noqa: E501
503+
if 'service_version' in local_var_params and not re.search('^(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-]+)*)?$', local_var_params['service_version']): # noqa: E501
504+
raise ValueError("Invalid value for parameter `service_version` when calling `services_by_key_version_get`, must conform to the pattern `/^(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-]+)*)?$/`") # noqa: E501
497505
collection_formats = {}
498506

499507
path_params = {}

0 commit comments

Comments
 (0)