[Haskell-cafe] any cloud computing services for running Haskell?

Bram Neijt bneijt at gmail.com
Wed Jul 19 16:03:36 UTC 2017


Some links I like to to add to the thread:

AWS lambda
https://github.com/abailly/aws-lambda-haskell

Google Cloud functions might be an option using GHCJS

Heroku has been around for a long time:
https://www.christopherbiscardi.com/2014/2/2/deploy-haskells-snap-on-heroku/

Greetings,

Bram


On Wed, Jul 19, 2017 at 5:25 AM, Mark Fine <mark.fine at gmail.com> wrote:
> The performance might not be what you're looking for (there are some more
> performant configurations but they might not be cost effective), but it's
> pretty easy to get a stack project running on Heroku - this script took ~3
> minutes (dominated by installing GHC on the first push) to get a simple
> worker running in the cloud:
>
> https://gist.github.com/mfine/b3dd21cfd03d1775084780f955cdc784#gistcomment-2151378
>
> Sample run:
>
> ~ $ stack new worker
> https://gist.githubusercontent.com/mfine/b3dd21cfd03d1775084780f955cdc784/raw/4779a2ea55ac29b469a98eedfba35f74ba7785dc/worker.hsfiles
> Downloading template
> "https://gist.githubusercontent.com/mfine/b3dd21cfd03d1775084780f955cdc784/raw/522fc42d9c7a46e26673a73fae629c92c28da648/worker.hsfiles"
> to create project "worker" in worker/ ...
> Looking for .cabal or package.yaml files to use to init the project.
> Using cabal packages:
> - worker/worker.cabal
>
> Selecting the best among 10 snapshots...
>
> * Matches lts-8.23
>
> Selected resolver: lts-8.23
> Initialising configuration using resolver: lts-8.23
> Total number of user packages considered: 1
> Writing configuration to file: worker/stack.yaml
> All done.
> ~ $
> ~ $ cd worker
> ~/worker $
> ~/worker $ git init .
> Initialized empty Git repository in ~/worker/.git/
> ~/worker $
> ~/worker $ git add .
> ~/worker $
> ~/worker $ git commit -m "initial"
> [master (root-commit) a19a152] initial
>  4 files changed, 84 insertions(+)
>  create mode 100644 Procfile
>  create mode 100644 main.hs
>  create mode 100644 stack.yaml
>  create mode 100644 worker.cabal
> ~/worker $
> ~/worker $ heroku create --buildpack
> https://github.com/mfine/heroku-buildpack-stack.git
> Creating app... done, ⬢ serene-earth-29336
> Setting buildpack to https://github.com/mfine/heroku-buildpack-stack.git...
> done
> https://serene-earth-29336.herokuapp.com/ |
> https://git.heroku.com/serene-earth-29336.git
> ~/worker $
> ~/worker $ git push heroku master
> Counting objects: 6, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (5/5), done.
> Writing objects: 100% (6/6), 1.61 KiB | 0 bytes/s, done.
> Total 6 (delta 0), reused 0 (delta 0)
> remote: Compressing source files... done.
> remote: Building source:
> remote:
> remote: -----> Haskell app detected
> remote: -----> 2017-07-19_02:58:20 Starting...
> remote: -----> 2017-07-19_02:58:20 Exporting config vars
> remote: -----> 2017-07-19_02:58:20 Installing libgmp-6.0.0a into cache
> remote:
> ########################################################################
> 100.0%
> remote: -----> 2017-07-19_02:58:20 Restoring 6.0.0a files from cache
> remote: -----> 2017-07-19_02:58:20 Downloading stack-1.4.0
> remote:
> ########################################################################
> 100.0%
> remote: -----> 2017-07-19_02:58:21 Restoring stack-1.4.0
> remote: -----> 2017-07-19_02:58:21 Substituting stack vars
> remote: -----> 2017-07-19_02:58:21 Running stack
> remote: Downloading lts-8.23 build plan ...
> remote: Downloaded lts-8.23 build plan.
> remote: Updating package index Hackage (mirrored at
> https://s3.amazonaws.com/hackage.fpcomplete.com/) ...
> remote: Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
> remote: Downloading root
> remote: Selected mirror https://s3.amazonaws.com/hackage.fpcomplete.com/
> remote: Downloading timestamp
> remote: Downloading snapshot
> remote: Downloading mirrors
> remote: Cannot update index (no local copy)
> remote: Downloading index
> remote: Updated package list downloaded
> remote: Populating index cache ...
> remote: Populated index cache.
> remote: Preparing to install GHC to an isolated location.
> remote: This will not interfere with any system-level installation.
> remote: Preparing to download ghc-8.0.2 ...
> remote: ghc-8.0.2: download has begun
> remote: ghc-8.0.2:   27.84 MiB / 107.55 MiB ( 25.89%) downloaded...
> remote: ghc-8.0.2:   54.10 MiB / 107.55 MiB ( 50.31%) downloaded...
> remote: ghc-8.0.2:   77.99 MiB / 107.55 MiB ( 72.52%) downloaded...
> remote: ghc-8.0.2:  101.87 MiB / 107.55 MiB ( 94.72%) downloaded...
> remote: ghc-8.0.2:  107.55 MiB / 107.55 MiB (100.00%) downloaded...
> remote: Downloaded ghc-8.0.2.
> remote: Unpacking GHC into
> /app/tmp/cache/.stack/programs/x86_64-linux/ghc-8.0.2.temp/ ...
> remote: Configuring GHC ...
> remote: Installing GHC ...
> remote: Installed GHC.
> remote: stack will use a sandboxed GHC it installed
> remote: For more information on paths, see 'stack path' and 'stack exec env'
> remote: To use this GHC and packages outside of a project, consider using:
> remote: stack ghc, stack ghci, stack runghc, or stack exec
> remote: [1 of 2] Compiling Main             (
> /app/tmp/cache/.stack/setup-exe-src/setup-mPHDZzAJ.hs,
> /app/tmp/cache/.stack/setup-exe-src/setup-mPHDZzAJ.o )
> remote: [2 of 2] Compiling StackSetupShim   (
> /app/tmp/cache/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs,
> /app/tmp/cache/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
> remote: Linking
> /app/tmp/cache/.stack/setup-exe-cache/x86_64-linux/tmp-Cabal-simple_mPHDZzAJ_1.24.2.0_ghc-8.0.2
> ...
> remote: worker-0.1.0.0: configure (exe)
> remote: Configuring worker-0.1.0.0...
> remote: worker-0.1.0.0: build (exe)
> remote: Preprocessing executable 'worker' for worker-0.1.0.0...
> remote: [1 of 1] Compiling Main             ( main.hs,
> .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/worker/worker-tmp/Main.o
> )
> remote: Linking
> .stack-work/dist/x86_64-linux/Cabal-1.24.2.0/build/worker/worker ...
> remote: worker-0.1.0.0: copy/register
> remote: Installing executable(s) in
> remote: /app/.stack-work/install/x86_64-linux/lts-8.23/8.0.2/bin
> remote: Copying from
> /app/.stack-work/install/x86_64-linux/lts-8.23/8.0.2/bin/worker to
> /app/.local/bin/worker
> remote:
> remote: Copied executables to /app/.local/bin:
> remote: - worker
> remote: -----> 2017-07-19_03:01:26 Making stack binaries available
> remote: -----> 2017-07-19_03:01:26 Caching .stack-work
> remote: -----> 2017-07-19_03:01:26 Finished!
> remote: -----> Discovering process types
> remote:        Procfile declares types -> worker
> remote:
> remote: -----> Compressing...
> remote:        Done: 1.5M
> remote: -----> Launching...
> remote:        Released v3
> remote:        https://serene-earth-29336.herokuapp.com/ deployed to Heroku
> remote:
> remote: Verifying deploy... done.
> To https://git.heroku.com/serene-earth-29336.git
>  * [new branch]      master -> master
> ~/worker $
> ~/worker $ heroku ps:scale worker+1
> Scaling dynos... done, now running worker at 1:Free
> ~/worker $
> ~/worker $ heroku logs -t
> 2017-07-19T03:07:19.755903+00:00 heroku[worker.1]: Starting process with
> command `worker`
> 2017-07-19T03:07:20.553903+00:00 heroku[worker.1]: State changed from
> starting to up
> 2017-07-19T03:07:22.393957+00:00 app[worker.1]: Hello!
> 2017-07-19T03:07:23.397139+00:00 app[worker.1]: Hello!
> 2017-07-19T03:07:24.398803+00:00 app[worker.1]: Hello!
> 2017-07-19T03:07:25.400211+00:00 app[worker.1]: Hello!
> 2017-07-19T03:07:26.405199+00:00 app[worker.1]: Hello!
>
>
> Mark
>
> On Sun, Jul 16, 2017 at 1:20 PM, Dennis Raddle <dennis.raddle at gmail.com>
> wrote:
>>
>> I'm thinking of using cloud computing services for running my
>> CPU-intensive parallel Haskell code, in order to get results faster. Instead
>> of buying a faster computer, I would take advantage of existing services.
>>
>> Note that my budget is small, so I need something that doesn't have a
>> large minimum charge. I'm thinking $10 - 30 per month.
>>
>> Are there any cloud services like that that run Haskell?
>> D
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list