-
Notifications
You must be signed in to change notification settings - Fork 9
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
Multiple worker support #2036
Multiple worker support #2036
Conversation
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.
Looks good. I notice that we are identifying the worker by pid in logging. Might it also be useful to include the hostname?
I think that it will be moot, since it will be cloudwatch that actually renders the logs. Cloudwatch already takes care of that for us. |
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.
Looks good! Perhaps we can consider adding more managerial logic to the manager down the road, for example respawn the worker in case it dies.
That’s a good idea |
I like this idea so much i'm adding it to this PR (it's a really simple update) |
…-scripts-to-deploy-code-to-worker-ecs-container
This PR enables multiple worker support. It introduces a new mechanism,
worker-manager
, that is responsible for spinning up the desired number of workers in each container. theworker-manager
is also responsible for keeping track of when all the workers are ready using a very simple TCP server that the realm server leverages in the test environment. Additionally, theworker-manager
is responsible for tagging the stdout and stderr with the worker's PID so that the log messages among multiple workers can be correlated correctly.The
start:all
script spins up the workers automatically. Each realm server has a correspondingworker-manager
. However, you can also usestart:worker-development
to spin up the workers manually if you'd like (which is paired with thestart:development
script for starting the development realm server). TheWORKER_COUNT
environment variable is used to indicate how many workers theworker-manager
should spin up. By default, when this environment variable is not specified, only a single worker is spun up by theworker-manager
.Finally, this PR also updates the deploy scripts to deploy the workers into their own ECS container. Currently we are only deploying a single worker per ECS container. as soon as we confirm everything is working properly, we'll increase the worker count in our hosted envs in a subsequent PR.
This PR is paired with the infra PR https://github.com/cardstack/infra/pull/568
TODO: