-
-
Notifications
You must be signed in to change notification settings - Fork 501
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
DietPi-Sotware | PaperMC #4039
DietPi-Sotware | PaperMC #4039
Conversation
@MichaIng
therefore service would need to be restarted twice. Otherwise config files will not be created and following Another "issue" is the new download url https://papermc.io/api/v1/paper/1.16.4/latest/download
as you can see, file will be stored as |
This means we need to grant it more memory, e.g.
That is not an issue, the file is moved to correct location and name after download. It's simply that But what I like about the new download URL is that it matches the Nukkit sources and allows to skip the patch version (latest 1.16 instead of 1.16.4). Strange, when I enter that URL in browser, it forcefully redirects me to GitHub authentication 😄. |
Yes that's the old URL. The new one will download the jar file |
I mixed up old and new 😄. Hmm, the links from the download page actually point to API v2, so the docs seem outdated. Here is the latest download link from the main page: https://papermc.io/api/v2/projects/paper/versions/1.16.4/builds/390/downloads/paper-1.16.4-390.jar
|
well If I use https://papermc.io/api/v1/paper/1.16.4/latest/download I'm getting the latest file |
using
|
The latest build, but not the latest version. Okay got reply and indeed API v1 is deprecated, hence we'd need to use v2: https://papermc.io/api/docs |
So we would need to do following to get version https://papermc.io/api/v2/projects/paper/ to get build based on version https://papermc.io/api/v2/projects/paper/versions/1.16.4 and get the file name And finally have a download URL https://papermc.io/api/v2/projects/paper/versions/1.16.4/builds/390/downloads/paper-1.16.4-390.jar EDIT: Ahh that's what you wrote above already |
Installation on RPi1 is working as well. But honestly it is taking ages for the service to start. Not sure if it really make sense to have it running on boards with such less memory as the system is swapping already during initial start. PaperMC config file got created in around 10 minutes. Maybe we should set timeout value depending on SBC? Or disable it for boards with less than 1GB phys memory. |
Would be interesting to see what it actually does that is taking so long, probably we can report it upstream, or we can request a change so that the config file is created earlier or even have an "init" command option to only create config file and directory structure and exiting automatically afterwards. Another thing, probably |
that's the log for the first inital start on my RPi1. Most of time is spend on
Still I don't think running it on such small boards make sense. My RPi1 is running on 100% since I started at 1:30pm as well systems seems not healthy according logs. But not sure if that's important
Will test |
So here alone the download and patching this So the download alone of course highly depends on network speed, unpredictable. I remember these Another thing, there shows up a warning when less than 1 GiB memory is used. The docs even suggest 2 GiB: https://paper.readthedocs.io/en/latest/server/getting-started.html#running-the-server I did another test with 256 MiB memory, and while the server starts, I see this warning:
Additionally it takes very long to restart (to shutdown/save state, I assume). ... indeed:
90 seconds sigterm timeout, then it is killed, which means data loss! Now raised memory to 512 MiB:
While I'm no fan of restricting the install option to fast/high RAM devices (would be difficult to maintain a list and set a border), at least we should print a warning on <2 GiB boards that the swap file will be used intensively and hence it's highly recommended to have it on an external drive to not kill the SD card. We could allow unlimited time for config file creation, but we should print the server output then, so that users can see what it's doing. |
or at least limit initial start up to 30 minutes? I mean it doesn't make sense to have it running for ages as it will not be no fun running such a resource consuming application on small hardware anyway. |
Agreed, a very long limit should do. Of course I agree that running it at 100% CPU usage on idle (no clients connected) already doesn't make any sense. But it's hard to define a limit. E.g. is RPi 2 fast enough or not, what if it's overclocked, fast SD card or rootfs on fast SSD together with swap file, and such. So where possible, I'd avoid hardcoding such limits and let users make their own experiences. But a warning makes sense. |
just to confirm, |
+ DietPi-Software | PaperMC: reduce max java memory setting from 1024m down to 512m + DietPi-Software | PaperMC: ensure a memory setting of min 2GB (phys + swap). If needed, create a swap file + DietPi-Software | PaperMC: show an information about long start time during initial config creation
Init command request, let's see if there is more interest than just us in such a feature: PaperMC/Paper#5046 Okay, let's finish this:
EDIT: Ah I've overseen your last commits which already addressed the most important points 👍. |
yeah I tried to implement some of the items we discussed. Still outstanding is the download url creation. There I'm little bit out of ideas on best way/method. |
I'll do it, after finishing some image debootstrap tinkering. Heavily testing to create ARM images based on official Debian kernel, but it requires manual steps + U-Boot compiling often, and after wasting time on the NanoPi R4S, I recognised that my older tablet PSU is broken and I have no other sufficient one to power an RK3399... hopefully the new order arrives soon. Now redoing the same on NanoPi R2S and my brain is burning reading into a few new topics 😄. |
Wouldn't it be possible to do something like this to get the latest build ? BASE_URL='https://papermc.io/api/v2/projects/paper'
VERSION=$(curl -s $BASE_URL | jq -r '.versions[-1]')
BUILD=$(curl -s $BASE_URL/versions/$VERSION | jq -r '.builds[-1]')
NAME=$(curl -s $BASE_URL/versions/$VERSION/builds/$BUILD | jq -r '.downloads.application.name')
curl $BASE_URL/versions/$VERSION/builds/$BUILD/downloads/$NAME -o $NAME Only downside is that you will need to install jq ( |
Nearly exactly what I had in mind, although I'll do simple bash string manipulation 😉. |
Ok I've got this now, it uses curl, grep and tail. BASE_URL='https://papermc.io/api/v2/projects/paper'
VERSION=$(curl -s $BASE_URL | grep -o '[1-9\.]*' | tail -1)
BUILD=$(curl -s $BASE_URL/versions/1.16.4 | grep -o '[0-9]*' | tail -1)
NAME=paper-$VERSION-$BUILD.jar
curl $BASE_URL/versions/$VERSION/builds/$BUILD/downloads/$NAME -o $NAME |
@math-gout
|
@MichaIng |
+ DietPi-Software | PaperMC: Interactively warn user already on software selection about possible swap file usage and long startup times for pre-configuration + DietPi-Software | Create_Config: Allow to print service journal output to console for possible time consuming startups, so that users can follow the process. Additionally stop waiting if the service is not actively running anymore, e.g. due to a crash or other unexpected stop. + DietPi-Software | PaperMC: Print journal output of possible long taking service startup to console + DietPi-Software | PaperMC: Increase swap file only to assure a minimum of 1.5 GiB memory, which is sufficient (+buffer) for starting PaperMC with 512 MiB heap size. On >2 GiB physical RAM devices, apply 1024 MiB default heap size, which should not utilise the swap file then.
I adjusted handling of the swap/heap size a bit and service startup output is now printed to console:
And I forgot to mention the little prove of concept to derive the download URL with curl only without any additional external binary calls 😃. Practically no difference, but I like such shell magic. |
Nice idea to print service journal output 👍 Hope it is not confusing people as the server is stopp in middle of preparing spawn areas 🤔 Logfile attached. Click to expand!
|
Hmm, the journalctl process was not killed as expected 🤔. Also if it get's terminated, it shows an ugly line about that. Ah found it, the |
Ready for me, anything to add/test from you guys? |
Fine for me as well |
Status: Done
dietpi-software
Reference: https://dietpi.com/phpbb/viewtopic.php?p=30191#p30191
It is needed to update download URL according PaperMC docs
https://paper.readthedocs.io/en/latest/site/api.html#i-just-want-to-download-the-latest-jar
As well timer to start service would need to be increased as config file creation needs longer than 25 sec
[ INFO ] DietPi-Software | PaperMC config file got created after 61 seconds
Commit list/description: