Deploy Haskell application

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Deploy Haskell application

Corentin Dupont
Hi guys!
Is there a procedure to deploy a Haskell application?
I have an Amazon EC2 micro instance to run my application, but it's way too small to compile it using cabal (compilation takes half a day rouhgly), so I compile it on my computer.
Is there a convenient way to bundle the executable with the resources and ship it to the server?

Thanks!
Corentin

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Vo Minh Thu
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:

> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Tom Nielsen
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Corentin Dupont
Thanks for your response!
Is there a way to ask Cabal to just deploy the resources and not compile everything?



On Wed, Jun 11, 2014 at 11:47 AM, Tom Nielsen <[hidden email]> wrote:
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Tom Nielsen
Not sure what you mean - cabal doesn't do any deployment, or at least I have not found a useful way of making it do so. In our case the deployment is done by running apt-get update && apt-get install on the server.

Tom




On Wed, Jun 11, 2014 at 3:18 PM, Corentin Dupont <[hidden email]> wrote:
Thanks for your response!
Is there a way to ask Cabal to just deploy the resources and not compile everything?



On Wed, Jun 11, 2014 at 11:47 AM, Tom Nielsen <[hidden email]> wrote:
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Corentin Dupont
In the .cabal file you can put a directive "data-files" and they will be deployed in ~/.cabal/share...
I want to trigger only this.


On Wed, Jun 11, 2014 at 3:40 PM, Tom Nielsen <[hidden email]> wrote:
Not sure what you mean - cabal doesn't do any deployment, or at least I have not found a useful way of making it do so. In our case the deployment is done by running apt-get update && apt-get install on the server.

Tom




On Wed, Jun 11, 2014 at 3:18 PM, Corentin Dupont <[hidden email]> wrote:
Thanks for your response!
Is there a way to ask Cabal to just deploy the resources and not compile everything?



On Wed, Jun 11, 2014 at 11:47 AM, Tom Nielsen <[hidden email]> wrote:
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Corentin Dupont
Hi,
it seems that 'cabal configure' fails if some dependencies are missing. Then cabal copy complains that I should run 'cabal configure' first...


On Wed, Jun 11, 2014 at 4:23 PM, Tom Feron <[hidden email]> wrote:
Hi Corentin,

I think you're searching for `cabal configure && cabal copy`. It will still have an exit code of 1 if you don't compile anything but it will copy the files from data-files (and alike).

On my machine, it copies share/index.html into .cabal-sandbox/share/x86_64-openbsd-ghc-7.6.3/dummy-0.1.0.0/share/index.html.

Tom


On 11 June 2014 16:00, Corentin Dupont <[hidden email]> wrote:
In the .cabal file you can put a directive "data-files" and they will be deployed in ~/.cabal/share...
I want to trigger only this.


On Wed, Jun 11, 2014 at 3:40 PM, Tom Nielsen <[hidden email]> wrote:
Not sure what you mean - cabal doesn't do any deployment, or at least I have not found a useful way of making it do so. In our case the deployment is done by running apt-get update && apt-get install on the server.

Tom




On Wed, Jun 11, 2014 at 3:18 PM, Corentin Dupont <[hidden email]> wrote:
Thanks for your response!
Is there a way to ask Cabal to just deploy the resources and not compile everything?



On Wed, Jun 11, 2014 at 11:47 AM, Tom Nielsen <[hidden email]> wrote:
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Deploy Haskell application

Elliot Robinson
`cabal install --only-dependencies`, possibly with a sandbox set, should fix that issue. Then configure and move from there.

---
Elliot Robinson
Phone: (321) 252-9660

PGP Fingerprint: 0xD1E72E6A9D0610FFBBF838A6FFB5205A9FEDE59A


On Wed, Jun 11, 2014 at 12:07 PM, Corentin Dupont <[hidden email]> wrote:
Hi,
it seems that 'cabal configure' fails if some dependencies are missing. Then cabal copy complains that I should run 'cabal configure' first...


On Wed, Jun 11, 2014 at 4:23 PM, Tom Feron <[hidden email]> wrote:
Hi Corentin,

I think you're searching for `cabal configure && cabal copy`. It will still have an exit code of 1 if you don't compile anything but it will copy the files from data-files (and alike).

On my machine, it copies share/index.html into .cabal-sandbox/share/x86_64-openbsd-ghc-7.6.3/dummy-0.1.0.0/share/index.html.

Tom


On 11 June 2014 16:00, Corentin Dupont <[hidden email]> wrote:
In the .cabal file you can put a directive "data-files" and they will be deployed in ~/.cabal/share...
I want to trigger only this.


On Wed, Jun 11, 2014 at 3:40 PM, Tom Nielsen <[hidden email]> wrote:
Not sure what you mean - cabal doesn't do any deployment, or at least I have not found a useful way of making it do so. In our case the deployment is done by running apt-get update && apt-get install on the server.

Tom




On Wed, Jun 11, 2014 at 3:18 PM, Corentin Dupont <[hidden email]> wrote:
Thanks for your response!
Is there a way to ask Cabal to just deploy the resources and not compile everything?



On Wed, Jun 11, 2014 at 11:47 AM, Tom Nielsen <[hidden email]> wrote:
We package up the executables and other files into a Debain .deb package using fpm after running cabal. Here is an example Makefile which runs cabal, creates the debian package and adds it to our apt server:


This is run by our CI server after every commit to GitHub.

Tom


On Wed, Jun 11, 2014 at 11:33 AM, Vo Minh Thu <[hidden email]> wrote:
Hi,

These days, an increasingly popular solution to package an application
with its dependencies is to use Docker. You can build the Docker image
locally and push it to a Docker registry and retrieve it on your
remote machine, or you can dump it as a tarball and load it on your
remote machine.

You have different ways to create the Docker image, one of which would
be similar to pushing your Haskell binary to your remote machine. That
way is simply to compile your exectuable locally, and copy it to the
remote machine with is assets if any (you might even move it to a
.cabal directory as if it was installed through `cabal install`). By
default your executable will be statically linked, except for libgmp
that you have to install on the remote machine.

I recommand you look into Docker. You will be able to e-use its
knowledge to package increasingly complex applications (that might
have more numerous dependencies that you wouldn't have to manage on
the host).

HTH,
Thu

2014-06-11 12:24 GMT+02:00 Corentin Dupont <[hidden email]>:
> Hi guys!
> Is there a procedure to deploy a Haskell application?
> I have an Amazon EC2 micro instance to run my application, but it's way too
> small to compile it using cabal (compilation takes half a day rouhgly), so I
> compile it on my computer.
> Is there a convenient way to bundle the executable with the resources and
> ship it to the server?
>
> Thanks!
> Corentin
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe





_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe