[Nix-dev] Tips on deploying a Scala Play application

Teo Klestrup Röijezon teo at nullable.se
Wed Jul 6 05:41:12 CEST 2016


HI Erik,

That's pretty much entirely wrong. :P ParseTS is just a linter script for
the game scripting language TorqueScript. ParseTS-Playground was a pastebin
that would run the submitted code through the linter. For example, see
https://parsets-playground.nullable.se/snippets/13. The datastore used was
PostgreSQL.

Anyway, apart from the ParseTS stuff, at least those scripts should be
pretty much straightforward to copy to any Play application, though for the
config stuff to work you'll need to add the line 'include "local.conf"' to
your conf/application.conf.

Any chance you could post your current setup and the errors you get?

// Teo

On 6 July 2016 at 04:31, 4levels <4levels at gmail.com> wrote:

> Hi Teo,
>
> I've come quite far in setting up things, but I keep running into building
> errors.
> It has everything to do with me removing all references to parsets and
> postgres and renaming things here and there, trying to merge them with the
> current deploy setup.
>
> Do I understand correctly that parsets is a library to store data, using
> postgres in the background?  I'd like to start using Event Sourcing with
> Scala / Akka so I don't need a datastore like parsets, correct?  I'm very
> unsure about this as I literally started today with learning Scala / Play.
> I got my toes wet with Java before but that's really it.
>
> Something else I found interesting as I'm quite an Nginx fan and have
> nginx running with proxies already: Nginx has capabilities to deal with
> Java in different ways, as proxy or tied with eg Clojure for even faster
> results..
>
> The journey continues ;-)
>
>
> Kind regards,
>
> Erik
>
> On Tue, Jul 5, 2016 at 10:23 PM 4levels <4levels at gmail.com> wrote:
>
>> Hi Teo,
>>
>> Thank you for your explanation and quick qualitative response!
>>
>> I'll be looking at your code asap and report back with my experiences ;-)
>>
>> Kind regards,
>>
>> Erik
>>
>> On Tue, Jul 5, 2016, 22:08 Teo Klestrup Röijezon <teo at nullable.se> wrote:
>>
>>> Hi,
>>>
>>> A JRE should be enough for running it, but you need sbt and a JDK for
>>> building. I've got a derivation for a Play website at
>>> https://github.com/BlocklandGlass/ParseTS-Playground/blob/master/parsets-playground.nix,
>>> with the NixOS/NixOps setup at
>>> https://github.com/BlocklandGlass/ParseTS-Playground/tree/master/deployment
>>> .
>>>
>>> The gist of it is to run "sbt stage" in the build phase, and to then
>>> take "target/universal/stage" as your build output. However, you'll also
>>> need to wrap the launcher script to add your JRE and to add gawk (which the
>>> launcher script requires). Finally, on any modern system (such as NixOS)
>>> you'll also want to disable Play's PID file management, since systemd takes
>>> care of that anyway. I didn't in that script, but you'll probably also want
>>> to add a testing phase as part of the build.
>>>
>>> The big drawback with this approach is that SBT downloads all
>>> dependencies from the internet on demand, which won't work on a Nix setup
>>> with proper isolation (ideally, builds should only have network access if
>>> they deterministically produce a given hash).
>>>
>>> I've been toying with the idea of writing a sbt2nix SBT plugin that
>>> generates Nix definitions to build a local maven mirror for the
>>> dependencies, but I haven't got around to that (yet).
>>>
>>> // Teo
>>>
>>> On 5 July 2016 at 21:52, 4levels <4levels at gmail.com> wrote:
>>>
>>>> Hi Nix-devs,
>>>>
>>>> This is a plain request for assistance / best practices for using Nixos
>>>> with Java / Scala / Play.  Akka with EventSourcing are also a topic of
>>>> interest.
>>>>
>>>> I'm currently trying to get a Scala Play app up and running on my
>>>> nixOps deployed machines.  As I'm very unfamiliar with running Java based
>>>> apps, I'd like to know if someone has experience on the common pitfalls and
>>>> tips on keeping the servers healthy (I just caused my laptop's 8 cores to
>>>> go 100% without being able to stop the server started by the activator
>>>> call).
>>>>
>>>> I've seen some related packages in nixpkgs and have many questions like
>>>> eg. do I need sbt (which seems to provide typesafe - activator) and a jdk
>>>> on the production servers or are is a jre sufficient? How do I deploy and
>>>> run a Java app developed locally?
>>>> And how do I set-up a local nixos vm for Java development?
>>>>
>>>> I'm still investigating and learning a lot myself, so nix-related
>>>> knowledge is my main concern here (as I need to figure out the rest myself
>>>> anyway ;-)
>>>>
>>>> I'll be happy to share my findings and configuration / setup..
>>>>
>>>>
>>>> Kind regards,
>>>>
>>>> Erik
>>>>
>>>> _______________________________________________
>>>> nix-dev mailing list
>>>> nix-dev at lists.science.uu.nl
>>>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>>>
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160706/02070ead/attachment-0001.html>


More information about the nix-dev mailing list