-
Notifications
You must be signed in to change notification settings - Fork 30
✨Run dynamic services via dynamic-sidecar (🏗️ OPS + CI action) #1887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sanderegg
merged 794 commits into
ITISFoundation:master
from
GitHK:adding-service-sidecar
Aug 4, 2021
Merged
Changes from 250 commits
Commits
Show all changes
794 commits
Select commit
Hold shift + click to select a range
e8cbdf7
Merge remote-tracking branch 'upstream/master' into adding-service-si…
0e164bd
codestyle
d738812
updated openapi.json
415a2b5
fixed failing tests
597760d
added defaults for registry in development
33b1235
fixed models-library failing tests
02ea877
fixing pylint
0801c2b
added back missing
f40d9e6
fix pylint
f3ecd9d
containe-http-entrypoint requires compose-spec
055d1ca
fixed test which was causing all others to fail
24d49fc
removed fixture for network_name
8c0c6d6
changed application setup
2b881f2
added mocked swarm network
db976e8
fix codeclimate
1e017d2
fixed weberrver integration 06 and 09 tests
be3a845
fixed webserver integration 10 tests
23c37f2
fix failing unit tests
3b6abde
codeclimate will not fix
61fee20
monitor needs to be shutdown while not in swarm mode
6ea2390
Merge remote-tracking branch 'upstream/master' into adding-service-si…
71fc4bc
fixing timeouts for the CI
7b666dd
removed adminer
58008eb
CI can be a pain, give it a lot of time
34e4c06
updated specs
437a4eb
removed otudated TODO
32a6cb4
refactored, to using model instead of properties
9a3a66e
unmeaningful comment
f1e729e
fixed type
24dabee
added more hints for developers
a2a83af
removed undesired log
13256f5
fixed errors after refactor
5c098e1
Merge remote-tracking branch 'upstream/master' into adding-service-si…
4c8da7b
fixed makefile syntax
24fa540
displaying message in terminal
c63e988
updated comment and now raising error if fails
88db016
Update test_service_settings.py
pcrespov 5a3a0a1
@sanderegg typo fix
df834ae
@sanderegg fixed type
3f4fd6c
Merge remote-tracking branch 'upstream/master' into adding-service-si…
0795609
added missing commits to previous merge
480e9ab
Merge branch 'adding-service-sidecar' of github.com:GitHK/osparc-simc…
060ac3b
director-v2 codestyle
f348bae
added missing dependencies
d41a07a
updated pyton version in worfklow
3038268
added missing dependency
27134bb
updated types and fixed deserialization
74f6e36
updated types
b5f085e
renamed service_settings entries
7758b5d
renamed modes related to the service settings
04e2198
fixing output
cee3af1
renamed and semplified constructors
a4bd47a
node_uuid type is now NodeID
3b7ce38
removed unsued
64d8e09
fixed regex
1670688
reanbled and fixed tests
7d6ca83
changed :labels to /labels
874874e
renamed other_paths to state_paths
298f9be
expanded example
9e08bfc
fixed imports and types
f0ba7a6
Merge remote-tracking branch 'upstream/master' into adding-service-si…
e73ad69
test required to be in swarm mode
d6cf62c
doubling the time for the CI
8172573
refactor naming
e9b02e6
Merge remote-tracking branch 'upstream/master' into adding-service-si…
b206f9f
refactored RegistrySettings to new standard
3f6c8d2
refactored test
587cb21
more registry refactor
2ccf99e
removed unused definitions and RunningDynamicServiceDetails to avoid …
10676d0
refactored to semplify filtering
05f9755
refactor, added constructor moved model
88770e8
updated comments
6ac01cb
added constructor to model
f5960f7
removed comments
308b2e3
renamed moitor.core to monitor.monitor.task
db9efd9
simplifyng imports
4b348a6
moved gt_moinitor to dependencies
7824d48
removed TODO and expanded comment
dcfd57c
simplified status reported to the user
98b1d81
fixed dynamic-sidcar stuck boot
6bf4082
fixed type order
12797aa
adding missing optional
62f974d
- moved needs_dynamic_sidecar to property
e514eb1
refactored factory method
ef03808
moved hardcoded traefik version to DynamicSidecarSettings
7e8ceb3
refactored list_running_dynamic_services
7ec64a4
update docstring
330cced
will no longer suppress but display a warning
dadacbe
moved where the function is used
b109130
renamed properly
fffae11
renamed OverallStatus to Status
9f40a4d
refactored make_from_http_request
6175d84
Merge remote-tracking branch 'upstream/master' into adding-service-si…
e86f5da
refactored settings to new pattern and cleanup
bfaba5d
Merge remote-tracking branch 'upstream/master' into adding-service-si…
47540c3
pylint
ae369ff
updated openapi-specs
b95a575
renamed to module_setup
90933b9
renamed to docker_api
fa5b574
renamed to client_api interface and refactored interface
683d736
renamed to docker_compose_specs
e8c7210
renamed to docker_service_specs
db38cb5
renamed to docker_states
f32fa01
renaming to errors
48b2226
renaming to errors part 2
742b994
renamed events
cc2ba3b
renamed to abc and inherited from ABC
f3309ce
renaming to task
7845b7d
renamed task part 2
b61755c
refactor @pcrespov
c7fb8f1
refactor
00bca39
review @pcrespov
0f8941f
review @crespov
67a0341
typing error
34e821f
fixed typing
12675c0
using py3.8 syntax
d5e6ebe
pylance improovment
571b6e1
py3.8 syntax
7922116
@crespov refactor
0d1b89c
pylance suggestions
0b45d9f
more pylance suggestions
5a093e7
making pylance happy
2ec90c8
minor pylance suggsestions
d93345b
using a valid status
57b01d1
refactored to Pydantic model and moved to models
1069053
removed make from name
c30b357
removed unecessary code
02ed118
fixed constructor
3c290d6
models restructured:
b287fed
removed unncessary
925f843
pylance suggestion
e64a550
py38 syntax
c9d8f26
Merge remote-tracking branch 'upstream/master' into adding-service-si…
e970669
remove unsued import
6d07fd2
removed unused code
c1b5e0c
added test for fetched labesl and refactored
0c43f39
fixed module setup
9a46f0c
Merge remote-tracking branch 'upstream/master' into adding-service-si…
5166cfc
Merge remote-tracking branch 'upstream/master' into adding-service-si…
80c8bcc
Merge remote-tracking branch 'upstream/master' into adding-service-si…
7a49ba8
inverted parameter order
983e3b7
Merge remote-tracking branch 'upstream/master' into adding-service-si…
55f05ec
added missing changes
e84c9ec
Merge remote-tracking branch 'upstream/master' into adding-service-si…
3df966a
fixing workflow
8501db4
fixes issues with imagename
ef77717
switching to default
b8272ac
refactored
0bddb46
reverted test
431db00
trying to debug
62b5695
fixed validator for CI
0742220
added todo before merging
1ab0c2b
downgrading dependency which causes issues
33e094f
pylint
0050d36
updated name in CI
8d972d5
Merge remote-tracking branch 'upstream/master' into adding-service-si…
2983cb2
fixes failing fixture
20e002c
typing
618905a
bumping timeout to avoid test failing
fa76f65
Merge remote-tracking branch 'upstream/master' into adding-service-si…
909c6f2
Merge remote-tracking branch 'upstream/master' into adding-service-si…
06fadd3
refactor
5c3ba10
renamed back to original name
fb29bfe
moved traefik settings to env vars and pydantic models
7934cc3
- refactor function names
054ee9b
codestyle
651e699
using better name
0d244ad
added reminder
1ad9a2c
typing refactor
e0ee681
added test to be finished in fugure PRs
ff8b008
fixes command output README
a26b67d
do not fail when removing service
38cc182
log message for the user
56aa2ce
dynamic_sidecar_env_vars no longer contains obsucured password
7ad6f3f
empty string is treated as None
02b07d9
fixes broken behaviour
0b67932
Merge remote-tracking branch 'upstream/master' into adding-service-si…
5f725f0
codestyle
2564483
services are now queried for availability
2740b86
Merge remote-tracking branch 'upstream/master' into adding-service-si…
c6e3da1
avoids GC restarts upon errors
98481c8
added get_services timeout
1a5ec7d
locking is not required when recoviring the state
1b8895d
Merge remote-tracking branch 'upstream/master' into adding-service-si…
251b781
refactoring and renaming
196ef62
speeding up orphaned services removal
9e8d084
stopping services no longer hang on first error
20aefb0
stopping services will no longer raise errors
477b680
extend doc
073696a
Merge remote-tracking branch 'upstream/master' into adding-service-si…
11c10af
fixing tests
898dd7b
reverting changes
d9c3a58
Merge remote-tracking branch 'upstream/master' into adding-service-si…
24b9c22
fixed worfklow file
72a73b9
refactor
88b02fd
will codeclimate compalin?
48976f6
enhancing performance
b60b74e
minor refactor
4f91b98
fixed test
2404833
@sanderegg review
0abd013
no longer fails on boot
2ae7934
Merge remote-tracking branch 'upstream/master' into adding-service-si…
b06ee4a
reverting change
3e2e885
removing comment
aed839b
moved code to correct place and removed duplication
c081172
refactored
d8277eb
refactored and moved to director-v2
1882737
renamed functions
bf156b7
pylint
3f737fe
fixing "typo master" issues
cb55a20
fixed comment
5240c27
more typos
0fa0e37
refactored boot mode test
5329bc9
renaming and updating
861a4cf
@sanderegg refactor to try/except
fe6df17
fixing test after rename
e1016cd
removing autouse
d0c4000
removed autouse
1685038
making it clear from where fucntion calls come
df05035
moved to utils
6085961
fixing typing
07e7f5a
removing and renaming fixtures
6c50956
fixed import
6c52a4e
fixed failing test
7effea1
pylint
02a18f1
should fix issue with boot mode
88fbd07
removed unused dependency
4010e84
reverted requiremtns updates
b8bcbe6
giving test more time
82e3b75
fixing time bump
b73e3fa
reverting to old timeout
7d9065e
trying to remove randomly hanging code
4dddf36
CI does not like localhost to reference docker
8bb1176
put back registry
5c76784
refactor and docstrings
afa2bfc
refactor + update docstrings
4653345
removing autoreuse
38abf11
fixed too broad error capture and message logging
5cac1b8
refactor
033e224
uses erorr handling, updated docstring
ad2429c
fix garbage collector
e42d593
refactor common test parts
ead05fa
refactor tests
06b17cf
no longer return "null"
597d2e0
transfomed form system to integration test
741072f
Merge remote-tracking branch 'upstream/master' into adding-service-si…
a848abe
fixing broken test
7f3ad32
fixing test again
a423fde
bumping to avoid timeout
822f74e
Merge remote-tracking branch 'upstream/master' into adding-service-si…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,3 +32,6 @@ orjson | |
|
||
# clients | ||
httpx | ||
|
||
# other | ||
asyncio_extras |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 78 additions & 0 deletions
78
services/director-v2/src/simcore_service_director_v2/models/domains/dynamic_sidecar.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from typing import Dict, Any, Optional, List | ||
|
||
from pydantic import BaseModel, Field, validator | ||
|
||
ComposeSpecModel = Optional[Dict[str, Any]] | ||
|
||
|
||
class PathsMappingModel(BaseModel): | ||
inputs_path: str = Field( | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
..., description="path where the service expects all the inputs folder" | ||
) | ||
outputs_path: str = Field( | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
..., description="path where the service expects all the outputs folder" | ||
) | ||
other_paths: List[str] = Field( | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[], | ||
description="optional list of path which contents need to be saved and restored", | ||
) | ||
|
||
@validator("other_paths", always=True) | ||
@classmethod | ||
def other_paths_always_a_list(cls, v): | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return [] if v is None else v | ||
|
||
|
||
class StartDynamicSidecarModel(BaseModel): | ||
user_id: str | ||
project_id: str | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
service_key: str | ||
service_tag: str | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# these come from the webserver via the director | ||
request_scheme: str = Field( | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
..., description="Used for the proxy configuration either http or https" | ||
) | ||
request_dns: str = Field(..., description="Used for the proxy configuration") | ||
|
||
settings: List[Dict[str, Any]] = Field( | ||
..., | ||
description="settings for the services define by the service maintainer in the labels", | ||
) | ||
paths_mapping: PathsMappingModel = Field( | ||
..., | ||
description=( | ||
"the service explicitly requests where to mount all paths " | ||
"which will be handeled by the dynamic-sidecar" | ||
), | ||
) | ||
compose_spec: ComposeSpecModel = Field( | ||
..., | ||
description=( | ||
"if the user provides a compose_spec, it will be used instead " | ||
"of compsing one from the service_key and service_tag" | ||
), | ||
) | ||
target_container: Optional[str] = Field( | ||
..., | ||
description="when the user defines a compose spec, it should pick a container inside the spec to receive traffic on a defined port", | ||
) | ||
|
||
@validator("target_container") | ||
@classmethod | ||
def target_container_must_exist_if_compose_spec_present( | ||
cls, v, values, **kwargs | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
): # pylint: disable=unused-argument | ||
if values.get("compose_spec", None) is not None and v is None: | ||
raise ValueError( | ||
"simcore.service.target_container is required when compose_spec is defined. " | ||
f"The following compose spec was defined: {values['compose_spec']}" | ||
) | ||
return v | ||
|
||
@validator("request_scheme") | ||
@classmethod | ||
def validate_protocol(cls, v, values, **kwargs): # pylint: disable=unused-argument | ||
if v not in {"http", "https"}: | ||
GitHK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
raise ValueError(f"provided request_scheme={v} must be 'http' or 'https'") | ||
return v |
5 changes: 5 additions & 0 deletions
5
services/director-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .entrypoint import ( | ||
start_dynamic_sidecar_stack_for_service, | ||
stop_dynamic_sidecar_stack_for_service, | ||
) | ||
from .submodule_setup import setup_dynamic_sidecar |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.