Skip to content
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

Offline install #825

Closed
mstormi opened this issue Apr 3, 2020 · 8 comments · Fixed by #950 or #961
Closed

Offline install #825

mstormi opened this issue Apr 3, 2020 · 8 comments · Fixed by #950 or #961
Labels
enhancement New feature or request java Related to java upstream Not on us

Comments

@mstormi
Copy link
Contributor

mstormi commented Apr 3, 2020

Is openHABian install supposed to finish even when Internet access isn't available ?

At least a number of users expect it to. I myself, frankly, I don't know. @ThomDietrich ?
We have a number of reported install fails at
https://github.com/openhab/openhabian/blob/master/functions/openhab.bash#L60

While not fully analyzed yet, it all boils down to the introductory question.
If yes, we would also need to test install runs under this condition.
If yes, we would need to identify the basicmost packages we need to get openHABian+openHAB running and include them with the image:
That would at least be needed_packages() - probably only python - PLUS Java PLUS openHAB packages (current release).

@holgerfriedrich
Copy link
Member

@mstormi This would be a completely differnt approach compared to what we do now.
Currently, we have only sporadic releases of the base image and connect to the internet to upgrade the base system as well as openhabian and openhab. Latest is greatest approach. Following an offline approach for installation would require - at least from my point of view - regular releases of the base image including all updates up to that time. Jenkins/Travis could do this, but.... Considering the effort, I would vote against this. Let us deliver what we have and focus on stability. Developer community is too small for this.

Running openhabian-config without network is something different, at least for the part which changes some settings. Some people decide not to connect the home server to the internet and want it this way. So maybe the start of the script could skip the upgrade if not connected to the internet. Though, not sure how helpful this is at all. Nearly all functions are to install additional features, which is impossible withhout adding everything to the base image. I would suggest not to add error handling to the functions, maybe just a disclaimer/reminder when openhabian-config is started without internet connection.

@holgerfriedrich holgerfriedrich added this to the Refinement and Refocus milestone Apr 3, 2020
@holgerfriedrich holgerfriedrich added the question Further information is requested label Apr 3, 2020
@mstormi
Copy link
Contributor Author

mstormi commented Apr 3, 2020

It's really meant as an open question in the first place.
Was it supposed to work like that, @openhab/openhabian-maintainers ?

I'm critical on the latest-'n-greatest approach as discussed on other occasions, but that's not the point. It does not have to be one or the other.
I would imagine that assembling an image that would at least finish installing without Internet isn't too hard. Sure it won't contain latest fixes unless it can retrieve them from the Inet but then again if we combine say Raspi OS buster as of 06/01/2020 with stable OH 2.5.5, that would be a combo that we know to work without updates.

This could help in attracting users (or more precisely, to not lose them on first contact) because install fails.
I see a fair number of installs to fail just because "something" is wrong on the Inet or with the local environment, both is beyond our reach. It's sometimes caused by the user such as DHCP, DNS, firewall etc but it's also for instance repos to fail or change keys.
Java repo actually kept being an issue lately and was the reason for me to raise this question in the first place.

I'll take the discussion over to the team page.

@mstormi
Copy link
Contributor Author

mstormi commented May 25, 2020

I'd like to move this forward. Aiming for an offline install capable image.

Components we would need to validate / enable caching or other pre-storage method for
(cast "in order of appearance"):

FireMotD
ZRAM ? (it's Github just like OHian itself ...)
Java Zulu 8 see #869
openHAB2 stable release
vimrc, nanorc
Samba (is there a version included with Raspbian already ?)
Frontail

@holgerfriedrich
Copy link
Member

Really serious about this?

From my point of view this would require executing the first-boot script before shipping the image.
Otherwise we will end up with two different types of installations with different sets of installed packages.

@mstormi
Copy link
Contributor Author

mstormi commented May 25, 2020

Granted I have not analyzed what this would mean in detail but yes I'm serious about this because

This could help in attracting users (or more precisely, to not lose them on first contact) because install fails.

My basic idea is to split the current install routines of each of those packages into download and install functions and to only run the downloads as part of an image build, storing downloads on the filesystem and packing them into the image. No need to run the full first-boot I hope.
At installation time we will then download() again, checking for latest files on the Internet.
If that's unavailable we'll use the files from disk.

Let's carefully sort this out. No need to hurry.

@mstormi mstormi added enhancement New feature or request help wanted Extra attention is needed java Related to java upstream Not on us and removed question Further information is requested labels May 26, 2020
@mstormi mstormi mentioned this issue Jun 2, 2020
13 tasks
@mstormi
Copy link
Contributor Author

mstormi commented Jun 5, 2020

I created an access list on my router to block the openhabian box from accessing Internet, then
I called openhabian-config unattended on CLI and watched where it got hung.

We need to browse/check those routines we call in openhabian-set.bash

  • git needs to be part of image part of Raspi OS
  • zram and overlayfstools repos need to be part of the image (both in /opt/zram)
  • first-boot.bash#L132 halts install if no Internet fixed in Offline installation enhancements #950
  • frontail install hangs in "npm install" if server unreachable fixed in Offline installation enhancements #950
  • does preload/include default Java (Zulu 8) with image work ? yes /opt/jdk
  • does the current code do harm if to openHABian repo itself fails? the current version works and will be included with the image

@holgerfriedrich
Copy link
Member

What about the promised hook from #950 (comment) for all those packages we need to have available on offline installs ?

Can you already see what packages (including dependencies) are missing in the Rapberry Pi OS lite image? We need a proper way of installing them - I was thinking about a local apt repo.... If it is just a few, I would just install them in the beginning of the install from a cache folder....

@mstormi
Copy link
Contributor Author

mstormi commented Jun 15, 2020

Would need to lookup each time. Does not do harm to list and eventually run apt-get install on these again, does it ? Also good to document that's prerequisites.

git gcc libattr1-dev plus whatever they require as dependencies
(git, gcc are in)

And you need to call the fetch routines for zram and java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request java Related to java upstream Not on us
Projects
None yet
2 participants