diff --git a/build/ol/install-packages.sh b/build/ol/install-packages.sh index 953997bf..5d4ca416 100755 --- a/build/ol/install-packages.sh +++ b/build/ol/install-packages.sh @@ -4,16 +4,18 @@ export TARGET set -euo pipefail +os_major_version=$(awk -F'[= ."]+' '/^VERSION_ID=/{ print $2 }' /etc/os-release) + # Install and configure dnf microdnf install dnf -y dnf install 'dnf-command(config-manager)' -y -dnf config-manager --set-enabled ol8_codeready_builder +dnf config-manager --set-enabled ol${os_major_version}_codeready_builder # Add EPEL repository -tee /etc/yum.repos.d/ol8-epel.repo <[g|G|m|M|k|K]`. +The values of all three are passed directly to the JVM and support format/units as `[g|G|m|M|k|K]`. !!! example "Using docker run" - + ``` -e MEMORY=2G ``` @@ -23,7 +23,7 @@ The values of all three are passed directly to the JVM and support format/units ``` !!! example "Using compose file" - + ``` environment: MEMORY: 2G @@ -48,7 +48,7 @@ To let the JVM calculate the heap size from the container declared memory limit, deploy: resources: limits: - memory: 4G + memory: 4G ``` !!! important @@ -68,7 +68,7 @@ docker run ... -e JVM_OPTS="-someJVMOption someJVMOptionValue" ... ```yaml environment: - EULA=true - - JVM_OPTS=-someJVMOption someJVMOptionValue + - JVM_OPTS=-someJVMOption someJVMOptionValue ``` Using object syntax is recommended and more intuitive: @@ -112,7 +112,7 @@ If needing to map to a different port, then also set the environment variable `J !!! example With a compose file: - + ```yaml environment: ENABLE_JMX: true @@ -131,3 +131,13 @@ The set of flags documented there can be added using -e USE_AIKAR_FLAGS=true When `MEMORY` is greater than or equal to 12G, then the Aikar flags will be adjusted according to the article. + +## Enable MeowIce's Flags + +[MeowIce has created an updated set of JVM flags](https://github.com/MeowIce/meowice-flags?tab=readme-ov-file#why-would-i-have-to-switch-) based on Aikar's flags but with support for optimizations for Java 17 and above + +The set of flags documented there can be added using + + -e USE_MEOWICE_FLAGS=true + +There is an optional `USE_MEOWICE_GRAALVM_FLAGS` variable to enable GraalVM specific optimizations, defaults to `TRUE` if USE_MEOWICE_GRAALVM_FLAGS is `TRUE` diff --git a/docs/types-and-platforms/server-types/bukkit-spigot.md b/docs/types-and-platforms/server-types/bukkit-spigot.md index 4f9f55a8..186645e3 100644 --- a/docs/types-and-platforms/server-types/bukkit-spigot.md +++ b/docs/types-and-platforms/server-types/bukkit-spigot.md @@ -12,7 +12,7 @@ Run a Bukkit/Spigot server type by setting the environment variable `TYPE` to "B ``` docker run ... -e TYPE=SPIGOT ... ``` - + Compose ```yaml environment: @@ -50,3 +50,16 @@ Canyon is on a temporary hiatus, so by default the final build from GitHub will -e CANYON_BUILD=6 -e CANYON_BUILD=26 + +### Poseidon + +[Poseidon](https://github.com/retromcorg/Project-Poseidon) is a fork of CraftBukkit for Minecraft Beta 1.7.3. It includes multiple enhancements whilst also retaining compatibility with old Bukkit plugins. + + -e VERSION=b1.7.3 -e TYPE=CANYON + +!!! important + Only `VERSION=b1.7.3` is supported. Since that version pre-dates the health check mechanism used by this image, that will need to be disabled by setting `DISABLE_HEALTHCHECK=true`. + +### Uberbukkit + +[Uberbukkit](https://github.com/Moresteck/uberbukkit) is a fork of CraftBukkit for Minecraft Beta with Multi version support, supports b1.0 - b1.7.3 diff --git a/docs/types-and-platforms/server-types/hybrids.md b/docs/types-and-platforms/server-types/hybrids.md index c8b6a780..c05084d0 100644 --- a/docs/types-and-platforms/server-types/hybrids.md +++ b/docs/types-and-platforms/server-types/hybrids.md @@ -84,3 +84,10 @@ A [Catserver](http://catserver.moe/) type server can be used with -e TYPE=CATSERVER > **NOTE** Catserver only provides a single release stream, so `VERSION` is ignored + +### Arclight + +A [Arclight](https://arclight.izzel.io/) type server can be used with + + -e TYPE=ARCLIGHT + -e ARCLIGHT_TYPE=NEOFORGE,FORGE,FABRIC diff --git a/docs/types-and-platforms/server-types/others.md b/docs/types-and-platforms/server-types/others.md index 7aa977ae..4f8ab950 100644 --- a/docs/types-and-platforms/server-types/others.md +++ b/docs/types-and-platforms/server-types/others.md @@ -39,6 +39,12 @@ Configuration options with defaults: Instead of using format codes in the MOTD, Limbo requires [JSON chat content](https://minecraft.wiki/w/Raw_JSON_text_format#Java_Edition). If a plain string is provided, which is the default, then it gets converted into the required JSON structure. +## NanoLimbo + +A [NanoLimbo](https://github.com/Nan1t/NanoLimbo) server can be run by setting `TYPE` to `NANOLIMBO`. + +An alternate Limbo server + ## Crucible A [Crucible](https://github.com/CrucibleMC/Crucible) server can be run by setting `TYPE` to `CRUCIBLE`. @@ -65,4 +71,4 @@ Alternatively, the final `-jar` invocation can be replaced by setting `CUSTOM_JA When using `docker run` make sure to quote the entire value since it has spaces in it, such as - -e CUSTOM_JAR_EXEC="-cp worldedit.jar:Carpet-Server.jar net.minecraft.server.MinecraftServer" \ No newline at end of file + -e CUSTOM_JAR_EXEC="-cp worldedit.jar:Carpet-Server.jar net.minecraft.server.MinecraftServer" diff --git a/docs/variables.md b/docs/variables.md index 1f4928e8..1e2e6709 100644 --- a/docs/variables.md +++ b/docs/variables.md @@ -1,7 +1,7 @@ !!! warning - The variables listed on this page are manually documented and may be out-of-date or inaccurate. + The variables listed on this page are manually documented and may be out-of-date or inaccurate. All other documentation pages are actively maintained, so please use the search box above to find the desired topic. @@ -48,7 +48,7 @@ TZ - You can configure the timezone to match yours by setting the TZ environment variable. + You can configure the timezone to match yours by setting the TZ environment variable. alternatively, you can mount: /etc/localtime:/etc/localtime:ro @@ -81,6 +81,18 @@ alternatively, you can mount: /etc/localtime:/etc/localtime:ro false ⬜️ + + USE_MEOWICE_FLAGS + MeowIce has created an updated set of JVM flags based on Aikar's flags but with support for optimizations for Java 17 and above + false + ⬜️ + + + USE_MEOWICE_GRAALVM_FLAGS + enables MeowIce's flags for GraalVM if USE_MEOWICE_GRAALVM_FLAGS is TRUE + true + ⬜️ + JVM_OPTS General JVM options can be passed to the Minecraft Server invocation by passing a JVM_OPTS environment variable. The JVM requires -XX options to precede -X options, so those can be declared in JVM_XX_OPTS. Both variables are space-delimited, raw JVM arguments @@ -711,7 +723,7 @@ alternatively, you can mount: /etc/localtime:/etc/localtime:ro ### CurseForge !!! tip - + Refer to the [main documentation page](types-and-platforms/mod-platforms/auto-curseforge.md) for more details and up-to-date information. diff --git a/scripts/start-configuration b/scripts/start-configuration index 2eac7933..b1df96c3 100755 --- a/scripts/start-configuration +++ b/scripts/start-configuration @@ -274,6 +274,10 @@ case "${TYPE^^}" in exec "${SCRIPTS:-/}start-deployLimbo" "$@" ;; + NANOLIMBO) + exec "${SCRIPTS:-/}start-deployNanoLimbo" "$@" + ;; + CRUCIBLE) exec "${SCRIPTS:-/}start-deployCrucible" "$@" ;; @@ -282,11 +286,19 @@ case "${TYPE^^}" in exec "${SCRIPTS:-/}start-deployLeaf" "$@" ;; + ARCLIGHT) + exec "${SCRIPTS:-/}start-deployArcLight" "$@" + ;; + + POSEIDON) + exec "${SCRIPTS:-/}start-deployPoseidon" "$@" + ;; + *) logError "Invalid TYPE: '$TYPE'" logError "Must be: VANILLA, FORGE, BUKKIT, SPIGOT, PAPER, FOLIA, PURPUR, FABRIC, QUILT," logError " SPONGEVANILLA, CUSTOM, MAGMA, MOHIST, CATSERVER, AIRPLANE, PUFFERFISH," - logError " CANYON, LIMBO, CRUCIBLE, LEAF, YOUER, BANNER" + logError " CANYON, LIMBO, NANOLIMBO, CRUCIBLE, LEAF, YOUER, BANNER" exit 1 ;; diff --git a/scripts/start-deployArcLight b/scripts/start-deployArcLight new file mode 100755 index 00000000..b90f01cc --- /dev/null +++ b/scripts/start-deployArcLight @@ -0,0 +1,41 @@ +#!/bin/bash + +# shellcheck source=start-utils +. "${SCRIPTS:-$(dirname "$0")}/start-utils" +set -o pipefail +set -e +isDebugging && set -x + +resolveVersion +: "${ARCLIGHT_RELEASE:=latest}" +: "${ARCLIGHT_TYPE:=neoforge}" + +arclightReleasesUrl=https://api.github.com/repos/IzzelAliz/Arclight/releases +if [[ ${ARCLIGHT_RELEASE^^} = LATEST ]]; then + arclightReleaseUrl=${arclightReleasesUrl}/latest +else + arclightReleaseUrl=${arclightReleasesUrl}/tags/${ARCLIGHT_RELEASE} +fi + +if ! downloadUrl=$(get --json-path "$.assets[?(@.name =~ /arclight-${ARCLIGHT_TYPE,,}-${VERSION}-.*\.jar/)].browser_download_url" \ + --accept "application/vnd.github.v3+json" "$arclightReleaseUrl"); then + logError "Failed to access ${ARCLIGHT_RELEASE} release of Arclight" + exit 1 +fi + +if [[ $downloadUrl = null ]]; then + logError "Failed to locate Arclight jar for $VERSION from ${ARCLIGHT_RELEASE}" + exit 1 +fi + +log "Downloading Arclight from $downloadUrl" +if ! SERVER=$(get --skip-existing --output-filename -o /data "$downloadUrl"); then + logError "Arclight jar from $downloadUrl" + exit 1 +fi + +export SERVER +export FAMILY=HYBRID +export HYBRIDTYPE="${ARCLIGHT_TYPE,,}" + +exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployCatserver b/scripts/start-deployCatserver index 6e97c011..a29c73f5 100755 --- a/scripts/start-deployCatserver +++ b/scripts/start-deployCatserver @@ -28,5 +28,6 @@ if [ ! -f ${SERVER} ]; then fi export FAMILY=HYBRID +export HYBRIDTYPE=forge exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployCrucible b/scripts/start-deployCrucible index 60174d9d..288f9436 100755 --- a/scripts/start-deployCrucible +++ b/scripts/start-deployCrucible @@ -56,5 +56,6 @@ fi export SERVER export FAMILY=HYBRID +export HYBRIDTYPE=forge exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployCustom b/scripts/start-deployCustom index 480e5c4a..0cd4023c 100755 --- a/scripts/start-deployCustom +++ b/scripts/start-deployCustom @@ -40,5 +40,6 @@ fi # Allow for overriding Family on custom for testing. export FAMILY="${FAMILY:-HYBRID}" +export HYBRIDTYPE="${HYBRIDTYPE:-any}" exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployKetting b/scripts/start-deployKetting index 435080be..6f9e476e 100755 --- a/scripts/start-deployKetting +++ b/scripts/start-deployKetting @@ -28,5 +28,6 @@ export EXTRA_ARGS export SERVER export FAMILY=HYBRID +export HYBRIDTYPE=forge exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployMagma b/scripts/start-deployMagma index 7aceee7e..32bc3a92 100755 --- a/scripts/start-deployMagma +++ b/scripts/start-deployMagma @@ -25,5 +25,6 @@ fi export SERVER export FAMILY=HYBRID +export HYBRIDTYPE=forge exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployMagmaMaintained b/scripts/start-deployMagmaMaintained index 110828fe..c063b364 100755 --- a/scripts/start-deployMagmaMaintained +++ b/scripts/start-deployMagmaMaintained @@ -34,5 +34,6 @@ fi export SERVER export FAMILY=HYBRID +export HYBRIDTYPE=forge exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployMohist b/scripts/start-deployMohist index 616ac534..d5afd364 100755 --- a/scripts/start-deployMohist +++ b/scripts/start-deployMohist @@ -48,7 +48,17 @@ if [ ! -f "${SERVER}" ]; then get -o "${SERVER}" "${downloadUrl}" fi -export FAMILY=HYBRID +if [[ "${mohistType}" == "mohist" ]]; then + export HYBRIDTYPE=forge +elif [[ "${mohistType}" == "youer" ]]; then + export HYBRIDTYPE=neoforge +elif [[ "${mohistType}" == "banner" ]]; then + export HYBRIDTYPE=fabric +else + log "Unknown server type" +fi + export SERVER +export FAMILY=HYBRID exec "${SCRIPTS:-/}start-spiget" "$@" diff --git a/scripts/start-deployNanoLimbo b/scripts/start-deployNanoLimbo new file mode 100755 index 00000000..a5a0f00b --- /dev/null +++ b/scripts/start-deployNanoLimbo @@ -0,0 +1,19 @@ +#!/bin/bash + +# shellcheck source=start-utils +. "${SCRIPTS:-/}start-utils" +isDebugging && set -x + +if ! SERVER=$(mc-image-helper github download-latest-asset \ + --output-directory=/data \ + --name-pattern="NanoLimbo-.+?(?= $(normalizeMemSize 12g) )); then + if isTrue "${USE_MEOWICE_FLAGS}"; then + log "Using MeowIce's flags" + G1NewSizePercent=28 + G1MaxNewSizePercent=50 + G1HeapRegionSize=16M + G1ReservePercent=15 + InitiatingHeapOccupancyPercent=20 + G1MixedGCCountTarget=3 + G1RSetUpdatingPauseTimePercent=0 + elif [[ $MAX_MEMORY ]] && (( $(normalizeMemSize "${MAX_MEMORY}") >= $(normalizeMemSize 12g) )); then log "Using Aikar's >12GB flags" G1NewSizePercent=40 G1MaxNewSizePercent=50 G1HeapRegionSize=16M G1ReservePercent=15 InitiatingHeapOccupancyPercent=20 + G1MixedGCCountTarget=4 + G1RSetUpdatingPauseTimePercent=5 else log "Using Aikar's flags" G1NewSizePercent=30 @@ -168,6 +190,8 @@ if isTrue "${USE_AIKAR_FLAGS}"; then G1HeapRegionSize=8M G1ReservePercent=20 InitiatingHeapOccupancyPercent=15 + G1MixedGCCountTarget=4 + G1RSetUpdatingPauseTimePercent=5 fi JVM_XX_OPTS="${JVM_XX_OPTS} @@ -182,10 +206,10 @@ if isTrue "${USE_AIKAR_FLAGS}"; then -XX:G1HeapRegionSize=${G1HeapRegionSize} -XX:G1ReservePercent=${G1ReservePercent} -XX:G1HeapWastePercent=5 - -XX:G1MixedGCCountTarget=4 + -XX:G1MixedGCCountTarget=${G1MixedGCCountTarget} -XX:InitiatingHeapOccupancyPercent=${InitiatingHeapOccupancyPercent} -XX:G1MixedGCLiveThresholdPercent=90 - -XX:G1RSetUpdatingPauseTimePercent=5 + -XX:G1RSetUpdatingPauseTimePercent=${G1RSetUpdatingPauseTimePercent} -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 @@ -194,6 +218,110 @@ if isTrue "${USE_AIKAR_FLAGS}"; then " fi +if isTrue "${USE_MEOWICE_FLAGS}"; then + JVM_XX_OPTS="${JVM_XX_OPTS} + -XX:+UnlockDiagnosticVMOptions + -XX:G1SATBBufferEnqueueingThresholdPercent=30 + -XX:G1ConcMarkStepDurationMillis=5 + -XX:+UseNUMA + -XX:-DontCompileHugeMethods + -XX:MaxNodeLimit=240000 + -XX:NodeLimitFudgeFactor=8000 + -XX:ReservedCodeCacheSize=400M + -XX:NonNMethodCodeHeapSize=12M + -XX:ProfiledCodeHeapSize=194M + -XX:NonProfiledCodeHeapSize=194M + -XX:NmethodSweepActivity=1 + -XX:+UseFastUnorderedTimeStamps + -XX:+UseCriticalJavaThreadPriority + -XX:AllocatePrefetchStyle=3 + -XX:+AlwaysActAsServerClassMachine + -XX:+UseTransparentHugePages + -XX:LargePageSizeInBytes=2M + -XX:+UseLargePages + -XX:+EagerJVMCI + -XX:+UseStringDeduplication + -XX:+UseAES + -XX:+UseAESIntrinsics + -XX:+UseFMA + -XX:+UseLoopPredicate + -XX:+RangeCheckElimination + -XX:+OptimizeStringConcat + -XX:+UseCompressedOops + -XX:+UseThreadPriorities + -XX:+OmitStackTraceInFastThrow + -XX:+RewriteBytecodes + -XX:+RewriteFrequentPairs + -XX:+UseFPUForSpilling + -XX:+UseFastStosb + -XX:+UseNewLongLShift + -XX:+UseVectorCmov + -XX:+UseXMMForArrayCopy + -XX:+UseXmmI2D + -XX:+UseXmmI2F + -XX:+UseXmmLoadAndClearUpper + -XX:+UseXmmRegToRegMoveAll + -XX:+EliminateLocks + -XX:+DoEscapeAnalysis + -XX:+AlignVector + -XX:+OptimizeFill + -XX:+EnableVectorSupport + -XX:+UseCharacterCompareIntrinsics + -XX:+UseCopySignIntrinsic + -XX:+UseVectorStubs + -XX:UseAVX=2 + -XX:UseSSE=4 + " +fi + +if isTrue "${USE_MEOWICE_GRAALVM_FLAGS}"; then + if [[ $java_major_version -lt 25 ]]; then + log "Java 24 or higher detected, using modified GraalVM flags" + JVM_XX_OPTS="${JVM_XX_OPTS} + -XX:+UseFastJNIAccessors + -XX:+UseInlineCaches + -XX:+SegmentedCodeCache + -Djdk.nio.maxCachedBufferSize=262144 + -Djdk.graal.UsePriorityInlining=true + -Djdk.graal.Vectorization=true + -Djdk.graal.OptDuplication=true + -Djdk.graal.DetectInvertedLoopsAsCounted=true + -Djdk.graal.LoopInversion=true + -Djdk.graal.VectorizeHashes=true + -Djdk.graal.EnterprisePartialUnroll=true + -Djdk.graal.VectorizeSIMD=true + -Djdk.graal.StripMineNonCountedLoops=true + -Djdk.graal.SpeculativeGuardMovement=true + -Djdk.graal.TuneInlinerExploration=1 + -Djdk.graal.LoopRotation=true + -Djdk.graal.CompilerConfiguration=enterprise + --enable-native-access=ALL-UNNAMED + " + else + log "Using MeowIce's flags for Graalvm" + JVM_XX_OPTS="${JVM_XX_OPTS} + -XX:+UseFastJNIAccessors + -XX:+UseInlineCaches + -XX:+SegmentedCodeCache + -Djdk.nio.maxCachedBufferSize=262144 + -Dgraal.UsePriorityInlining=true + -Dgraal.Vectorization=true + -Dgraal.OptDuplication=true + -Dgraal.DetectInvertedLoopsAsCounted=true + -Dgraal.LoopInversion=true + -Dgraal.VectorizeHashes=true + -Dgraal.EnterprisePartialUnroll=true + -Dgraal.VectorizeSIMD=true + -Dgraal.StripMineNonCountedLoops=true + -Dgraal.SpeculativeGuardMovement=true + -Dgraal.TuneInlinerExploration=1 + -Dgraal.LoopRotation=true + -Dgraal.OptWriteMotion=true + -Dgraal.CompilerConfiguration=enterprise + " + fi +fi + if isTrue "${USE_FLARE_FLAGS}"; then JVM_XX_OPTS="${JVM_XX_OPTS} -XX:+UnlockDiagnosticVMOptions @@ -360,4 +488,3 @@ else exec mc-server-runner ${bootstrapArgs} "${mcServerRunnerArgs[@]}" java "${finalArgs[@]}" fi fi - diff --git a/scripts/start-setupModpack b/scripts/start-setupModpack index ea52d135..a9a982c3 100755 --- a/scripts/start-setupModpack +++ b/scripts/start-setupModpack @@ -264,7 +264,7 @@ function handleModrinthProjects() { if [[ $MODRINTH_PROJECTS ]]; then if isFamily HYBRID; then - loader=forge + loader=${HYBRIDTYPE} elif isFamily VANILLA; then loader=datapack else @@ -297,7 +297,7 @@ function handleCurseForgeFiles() { if isFamily HYBRID; then # To disambiguate mc-mods we'll assume that hybrid servers # are blending Forge (rather than Fabric or NeoForge) - args+=(--mod-loader "forge") + args+=(--mod-loader "${HYBRIDTYPE}") fi ;; esac