nebulous / infinitude

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

Consider Multiarch Builds? #109

Closed scyto closed 3 years ago

scyto commented 3 years ago

@nebulous seems we have folks now asking for the multiarch builds due to HASS support https://github.com/MizterB/homeassistant-infinitude/issues/27

Options: 1) i do a PR on my docker file and you configure docker desktop with buildx and run the buildx command when you want to push to docker hub 2) i do that in my branch (happy to do it) and people can ping me when they want me to push a new one 3) we find someone with time/energy to look at this (maybe me if i have time) https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ (this will still require my debian based image to hit all the common archs)

scyto commented 3 years ago

i need to do this for my other images at somepoint so happy to do PoC might take me a few weeks to get around to this...

scyto commented 3 years ago

ok, i ripped the bandaid off and went to look at this, have first automated multiarch build pushed from github (github does the build instead of dockerhub!) - waiting for feedback on tests.

anyone playing along at hope please test docker pull scyto/infinitude:multi-test

scyto commented 3 years ago

to-do: migrate from crazy-max version of this process to dockers official version of this

adamurban commented 3 years ago

Just tested on my HA Rpi; seems to work great so far 👍

Screen Shot 2020-09-20 at 9 24 24 PM
scyto commented 3 years ago

@adamurban thanks, i appreciate that. I am finalizing the version that is using dockers official way of doing this (they took over crazy max's code - which is good for everyone i think). One that is done I will propagate this all to my latest tag - once i have done that i may call on you to test again if that's ok?

scyto commented 3 years ago

@adamurban ok, i think i am done, moved it all to latest docker version of crazy max's code, all in github with well formed github workflows and 0 formatting errors (god i love vs code though some of those formatting things it doesn't like are hilarious)

Give it a try (aka use latest, i deleted all the test tags) and let me know. I assume this should be enough different architectures.... right? Lol :-)

image

nebulous commented 3 years ago

Options:

  1. i do a PR on my docker file and you configure docker desktop with buildx and run the buildx command when you want to push to docker hub
  2. i do that in my branch (happy to do it) and people can ping me when they want me to push a new one
  3. we find someone with time/energy to look at this (maybe me if i have time) https://www.docker.com/blog/multi-arch-build-and-images-the-simple-way/ (this will still require my debian based image to hit all the common archs)

Option number 3 was the only option I was seriously considering because I don't want a manual process to be in the loop. Often times life gets to busy to pay much(any) attention to my open source projects and the fewer the barriers the better. That said, every time I look into getting dockerhub to automatically do multiarch builds I think "wat? that's a lot of doing. I'll check back later." :)

If you've gotten option 3 to work I'll be pleased to either point to your repo as the official docker build(if it will in fact be built automatically when we make changes to nebulous/infinitude in github), or incorporate your config into the nebulous/infinitude docker build otherwise. As always, thanks for your contributions @scyto! You've really helped move the project forward.

scyto commented 3 years ago

Yeah option 3 was only real option, but i am trained to put all options (life of a pm).

I have no reason to own it in my fork, quite happy to integrate it into your master, happy to help maintain this part.

If I do a PR I assume you can accept / reject which files or changes you want to accept?
(PRs are new to me, but i would like to learn how to do them)

also this new way of doing multiarch builds is waaay simpler - it uses github to do the build instead of dockerhub - no more hooks and post processing blah blah - uses simple to understand github workflows and action and as of 25 days ago is now an official docker supported and maintained methodology. very nice of Microsoft to take over the cost and burden of building things for docker....

this is one of the four actions involved https://github.com/docker/setup-buildx-action (their docs are less than ideal, but the original crazy-max version has better docs, lol)

scyto commented 3 years ago

https://github.com/nebulous/infinitude/pull/110 pull created

nebulous commented 3 years ago

Sorry, read the PR before this comment. Looks like a pretty cool way to go about it. We can continue the integration discussion in your PR. 👍

adamurban commented 3 years ago

Latest seems to work well on my Home Assistant rPI.

Here's a quick tutorial to install infinitude on home assistant: 1) Install the "portainer" add on 2) Launch Portainer 2) Navigate to Containers -> Add Container 3) Enter nebulous/infinitude:latest for the "Image" 4) Click "Network" under "Advanced container settings" and change the network type to "host" 5) Click "Restart Policy" and set it to "Unless Stopped" 6) Click "Deploy the Container" 7) Set the proxy address on your thermostat to the IP address of Home Assistant. Set the port to 3000 8) Navigate to http://ip.of.homeassistant:3000 and verify that infinitude is running and that you can see your thermostat state 9) Install the this custom component: https://github.com/MizterB/homeassistant-infinitude 10) Set your configuration.yaml in HA to point at localhost port 3000, it should look something like this:

climate:
  - platform: infinitude
    host: localhost
    port: 3000
    zone_names:
      - ZONE 1

11) Reboot. Verify that you can now control your thermostat from Home Assistant.

scyto commented 3 years ago

@nebulous see you did the merge 10 mins ago - the build takes about 12 to 15 minutes - you can watch it in workflows and see what it is doing in detail. Hows it going :-)

By the way if you get an rpc 1 error at the push stage this is a bug in containerd and the workflow needs to just be clicked to rerun. happen 1 in 10 for me, for others 1 in 100 (it can also happen in dockerub builds too)

scyto commented 3 years ago

@adamurban ok the PR was merged, the builds are uploaded can you try docker pull nebulous/infinitude:latest on your pi?

appleguru commented 3 years ago

Working!!! Well done :)

Screen Shot 2020-09-22 at 7 11 07 PM