-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
added and tested assembly #14
Conversation
Thanks @MeerKatDev :) Erik is off for a few days but will check it when he's back! |
build.sbt
Outdated
@@ -1,6 +1,6 @@ | |||
import Dependencies._ | |||
|
|||
ThisBuild / scalaVersion := "2.12.8" | |||
ThisBuild / scalaVersion := "2.13.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be the same version the exercises use, so I've reverted this.
project/Dependencies.scala
Outdated
@@ -1,5 +1,5 @@ | |||
import sbt._ | |||
|
|||
object Dependencies { | |||
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.1" | |||
lazy val scalaTest = "org.scalatest" %% "scalatest" % "3.0.8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be the same version the exercises use, so I've reverted this.
7a1ccf3
to
44b544f
Compare
@@ -5,7 +5,8 @@ WORKDIR /opt/test-runner | |||
COPY project/ project/ | |||
COPY src/ src/ | |||
COPY build.sbt build.sbt | |||
RUN sbt compile | |||
RUN sbt assembly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needed to be changed to actually build the jar
Dockerfile
Outdated
@@ -5,7 +5,8 @@ WORKDIR /opt/test-runner | |||
COPY project/ project/ | |||
COPY src/ src/ | |||
COPY build.sbt build.sbt | |||
RUN sbt compile | |||
RUN sbt assembly | |||
RUN chmod +x target/scala-2.12/TestRunner-assembly-0.1.0-SNAPSHOT.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set executable permissions to allow running the jar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the intention of the PR was not this. The meaning of using an assembled fat jar is to deploy it together with the test-runner and use that as an executable to run the uploaded exercises, not to generate it upon running the test-runner, because we'd be back to point one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we're not doing that. Were building the executable in the Dockerfile, which is only done when the test runner is deployed. For each test run, we're using the compiled test runner (see https://github.com/exercism/scala-test-runner/pull/14/files#diff-00a80c5821edea2ebf676056aa4c9a24e57379ef52cefecb2ccffaaf4cc362c9R57). The code in the Dockerfile is not executed.
@MeerKatDev I've updated the PR to use the pre-compiled binary. I'll merge this and then hopefully we're back to a sane execution time again. Thanks for the help! |
As discussed in #13 , to optimize the speed, the building time should be cut off completely for it to run in a decent amount of time (only the build takes 40-50 seconds).
I added sbt-assembly and successfully generated a far jar that contains all the dependencies needed. It can be run in place of
sbt compile
+sbt run
, so instead of compiling the test-runner for every run, the assembly can run as a standalone executable with:java -jar target/scala-2.13/TestRunner-assembly-0.1.0-SNAPSHOT.jar <arg1> <arg2> ...
Now I'm not sure how to change all those shell files (and the Dockerfile), also because there's no need to move the project files anymore. I tried to change
run.sh
accordingly, but I cannot understand how that all has to work :/