-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support for rebuilding the edge/dev container #1
Comments
I'm pretty sure you only get the rebuild button if you have the source files for the add-on locally, so you'd need to clone the main repo to your HA Not sure how ESPHome is able to pull the updates for the build, but this repo is mostly meant to test the dev images before they get pushed they get merged into the versioned release since HA doesn't have an option to pull specific images by tag. |
Bumping this again, as I ran into again trying to test the latest dev image, only to find that the add-on simply wouldn't start anymore. I don't know anything about HA add-on development, or how the ESPHome add-ons work. But I do know that I get regular updates on both the ESPHome and ESPHome (beta) add-ons, and I have the option to Rebuild the ESPHome (dev) add-on. Looking at the ESPHome repo again, the differences appear to be:
So maybe that's what you meant by requiring that the add-on sources be available locally? But I know I definitely did not do anything special to be able to get the ESPHome (dev) add-on installed - it is installed straight from the add-on store, and I still get the Rebuild option. I can try asking in Discord (ESPHome or HA) to see if anyone more familiar with building add-ons has any pointers. |
Looking into this again, it kind of seems like all the Rebuild button does (or should do) is rebuild the docker container, not rebuild the image. https://hub.docker.com/r/esphome/esphome-hassio/tags Since the image is what you build from https://github.com/mrlt8/docker-wyze-bridge sources and upload yourself to docker hub, we don't need it to rebuild the image from sources - all we need to do is tell supervisor to rebuild the container, using the latest tagged image from docker hub, which is what this build.yaml file tells it how to do for esphome: Maybe it's enough to just list the The production add-on gets updates automatically, because the That said, I don't know if build.yaml also requires a Dockerfile 🤷♂️ But maybe the Dockerfile can be simpler in this case, because you already have a source image. Again, not very familiar with building Docker containers, or add-ons, so this is just speculation. |
Thanks for the suggestions @jhansche! I think I was able to get this to work. The key was to source the existing image in the local Dockerfile so that HA thinks it can build the image but is actually just pulling the prebuilt image. |
I saw a message in discord referencing a PR, fixing a bug where Supervisor would sometimes try to actually rebuild the image, which was never the intention. The purpose of the rebuild button is to rebuild the container, not the image. So I think what you're describing is how it's supposed to work 👍 |
I'm not entirely sure how the process works for add-ons, but I know that the
ESPHome (dev)
add-on has a "Rebuild" button that will cause it to rebuild the docker image from the latest dev branch.When we install the dev add-on from this repo, it installs a statically named "dev" image, and then never gives an option to update it or rebuild it. As far as I can tell, the only way to get a newer version is to uninstall and reinstall (but maybe I'm mistaken?)
Some information (about 2/3 down the article.. I tried to link to the section, but the link-to-highlight seems to get removed randomly by LinkedIn) I've found online seems to indicate that the Rebuild button is shown when the config.json does not contain an
image
field, which your dev repo does: https://github.com/mrlt8/edge-repo/blob/main/dev/config.jsonFor comparison, esphome-beta contains an
image
field: https://github.com/esphome/home-assistant-addon/blob/main/esphome-beta/config.yaml#L38while esphome-dev does not: https://github.com/esphome/home-assistant-addon/blob/main/esphome-dev/config.yaml
Also esphome-dev contains a build.yaml to describe how to do the rebuild: https://github.com/esphome/home-assistant-addon/blob/main/esphome-dev/build.yaml
It took me a long time to realize that my add-on was out of date (v2.0.1 while v2.1.5 was available), because Home Assistant did not offer to update it since version "dev" == "dev". I was using the dev build to test out some earlier changes you made for testing the Wyze Cam OG, and then never switched back to the main add-on image. I've since uninstalled the dev add-on and reinstalled the main one, so at least now I'll get update notifications again.
The text was updated successfully, but these errors were encountered: