Skip to content
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

Example check_status.sh for checking status of services in a service group #9

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

beepsoft
Copy link

This is just to give you an idea for a possible addition to cedarcli: we have this script to check whether all services in a service group like Infrastrucure, Microservice, Frontend, etc (names used by cedarcli server status) are all up and running. This allows us to run startinfrastructure in the background and then using check_status.sh Infrastructure check when all infra services are up and running. If they are (the scripts report "OK"), then we can start dependent services like startmicroservices, and so on.

@egyedia
Copy link
Member

egyedia commented Jul 27, 2023

I am happy to add something similar, but I have a question/suggestion:
All our microservices have runtime dependency management in their Docker.
If you take a look at the resource server pre-docker-entrypoint, for instance:
https://github.com/metadatacenter/cedar-docker-build/blob/main/cedar-server-resource/scripts/pre-docker-entrypoint.sh
you will see those wait-* scripts at the top.
Those are there to block the execution while all the needed infra services are up.
So in theory a microservice should try to initialize itself only if all the needed dependencies are up. This also applies to other microservices, the resource server waits for artifact server in the example above.

I am wondering if this mechanism does not work for you for some reason, because this should resolve the same issue as you are trying to resolve, but at a more granular level.

@beepsoft
Copy link
Author

Yes, you are right the wait-* scripts take care of this kind of synchronization as well. I somehow found problems with the intial infra/microservice startups when the docker images gets built. Maybe it was some other problem on my side or some bad configuration, but I only got consistent results when making sure that infra is ready when I start the microservices.

Anyway, querying "service groups" maybe useful in other use cases as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants