diff --git a/frameworks/Scala/snunit/.dockerignore b/frameworks/Scala/snunit/.dockerignore index e4a162e5e02..2a371592c0f 100644 --- a/frameworks/Scala/snunit/.dockerignore +++ b/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 diff --git a/frameworks/Scala/snunit/benchmark_config.json b/frameworks/Scala/snunit/benchmark_config.json index 7711ab00316..f46cf29e0d8 100755 --- a/frameworks/Scala/snunit/benchmark_config.json +++ b/frameworks/Scala/snunit/benchmark_config.json @@ -19,8 +19,7 @@ "database_os": "Linux", "display_name": "SNUnit", "notes": "", - "versus": "", - "tags": ["broken"] + "versus": "" } } ] diff --git a/frameworks/Scala/snunit/build.sbt b/frameworks/Scala/snunit/build.sbt index e77aab72639..c44785e96c8 100644 --- a/frameworks/Scala/snunit/build.sbt +++ b/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, diff --git a/frameworks/Scala/snunit/conf.json b/frameworks/Scala/snunit/conf.json new file mode 100644 index 00000000000..0a6c3954949 --- /dev/null +++ b/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" + } + } + } +} diff --git a/frameworks/Scala/snunit/config.sh b/frameworks/Scala/snunit/config.sh deleted file mode 100755 index 12f0a511a10..00000000000 --- a/frameworks/Scala/snunit/config.sh +++ /dev/null @@ -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 diff --git a/frameworks/Scala/snunit/snunit.dockerfile b/frameworks/Scala/snunit/snunit.dockerfile index f83e84354c2..699c3c714f8 100644 --- a/frameworks/Scala/snunit/snunit.dockerfile +++ b/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" ]