panzerstadt / zmk-pw-builder

backend API for bt60 zmk.uf2 builds
0 stars 0 forks source link

Adding support for building from multiple zmk branches #4

Open panzerstadt opened 1 year ago

panzerstadt commented 1 year ago

this sounds like it needs a rework of the dockerfile and builder hmm

what do we want to achieve?

how do we want to set this up? options:

A: different zmk branches for different board configs?

this requires a bit of rework on the nodejs implementation, as well as builds in the dockerfile. it doesn't sound too hard, but might not scale too well if we end up with 2- different zmks for 20 different boards (the single dockerfile would be like a thousand lines long with different things all in the same place, making it brittle / hard to debug)

B. different dockerfiles for different zmk branches?

this keeps the dockerfiles small at least, and we would use the same code as the one we have now. but this requires us to add another layer to the builder, either: B1: a script to build all the separate dockerfiles, run seperate gcloud deployments, and end up with separate endpoints that each board must call (increase complexity on the client size (pw-lp) OR B2 a dockerfile/container management layer to deploy multiple containers together, and serve them all behind a unified endpoint, where the load balancer would punt each request to different instances.

i personally am leaning toward option B1 (multiple dockerfiles, multiple endpoints) as there is a lot of complexity in keeping state on different connections through a load balancer, and it doesn't seem like we need it yet

B1 diagram

Client A           Client B     Client C          Client D
    | bt60v1          |  bt65      |  bt75        | rotr
    v                 v            v              v
Server zmk-armv1      Server zmk-armv3       Server zmk-armv88

B2 diagram

Client A   Client B   Client C
    |         |         |
    v         v         v
+----------------------------+
|        Load Balancer       |
+----------------------------+
    |         |         |
    v         v         v
Server 1   Server 2   Server 3
ReFil commented 1 year ago

I think we should be able to build using one docker image. The zmk branch and docker image are two separate things.

The main reason we want this is to handle the rotr and the adv360 which use custom forks of zmk with tweaks.

The docker image just sets up the development environment, I think we can build in a different folder for each different branch of zmk