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

DSM 7: Clean up packaging files and make it conform with Synology guidelines #178

Open
7 of 8 tasks
thopiekar opened this issue Dec 14, 2020 · 19 comments
Open
7 of 8 tasks
Milestone

Comments

@thopiekar
Copy link
Member

thopiekar commented Dec 14, 2020

We've been running our scripts with root rights for a long time.
With DSM 7 Synology prevents these packages to be installed and creates system users to define permissions safely.

I'm going to clean up the whole set of script and make it conform to Synology's guidelines. The download steps on preinstall will be kept, but I've got itchy fingers bundling all data in our spk.
I mean, logically you won't like to have our automatic next stable URL generator in any package like this.
I tried the used commands on my own and I already know what happens if someone likes to download 2.5.x, but once 3.x has been released, it will download 3.x. Our versioning here will be pointless.
However: This mechanism makes only sense if we detect major and minor and then download the latest version with the same major and minor version, but the most recent patch version. Per definition patch versions shouldn't break anything.
Finally, I'm wondering who tested this part of the script collection here.

But back to the topic: I've got DSM 7 beta installed here and will spend some time everyday on this. Will keep you posted.

  • Package includes openHAB
  • Package includes OpenJDK (x86_64 and arm)
  • Service starts
  • "openHAB" share is created by package manager
  • User data is saved in a persistent storage
  • Backup process is done as suggested by OpenHAB project and done using Synology's suggested backup directory for rollbacks
  • Content of the persistent storage is linked (another time) to the share
  • Update OH Manager to display UUID and CloudConnector ID NOT GOING TO HAPPEN NOW

PS: I'm also going to kill the "where to install" userdata functionality. Per Synology, you can register resources, like shares you need. Nevertheless, there is no way to say "hey, I need it optionally. I will tell you on install." Therefore, I'm going to create a "openhab" share fixed (as inspired by Docker). If someone likes to make it public, then give it "Everyone" permissions after install. And if you like to hide it, it can be done as you would do with the "docker" share. Something we can brainstorm still is a switch to link the files and directories into the share or make it "self-contained".

@thopiekar
Copy link
Member Author

Updates: OpenHAB install in a non-persistent environment now. Basically removed all the start up scripts and read how the Karaf project suggests to start services. Works perfectly fine. Guess I will end up with a completely rewritten package.

@cniweb
Copy link
Member

cniweb commented Dec 16, 2020

@thopiekar Thank you very much for your work. Let me know when you have.

@cniweb cniweb added this to the DSM7 milestone Dec 16, 2020
@thopiekar
Copy link
Member Author

Got only one thing left: Using the existing Synology app to display the uuid and cloud id from the userdata directory. I'm going to create a request for support at Synology on this. I just can't find any documentation about app development.

@MikeD23
Copy link

MikeD23 commented Dec 19, 2020

Hi @thopiekar, I am currently using openhab3 on my freenas server. I like it a lot and want now to install also this version on my fathers DS411 (armv5). I successfully installed your .spk for 3.0.0-SNAPSHOT but it will not start even the log says it has ("PID file created. done."). I just have java8 installed and since OH3 needs jre11 I think that is the reason.
If you are done implementing this will it also include openJDK11 for armv5? I would like to install it on my own until your done but I could not find any built version. I did not find any information about installation java11 on Synology.

@thopiekar
Copy link
Member Author

thopiekar commented Dec 19, 2020

"Your" is not really correct. I'm contributor of openHAB but never put much effort to the Synology subproject.
The packaging files will be completely rewritten.
Will create a pull request once I'm finished.

But you can do me a favour already.. can you access your dad's nas and run "uname -m"?

Thanks!

PS: Yes I'm planning to add OpenJDK for arm, too. Need "uname -m" for this. 😉

@MikeD23
Copy link

MikeD23 commented Dec 19, 2020

Sorry, I just came across this repo when I was looking for a way to install openhab on a synology and did not have a closer look. I thought you were the only contributor in here.

root@DS411:/# uname -m
armv5tel

I just found a zulu build (zulu11.43.100-ca-jdk11.0.9.1-linux_aarch32sf.tar.gz) of java 11. Might this work?

@thopiekar
Copy link
Member Author

I'm going to use AdoptOpenJDK.
They have a cleaner website and I couldn't find Arm builds by OpenJDK really. As AdoptOpenJDK provides builds for many architectures I'm taking it from there out of one hand. Nevertheless I'm going to focus on openHAB 2 first.

Generally give me some more time please 😉

@MikeD23
Copy link

MikeD23 commented Dec 20, 2020

Sure, take your time. I've got now 3.0.0-RC2 to run with zulu java11. It took me some time (and netstat) to get to know that openhabs webservice only listens to 8443 and not 8080. But now I'm logging in and I'm fine.
I'm so excited to bind all the new gadgets that santa will bring on christmas 😁

@thopiekar
Copy link
Member Author

I guess skip working on the UI and symlink the UUID and cloud id files to the share as I do for the other files for now.
Was talking with Syno support and they told me to file a ticket, so I can get help by a more technical person.

@cniweb I have two wishes:

  • I would like to review pull request, which are made on my work in the future. From what I saw contributed by the community I have the fear that we overload the script with unstable customizations. I think we should also focus on stable code rather being rich of features.
  • Remove or update the sponsor button: Doesn't matter whether it is being used or not, let's donate to the mother-project (https://www.openhab.org/about/donate.html) or just leave it.

@thopiekar
Copy link
Member Author

@MikeD23 Yeah, it is nice to see that OH3 has the same file structure. So no extra work for me here. Regarding Zulu builds: I need to twitch to these I guess. Was using AdoptOpenJDK but just noticed today that we (as OpenHAB family) recommend Zulu.
... Whatever the benefits are 😆

@cniweb
Copy link
Member

cniweb commented Dec 28, 2020

@thopiekar can you complete your work and do a pull request, please?

@thopiekar
Copy link
Member Author

@cniweb: PR created, but there is still some work left. How are your thoughts on the points above?

@cniweb
Copy link
Member

cniweb commented Jan 3, 2021

@thopiekar I remove the sponsor button.
Which points are you unclear exactly?

@cniweb
Copy link
Member

cniweb commented Jan 3, 2021

I agree with you that we will focus on stable code that is feature rich.

@thopiekar
Copy link
Member Author

@cniweb If I could get more involved into the project here. At least for the reviewing process.
I'm often busy as you can see, so if that happens it won't be anything blocking - you can go ahead with the activities of course. 🙂

So yeah, that would be really nice 😉

Btw. I continued on the PR. I'm waiting there for feedback by some brave testers.

@lebovitz
Copy link

@thopiekar
What's the status of the DSM 7 Syno package?
DSM 7 is now officially released. So I guess it's time for a package :-)

@thopiekar
Copy link
Member Author

Oh, yes. I'll rerun the build script it with the latest version of OpenHAB.
Also for 2.x since I'm still staying in this version because I'm feared of compatibility bugs. At the moment my setup just works fine ™.
.. due to the DSM7 release I also see lesser priority in the problem with DSM compatibility. It's like giving support for Windows XP 🤷

@lebovitz
Copy link

lebovitz commented Jul 1, 2021

I agree on the backward compatibility for OH2.
I tried your package on DSM7 and it seems to work.
There are a couple of questions I do have on your package

  1. It seems from the build.sh script that you download ALL versions of OpenJDK and the just use the one that fits the CPU. Why not download just this one version from the start?
  2. In DSM7 the OH package seems to be spread over many folders. It's no longer under /public/openHAB. The userdata folder is in one place, while the conf folder is in a different place. Some of the new locations can be accessed only by sudo. Is that inherent to DSM7 or can this be changed? It makes changing things very complicated

@gackelchen
Copy link

Just updated to DSM 7.
Do I understand right: openHAB 3 for DSM 7 is not yet ready?
Is OpenJDK 16 (rednoah) the right preparation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants