buildasaurs / XcodeServerSDK

Access Xcode Server API with native Swift objects.
MIT License
399 stars 30 forks source link

XcodeServerProxy (proxy, load balancer) #123

Open czechboy0 opened 8 years ago

czechboy0 commented 8 years ago

In order to support https://github.com/czechboy0/Buildasaur/issues/180, we need to add a new object, XcodeServerProxy, which will look like a plain old Xcode Server on the outside, however on the inside it will talk to multiple real Xcode Servers, distribute work between them and when e.g. asked for Bots, will gather Bots from all real instances (and keep an internal map of which Bot lives on which instance).

This will get complicated, but is another step in powering awesome usecases which devs are coming up with - in this case, having a farm of Xcode Servers and distributing work between them.

All feedback is welcome, because I've never done anything like this. Should be fun.

(Note: this will require heavy tests to be written probably before we start implementing it to be able to lock down the behavior).

cojoj commented 8 years ago

Form a quick look into this idea I can think of some thoughts...

The problem is that it's probably not possible to run multiple instances of Server.app at one machine, right? And yeah, writing this with TDD approach can be very helpful and also can really improve the quality of written code.

czechboy0 commented 8 years ago

Yeah we're talking multiple machines, each with a separate Xcode Server running on it. The SDK would have a Proxy object in memory, which knows about all the slave Xcode Servers. It would also keep a mapping to remember where each Bot/Integration lives, so that it doesn't have to refetch from all whenever we want to send a command to one Bot (living on one particular instance).

From quickly thinking about this, I don't see any major reason why this won't work, but it will be a good piece of effort, no question. However, I believe it could be very valuable (at least to Buildasaur, hopefully to more projects out there).

tychop commented 7 years ago

What's the status of this load balancing feature? Has it been implemented?

cojoj commented 7 years ago

@tychop unfortunately not. So far it was just planned and started being discussed here.