Bläddra i källkod

Update Nginx Unit in SNUnit and update GC settings (#7447)

Lorenzo Gabriele 3 år sedan
förälder
incheckning
fc571a69de

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

@@ -2,15 +2,16 @@ import scala.scalanative.build._
 
 scalaVersion := "2.13.8"
 
-val snunitVersion = "0.0.17"
+val snunitVersion = "0.0.22"
 libraryDependencies ++= Seq(
   "com.github.lolgab" %%% "snunit" % snunitVersion,
-  "com.lihaoyi" %%% "upickle" % "1.6.0"
+  "com.lihaoyi" %%% "upickle" % "2.0.0"
 )
 
 nativeConfig ~= {
   _.withMode(Mode.releaseFull)
    .withLTO(LTO.thin)
+   .withGC(GC.commix)
 }
 
 enablePlugins(ScalaNativePlugin)

+ 7 - 2
frameworks/Scala/snunit/config.sh

@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+processes=$(expr $(nproc) / 2)
+
 config='{'
 config+='  "listeners": {'
 config+='    "*:8080": {'
@@ -9,8 +11,11 @@ config+='  },'
 config+='  "applications": {'
 config+='    "example": {'
 config+='      "type": "external",'
-config+='      "processes": '"$(nproc)"','
-config+='      "executable": "/app/example"'
+config+='      "processes": '"$processes"','
+config+='      "executable": "/app/example",'
+config+='      "environment": {'
+config+='        "SCALANATIVE_GC_THREADS": "2"'
+config+='      }'
 config+='    }'
 config+='  }'
 config+='}'

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

@@ -15,7 +15,7 @@ COPY . .
 
 RUN sbt nativeLink
 
-FROM nginx/unit:1.26.1-minimal
+FROM nginx/unit:1.27.0-minimal
 
 COPY /config.sh /docker-entrypoint.d/
 COPY --from=builder /workdir/target/scala-2.13/workdir-out /app/example