Bläddra i källkod

Update SNUnuit NGINX Unit and try to fix startup errors (#9522)

* Update SNUnuit NGINX Unit and try to fix startup errors

* Try remove the `broken` tag
Lorenzo Gabriele 7 månader sedan
förälder
incheckning
db4831a670

+ 1 - 1
frameworks/Scala/snunit/.dockerignore

@@ -3,7 +3,7 @@
 
 # Allow files and directories
 !/build.sbt
-!/config.sh
+!/conf.json
 !/project/build.properties
 !/project/plugins.sbt
 !/src

+ 1 - 2
frameworks/Scala/snunit/benchmark_config.json

@@ -19,8 +19,7 @@
         "database_os": "Linux",
         "display_name": "SNUnit",
         "notes": "",
-        "versus": "",
-        "tags": ["broken"]
+        "versus": ""
       }
     }
   ]

+ 2 - 2
frameworks/Scala/snunit/build.sbt

@@ -2,8 +2,8 @@ import scala.scalanative.build._
 
 scalaVersion := "3.5.2"
 
-val snunitVersion = "0.10.2"
-val jsoniterScalaVersion = "2.31.3"
+val snunitVersion = "0.10.3"
+val jsoniterScalaVersion = "2.33.0"
 
 libraryDependencies ++= Seq(
   "com.github.lolgab" %%% "snunit" % snunitVersion,

+ 20 - 0
frameworks/Scala/snunit/conf.json

@@ -0,0 +1,20 @@
+{
+  "listeners": {
+    "*:8080": {
+      "pass": "applications/example"
+    }
+  },
+  "applications": {
+    "example": {
+      "type": "external",
+      "processes": {
+        "spare": 2,
+        "max": 20
+      },
+      "executable": "/app/example",
+      "environment": {
+        "SCALANATIVE_GC_THREADS": "2"
+      }
+    }
+  }
+}

+ 0 - 26
frameworks/Scala/snunit/config.sh

@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-
-processes=$(("$(nproc)" / 2))
-
-config='{'
-config+='  "listeners": {'
-config+='    "*:8080": {'
-config+='      "pass": "applications/example"'
-config+='    }'
-config+='  },'
-config+='  "applications": {'
-config+='    "example": {'
-config+='      "type": "external",'
-config+='      "processes": '"$processes"','
-config+='      "executable": "/app/example",'
-config+='      "environment": {'
-config+='        "SCALANATIVE_GC_THREADS": "2"'
-config+='      }'
-config+='    }'
-config+='  }'
-config+='}'
-
-curl -X PUT \
-     --data-binary "$config" \
-     --unix-socket /var/run/control.unit.sock \
-     http://localhost/config

+ 10 - 3
frameworks/Scala/snunit/snunit.dockerfile

@@ -6,18 +6,25 @@ RUN apt-get update && apt-get install -y curl gnupg && \
   curl -sL https://nginx.org/keys/nginx_signing.key | apt-key add - && \
   echo "deb https://packages.nginx.org/unit/debian/ bookworm unit" > /etc/apt/sources.list.d/unit.list && \
   echo "deb-src https://packages.nginx.org/unit/debian/ bookworm unit" >> /etc/apt/sources.list.d/unit.list && \
-  apt-get update && apt-get install -y clang unit-dev=1.33* openjdk-17-jdk sbt=1.10.5 && \
+  apt-get update && apt-get install -y clang unit-dev=1.34* openjdk-17-jdk sbt=1.10.5 && \
   apt-get purge -y gnupg
 
 WORKDIR /workdir
 
+RUN sbt version
+
 COPY . .
 
 RUN sbt nativeLink
 
-FROM unit:1.33.0-minimal
+FROM unit:1.34.0-minimal
+
+WORKDIR /workdir
 
-COPY /config.sh /docker-entrypoint.d/
+COPY conf.json statedir/
+COPY --from=builder /usr/sbin/unitd /usr/sbin/unitd
 COPY --from=builder /workdir/target/scala-3.5.2/workdir /app/example
 
 EXPOSE 8080
+
+ENTRYPOINT [ "unitd", "--no-daemon", "--statedir", "/workdir/statedir", "--log", "/dev/stdout" ]