-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Make "final product" less(/not) reliant on Boot #92
Comments
In my opinion repeatability is worth it. Running |
I guess my question is more about whether we still need boot.properties, since we have moved away from using Boot tasks as the way to run Alda in the wild. For the "end product" version of Alda (i.e. the executable script), it shouldn't matter what version of Boot you have or what you might have |
Perhaps it's worth exploring a From the perspective of developers collaborating, and being able to cut long term release branches one day, I think the properties file should stay in the repo, even if it plays no role in the distributed artifact. |
OK -- I'm convinced that boot.properties can stay -- it makes sense from a development perspective :) I think having a |
I mulled this over for a while tonight, and another possibility occurred to me: I think dependency management via Maven would require Boot still, so maybe it would be better if we created a self-contained binary executable wrapping an uberjar -- that way, users would only need to have Java installed. We could generate a new executable each time we push a new release, and make it available on GitHub. I was able to create a standalone uberjar of Alda without AOT using the experimental boot-ubermain task, by running the following command:
One caveat is that the It would be nice to be able to generate a binary executable (preferably via a Boot task) from the uberjar, à la lein-bin. We could also make things right in Windows-land by using Launch4j to create a An open question is what the update process would be like if we went with the self-contained executable idea. I guess we could implement an |
We should take care not to store the uber-jarred binary file in this git repo -- with all the dependencies included (especially FluidR3, which is 125 MB), the size of the git repo would quickly grow out of hand. This might help: https://github.com/jedbrown/git-fat |
Another relevant point here is time to boot. On my machine (2011 MacBook Air) alda v0.7.0
alda -v 39,81s user 1,93s system 165% cpu 25,182 total which is really prohibitive. My experience is that a real aoted uber jar helps a lot and is the best you can have. Also the smaller the final Jar is, the better. Can FluidR3 be loaded externally somehow? |
@jeluard Yikes! I totally agree, the startup time should really not be that high. On my mid-2014 MacBook Pro, it's considerably shorter, but still not great:
A command-line utility like Alda really should not take that long to load. Boot-clj start-up time is a factor, as is JVM load-up time and loading the Clojure run-time. Removing the Boot requirement for the end user will help, not to mention AOT-compiling as much as we can and running Alda from an uberjar. Unfortunately, packaging everything into a jar makes it hard to load dependencies dynamically like that. Granted, we could always go outside of the Maven dependency infrastructure and just have the Alda program manually download the jar from Maven, unzip it and stick the soundfont in My initial thought was, it wouldn't be too annoying to just include FluidR3 in the jar. But then, the problem is that every time Alda is updated (which is quite frequently), you would need to download a new 100+ MB binary file, which would be obnoxious. |
I did some first tests and I now have a final uberjar of 7M that starts in 8s (3 times faster). Loading FluidR3 bumps load time to 21s. Loading FluidR3 directly (i.e. not wrapped in a Jar) removes a couple seconds. Much of the remaining code is clojure. Some random questions:
About FluidR3 an option could be to have This is assuming the update process is done externally, maybe taking inspiration on what |
Added bonus when removing dependencies: it will be easier to port to ClojureScript ;) |
This is awesome -- thanks for weighing in on this! I think we're definitely headed in the right direction here.
That's surprising!
Admittedly I don't know terribly much about Java and the JVM, aside from what I've learned through working with Clojure. I haven't dealt too much with things like classpaths. Would this be like adding an extra argument to the call to Right now Alda's updates are automatic, via the Boot script using the By the way, there is another, more permanent way to load FluidR3 into the JVM, which I wrote about here. I'm not sure if this is much better than loading FluidR3 from the sf2 file during the execution of Alda, but if it is, then we could consider automating the process of installing FluidR3 as the default JVM soundfont on the user's system, and then people could opt into it when they first get Alda by running
I'm on-board with cutting down on our dependencies, especially in light of all the performance issues people are having. I say the faster we can make Alda, the better!
Boot's
The
Yes - we use it for Alda's REPL.
You're right. Initially I wanted to use Overtone for generating sound (building synths, using them to play scores), but I've been rethinking that idea due to its dependency on Supercollider. I think I'd rather use something Java-powered, like Minim. At any rate, all we really need from Overtone at this point is |
Have you guys ever considered using another, non-JVM-dependent Lisp variant, like Hy? |
@kirbyfan64 Sorry -- Hy is cool, but I'm committed to Clojure :) |
Great! I'll work on a patch to reduce the startup time then.
Yes, I think it makes more sense to have a manual command to upgrade. It also makes the process more package manager friendly, if you ever feel like.
I didn't know that soundfont where directly supported at the JVM level. I will make some more tests to see how it impacts performance. From user perspective it sounds simpler to have a dedicated command for this too. From dev perspective also as it removes the soundfont management from the main path.
Ah ok. Is it magically used because it's on the classpath? |
Oh, whoops! Turns out we're not using reply! I think I was playing around with it at first, but then switched to using a JLine ConsoleReader via Java inter-op. We can totally scrap that dependency. A PR would be awesome! Let me know if there's anything I can help with. |
Things are getting interesting in the land of Boot -- the usual entrypoint, This is awesome because it means we can package A major benefit of this approach is that we won't have to re-think the parts of Alda that currently rely on Boot (namely the |
Sorry didn't manage to find time to push things further. This |
@daveyarwood packaging |
@micha That's a good idea. I've been working a little more on boot-jar2bin lately -- I was thinking of adding task options to set Java system properties in the script header. |
Currently planning 1.0.0-rc1, featuring a totally revised build pipeline. The entire project will be packaged into an uberjar and (although it's built via Boot) will not include Boot dependencies in the project itself. We will use boot-jar2bin to export Unix and Windows executables. |
I added
boot.properties
before Clojure 1.7.0 became the default Clojure version in Boot 2.2.0, as a way of enforcing that Clojure 1.7.0 be used when running Alda boot tasks, which used to be how you would run alda'splay
,parse
andrepl
tasks, pre-alda.cli
(i.e. instead of using thealda
executable, you wouldcd
into the Alda project directory and runboot play --file /some/file.alda
, orboot alda-repl
, etc.)Since then, the latest versions of Boot (since 2.2.0) have made Clojure 1.7.0 the default
BOOT_CLOJURE_VERSION
, and the usage instructions for Alda has moved from cloning the repo and running Boot tasks to copying a provided executable Boot script (bin/alda
) to your$PATH
and using thealda
command as an entrypoint into the tasks defined in thealda.cli
namespace.Bearing this in mind, does it make sense for us to still have a
boot.properties
file? With Boot steadily evolving and improving, I'm not sure I like the idea of pinning the Alda project to a specific version of Boot, when really all we want to enforce is Clojure 1.7.0 as a dependency.The text was updated successfully, but these errors were encountered: