nebulous / infinitude

Open control of Carrier/Bryant thermostats
MIT License
225 stars 50 forks source link

Build image from base arg #188

Closed sosheskaz closed 2 months ago

sosheskaz commented 4 months ago

The context is that I've put together a HA addon: https://github.com/sosheskaz/infinitude-ha-addon.

I am interested in changing the base to use hassio, as you suggest. I don't think that necessarily makes sense in other contexts though.

From a separation of concerns perspective, I would rather not use my own Dockerfile, as I'm not very knowledgeable about PHP, just integrating Infinitude as it exists with hassio — this allows me to isolate just the "glue", without needing to worry about code changes or dependencies, instead just being able to consume infinitude's source.

Another aspect is that I want immutable images for the sake of reliable upgrades and rollback — upgrading to a different image tag with each update has the nice characteristic in hassio of allowing me to make it appear in the UI as an upgrade, and to allow rollback by just reverting to an old image, and... in general, making any given commit in my addon a viable snapshot of state. In that vein, I would benefit from immutable versioning of infinitude itself.

The hassio layer also has some extra needs, mostly to translate from hassio vars into infinitude's config: https://github.com/sosheskaz/infinitude-ha-addon/blob/main/docker/run.sh. This isn't that big, but again, with separation of concerns, I'm not sure that makes sense to contribute upstream. I'd be open to that... I just recall reading in a previous convo somewhere that you did not have a viable setup for testing releases of a HA addon, whereas I'm able to run my own experimental branch for any changes that come up.

I'm open to any other way you'd like to split that up though; my submodule solution is hardly graceful.

Sidenote, I really appreciate the work you've done on this project! Very nice to actually be able to use my thermostat how I like.

nebulous commented 4 months ago

How about using a mutli-stage build? I'm open to being convinced otherwise, and happy to help lower friction, but this just feels like the wrong place to solve this problem.

github-actions[bot] commented 2 months ago

This Pull Request has not been active in a while. It will be automatically closed soon absent further activity.

sosheskaz commented 2 months ago

ah, thought I'd responded to this. AFAIK there's no good way to go about using multi-arch builds for this. Because the base is the OS, we'd effectively want to either

I'm not familiar with any technique to get around this problem for these kinds of builds.

nebulous commented 2 months ago

I'm not quite following how this avoids or solves a multi-arch build problem, but it's also a small change which will make it easier for another contributor, so hey fine. merged.