addon-ssh icon indicating copy to clipboard operation
addon-ssh copied to clipboard

Switch to Debian as base?

Open felipecrs opened this issue 3 years ago • 5 comments

Problem/Motivation

I like to keep my Home Assistant instance as my development environment for things such as addons and frontend plugins, so that I can make modifications in such files, build them and do not need to copy them from my computer to my Hass, since they would be already there.

The SSH addon helps a lot with that, but there are some limitations which I found to be quite bad:

  1. The VS Code - Remote SSH cannot connect to it (because it does not support Alpine)
  2. Lots of things fail to compile or to execute on Alpine (e.g. Volta, node-gyp)

Expected behavior

If the base were Debian, none of these issues would be found (as in VS Code addon, everything works perfectly there -- except that SSH server isn't exposed there).

Actual behavior

Described above.

Steps to reproduce

N/A

Proposed changes

Switching to Debian would solve most of the issues caused using Alpine, at the expense of...

$ docker images | grep base
ghcr.io/hassio-addons/debian-base/amd64                           6.0.0               4caf8ef75a9a   5 hours ago      96.9MB
ghcr.io/hassio-addons/base/amd64                                  12.0.0              79b575e6dfda   2 days ago       23.3MB

Not much, and the difference can be even lesser, as the Debian comes with some packages that aren't preinstalled in Alpine but would get preinstalled in SSH addon anyway.

Nevertheless, Debian is a more common environment for users (especially due to apt-get), which has some importance since the main goal of the SSH extension is to provide a distro-like environment inside Home Assistant.

Also, would make the VS Code addon and SSH addon more coordinated (e.g: users must know that in "Terminal" they use "apk", and in VS Code they use "apt-get").

Alternative

Instead of switching to Debian, we could also ship a variant. But I would rather jump directly to Debian to minimize maintenance. If not by the size, there aren't any benefits of using Alpine here (right?).

PS: I can help.

felipecrs avatar Jun 09 '22 14:06 felipecrs

I have considered (and played with it many times before), for the same reasons.

There are more expenses, in terms of speed and size (besides the base image). That all said; My main concern is the sizable breaking change it brings. Many people use this add-on with additional packages and have logic from external (e.g., flows from HA).

That latter is the main reason I've never taken this step.

Nevertheless, Debian is a more common environment for users (especially due to apt-get), which has some importance since the main goal of the SSH extension is to provide a distro-like environment inside Home Assistant.

True, however, it has proven to be pretty valuable actually. Most tutorials found online do not work because of the missing apt. This is good, as users are often not aware this is a containerized environment.

frenck avatar Jun 09 '22 16:06 frenck

True, however, it has proven to be pretty valuable actually. Most tutorials found online do not work because of the missing apt. This is good, as users are often not aware this is a containerized environment.

Interesting.

My main concern is the sizable breaking change it brings. Many people use this add-on with additional packages and have logic from external (e.g., flows from HA).

Additional packages: indeed, users would need to refactor it for sure, but they also can take as inspiration the additional packages they have set for the VS Code addon.

Logic from external: I think it would be a little rare to have a script from HA to call apk commands, but don't have data to prove this point.

Also, Alpine is used to provide stripped binaries (like simplified versions of GNU Coreutils with fewer options or without --long-names options), in which the Debian variant of the same supersedes the functionality without breaking the existing ones.


If we decide to switch to Debian, we need to bump the major version and point out the points of concern:

  • You need to rewrite additional_packages
  • You need to review init_commands to ensure they are compatible with the new base
  • You need to review any scripts/command that you may run as stdin services to ensure they are compatible with the new base

I do understand the breaking changes are sizeable, but if it's of common sense that Debian would be a better choice for the base image, then I believe we should face the situation.

felipecrs avatar Jun 09 '22 17:06 felipecrs

I have a Debian variant around, I know the implications of the change. But didn't do it before because of the above concerns.

I need to (at least) sleep over it

frenck avatar Jun 09 '22 18:06 frenck

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Jul 10 '22 08:07 github-actions[bot]

The bot marked it as stale, but its still on my todo (responding to get the bot to go away).

frenck avatar Jul 16 '22 18:07 frenck

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Aug 17 '22 08:08 github-actions[bot]

not stale...

frenck avatar Aug 17 '22 08:08 frenck

There hasn't been any activity on this issue recently, so we clean up some of the older and inactive issues. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thanks!

github-actions[bot] avatar Sep 17 '22 08:09 github-actions[bot]

Any updates on your thoughts? Tried to fork the repo and build my own debian variant but I'm getting lost along the way.

jgramling17 avatar Oct 01 '22 17:10 jgramling17