-
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
♻️ Is2757/gc as a service implementation (⚠️⚠️ devops) #2834
♻️ Is2757/gc as a service implementation (⚠️⚠️ devops) #2834
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2834 +/- ##
======================================
Coverage 79.3% 79.4%
======================================
Files 673 673
Lines 27618 27624 +6
Branches 3216 3218 +2
======================================
+ Hits 21911 21934 +23
+ Misses 4958 4940 -18
- Partials 749 750 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c7a10bc
to
e6459ee
Compare
e6459ee
to
8faf620
Compare
ca29a29
to
c680e31
Compare
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! looking forward to seeing the results
WEBSERVER_GARBAGE_COLLECTOR: '{"GARBAGE_COLLECTOR_INTERVAL_S": 30}' | ||
env_file: | ||
- ../.env | ||
- ../.env-webserver-garbage-collector |
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.
so this one overrides what is in .env?
So I guess we should review these contents soon.
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.
yes, that what I suggest in the note above as well ... but I want to do it carefully and taking into account the devops repo
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.
We definately need to clean up the env-var handling. They come in from all over the place, and it is hard to detangle since some env-vars (IPs etc.) are overwritten by makefiles, overwritten from the simcore repo, etc.
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 feel it would be clearer to just put all the variable without using the *webserver-environment (so, having two times the same thing) and set theme here to null, not in the env-webserver-garbage-collector as it adds another layer in top of 3 another layers.. It would be repeating but easier to understand
interval: 30s | ||
timeout: 120s | ||
retries: 3 | ||
start_period: 30s |
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.
we should probably also review these, in prod the start period is pretty long and usually the services are up in less than 10s
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 taking care of it.
services/docker-compose.yml
Outdated
constraints: | ||
- node.platform.os == linux | ||
labels: | ||
- io.simcore.zone=${TRAEFIK_SIMCORE_ZONE} |
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.
is this required, since it does not require and endpoint?
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.
yes, traffik should not. I removed it
Nonetheless, notice that the rest plugin is active because this service needs one of the routes /v0/
for the swarm healthcheck.
@mrnicegyu11 @Surfict i guess you also need to make sure in ops that this service has correct deploy rules?
@@ -130,6 +130,9 @@ def _default_app_config_for_integration_tests( | |||
test_environ["WEBSERVER_LOGLEVEL"] = "WARNING" | |||
test_environ["OSPARC_SIMCORE_REPO_ROOTDIR"] = f"{osparc_simcore_root_dir}" | |||
|
|||
# NOTE: removed from webserver_environ after split with GC |
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.
this note is not too clear for me. did you not split the GC already?
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.
nice Pedro thanks for doing this! |
c89d7e1
to
20ebf05
Compare
75e1b77
to
a87813f
Compare
I think the |
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 this
WEBSERVER_CATALOG=null | ||
WEBSERVER_COMPUTATION=null | ||
WEBSERVER_DIAGNOSTICS=null | ||
#WEBSERVER_DIRECTOR_V2 from .env |
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.
what does this mean?
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 I mapped all the plugin variables and explicitly set to null
those that need to be disconnected. For those enabled, i just commented them. So to some extent, this env-file is only to disable plugins
WEBSERVER_GARBAGE_COLLECTOR: '{"GARBAGE_COLLECTOR_INTERVAL_S": 30}' | ||
env_file: | ||
- ../.env | ||
- ../.env-webserver-garbage-collector |
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.
We definately need to clean up the env-var handling. They come in from all over the place, and it is hard to detangle since some env-vars (IPs etc.) are overwritten by makefiles, overwritten from the simcore repo, etc.
# for the moment using web-server as an all-in-one service. | ||
# TODO: create integration tests using different configs | ||
# SEE https://github.com/ITISFoundation/osparc-simcore/issues/2896 | ||
test_environ["WEBSERVER_GARBAGE_COLLECTION_INTERVAL_SECONDS"] = "30" |
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.
maybe out it to an uneven or prime number so it doesnt colide with any other (freshping etc.) intervals
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.
haha that is a nice touch :-) Not sure whether it is accurate wha you claim ... since this interval is relative to the time it takes to "garbage collect" ... but I will do so nonetheless
WEBSERVER_EMAIL=null | ||
WEBSERVER_EXPORTER=null | ||
WEBSERVER_FRONTEND=null | ||
#WEBSERVER_GARBAGE_COLLECTOR explicit in |
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.
This env-file configures a webserver instance to only act as a garbage collector, correct?
It is hard to infer that from this variable being commented out (probably "true" is the default?, what does "explicit in" mean?) so maybe set it explicitly to true. Then every reader knows what is going on...
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.
ok, let me clarify all this for you offline
deploy: | ||
placement: | ||
constraints: | ||
- node.platform.os == linux |
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.
Can this service run on the Simcore node ? (in the logic of isolating Simcore services from user nodes). If yes we will need to implement that in the devops part
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 feel it would be clearer to just put all the variable without using the *webserver-environment (so, having two times the same thing) and set theme here to null, not in the env-webserver-garbage-collector as it adds another layer in top of 3 another layers.. It would be repeating but easier to understand
I am not sure i understand but i am open to suggestions. Perhaps sometime offline?
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.
Can this service run on the Simcore node ? (in the logic of isolating Simcore services from user nodes). If yes we will need to implement that in the devops part
yes, thisi s part of the stack. it has to work in simcore-node. These placment constratins were there before ...
WEBSERVER_GARBAGE_COLLECTOR: '{"GARBAGE_COLLECTOR_INTERVAL_S": 30}' | ||
env_file: | ||
- ../.env | ||
- ../.env-webserver-garbage-collector |
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 feel it would be clearer to just put all the variable without using the *webserver-environment (so, having two times the same thing) and set theme here to null, not in the env-webserver-garbage-collector as it adds another layer in top of 3 another layers.. It would be repeating but easier to understand
What do these changes do?
Adds to the stack a
webserver-garbage-collector
service (GC) that will take the sole responsibility of running periodically "garbage collector" task.This service uses the webserver image and starts the app with a custom config that only enables the plugins necessary for his task.
Highlights
.env-webserver-garbage-collector
lists disabled envs. This listing is used at the end in the docker-compose specs to override default's web-server envsv0/
route for healthcheck.env-webserver-garbage-collector
that adds the plugins disabled. Noticed how this listing is added at the end to override the default webserver configNOTE for all: we should sync with ops and refactor the strategy with env files vs docker-compose's environment section. Currently it is all bit fuzzy
Related issue/s
How to test
make build
cd tests/performance; make build
make up-prod
5. In the latter, you should see appended logo as
make up target=platform_ping_test.py
Checklist
make openapi-specs
,git commit ...
and thenmake version-*
)cd packages/postgres-database
,make setup-commit
,sc-pg review -m "my changes"