-
Notifications
You must be signed in to change notification settings - Fork 27
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
(⚠️ devops) 🐛 Adding missing custom constraints #3017
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3017 +/- ##
========================================
- Coverage 79.7% 79.7% -0.1%
========================================
Files 693 693
Lines 29049 29052 +3
Branches 3745 3745
========================================
+ Hits 23154 23155 +1
Misses 5062 5062
- Partials 833 835 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
services/director-v2/src/simcore_service_director_v2/core/settings.py
Outdated
Show resolved
Hide resolved
...r-v2/src/simcore_service_director_v2/modules/dynamic_sidecar/docker_service_specs/sidecar.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great! thanks!
DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINTS: str = Field( | ||
"", | ||
description="added to service Placement constraint in dynamic-sidecars", | ||
example="node.labels.region==east", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: did you try putting more than one constraint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a regex and made it singular, only one constraint is accepted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well actually it might cool to put several ones...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an example on how it could be done combining regex and and list of strings
and this is the associated env-file
so something like
DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINT: list[constr(strip_whitespace=True, regex=PATTERN)] = []
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the nice suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the suggesion on the lists above. I would also add in that case a default_factory=list
as default and remove the Optional
so you always get a list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, looks good to me
Kudos, SonarCloud Quality Gate passed!
|
(⚠️ devops)
On each deployment a new env var
DIRECTOR_V2_SERVICES_CUSTOM_CONSTRAINTS
should be defined ondirector-v2
. The value should be taken from theDIRECTOR_SERVICES_CUSTOM_CONSTRAINTS
indirector
and formatted to a json list. Example: fromone==yes
->["one==yes"]
What do these changes do?
dynamic-sidecar
new takes into consideration custom placement constraintsdynamic-sidecar
labels to make searching for services simplerdirector-v2
cannot contact thedynamic-sidecar
to save the state, it will no longer remove the dynamic-sidecar, giving the user an opportunity to save the statedynamic-sidecar
for saving states and pushing output ports when ssh into the containerRelated issue/s
How to test
Checklist