Skip to content
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

Mill Docker image #186

Closed
nightscape opened this issue Mar 2, 2018 · 3 comments
Closed

Mill Docker image #186

nightscape opened this issue Mar 2, 2018 · 3 comments

Comments

@nightscape
Copy link
Contributor

Hi all,
I've created a docker base image for mill so that it's easier to start a dockerized project with it:
https://hub.docker.com/r/nightscape/scala-mill/
I would happily contribute this as a PR to this repo.
IMO it makes sense to have an official Docker build to reduce fragmentation.

Two additional questions:
I tried to run Mill once during the Docker build so that it precompiles all the predefs etc.
Unfortunately that failed on Docker Hub (but not locally) because of a

Exception in thread "main" java.io.IOException: com.sun.jna.LastErrorException: [2] No such file or directory
	at org.scalasbt.ipcsocket.UnixDomainSocket.<init>(UnixDomainSocket.java:62)
	at mill.clientserver.Client.$anonfun$run$1(Client.scala:43)
	at mill.clientserver.ClientServer$.retry(ClientServer.scala:40)
	at mill.clientserver.Client.run(Client.scala:43)
	at mill.ClientMain$.$anonfun$main$1(Main.scala:60)
	at mill.ClientMain$.$anonfun$main$1$adapted(Main.scala:51)
	at mill.clientserver.Client$.WithLock(Client.scala:20)
	at mill.ClientMain$.main(Main.scala:51)
	at mill.ClientMain.main(Main.scala)

Do you have any idea how one could work around that?

It also seems that Mill still sometimes recompiles the predef files although it shouldn't be necessary.
I saw com-lihaoyi/Ammonite#542 but that should be solved, right?

@lihaoyi
Copy link
Member

lihaoyi commented Mar 2, 2018

@nightscape could you try using mill -i for things you run in docker/docker-hub? That would avoid the client-server setup, which is ok because command-latency on docker-hub doesn't matter, and removes one source of flakiness

@nightscape
Copy link
Contributor Author

nightscape commented Mar 3, 2018

The -i flag helped and the build now runs Mill once during build.
Any opinions on creating a PR and having an official lihaoyi/scala-mill Docker base image?
Also, is it a known problem about stuff recompiling although it shouldn't be necessary?
I only found closed issues in the Ammonite repo.

@lihaoyi
Copy link
Member

lihaoyi commented Mar 4, 2018

I'd say feel free to create your own docker image and we can link to it in the relevant places in the docs/intro.

For further questions about recompiling etc., come to the gitter channel

@lihaoyi lihaoyi closed this as completed Mar 4, 2018
c5c86a added a commit to c5c86a/HelloDockerScalaSbt that referenced this issue Jul 23, 2018
docker-compose run job bash -c 'cp -R /input/* /workspace/ && cd /workspace && mill -i foo.test'
Starting jenkinsfilerunner_box_1 ... done
Compiling (synthetic)/ammonite/predef/interpBridge.sc
Compiling (synthetic)/ammonite/predef/DefaultPredef.sc
Compiling /workspace/build.sc
[19/55] foo.sources
2 targets failed
mill.scalalib.ScalaWorkerModule.worker java.lang.ClassNotFoundException: mill.scalalib.worker.ScalaWorker
    java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    mill.util.ClassLoader3985anon.findClass(ClassLoader.scala:18)
    java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    mill.scalalib.ScalaWorkerModule.(ScalaWorkerApi.scala:44)
mill.scalalib.ScalaWorkerModule.worker java.lang.ClassNotFoundException: mill.scalalib.worker.ScalaWorker
    java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    mill.util.ClassLoader3985anon.findClass(ClassLoader.scala:18)
    java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    mill.scalalib.ScalaWorkerModule.(ScalaWorkerApi.scala:44)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants