-
Notifications
You must be signed in to change notification settings - Fork 2
feat: run instance creation in parallel #2
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
Conversation
72b064c to
dffe954
Compare
|
Thank you for your PR. I took a look at it, and I think the direction is right, but there are some issues with the approach, due to backend constraints you could not be aware of: The server API So if you were to time it, you would find that you do not gain much with concurrency. What does matter is waiting for servers to be actually started (via the
Let me know what you think. |
|
So I've implemented the “create in serial, await in parallel” approach, and reverted the deletion to serial. But, instead of having a precreated/limited number of awaiters, it dynamically creates goroutines to wait for servers becoming ready. Mostly because I dislike having an upper bound in the plugin, as these features are already present as part of the GitLab runner configuration ( Also, some pipelines we currently have more than 10 jobs that run in parallel, so that would slow these down. |
|
Thanks, I think the approach looks fair now. Setting an upper bound borders a bit on the paranoid, so I think you make a good argument. Since server creation is serial now, I don't foresee the API being a bottleneck either: Checking the server state is fairly fast. I didn't do a functional test yet, as I would like to do that in one go, together with the other PR, once that is read. |
href
left a comment
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 had some trouble getting this to work. It looks like in its current form the Increase call never returns.
42c7958 to
311753d
Compare
311753d to
6d34e38
Compare
|
Thank you. I'll go ahead and merge this PR, and the other one once the tests pass. Afterward I want to create a beta release and integrate it into https://github.com/cloudscale-ch/gitlab-runner. This will give me some additional testing mileage and would also make it possible for you to run this already, pending a proper release. However, quay.io currently throws HTTP 500 whenever I push a container, so this is currently slowing me down a bit. I'll wait and see first if this resolves itself, before maying publishing it elsewhere. Either way, I'm aiming to have at least the beta release this week, and a proper release by next week. In the meantime, thank you for your contributions and your patience 😅 |
Basically just changes the loops in Increase and Decrease to run in parallel using go routines.
So now instead of waiting until one instance is completely created on the cloudscale side (
Servers.WaitFor) and only then continuing on, it creates all instances at the same time.I'd assume one might run into rate limits with huge setups, but for us that hasn't happened yet.