Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Haskell on PaaS

Haskell on PaaS

BFPG lightning talk about the state of Haskell on Platform as a Service (PaaS) offerings.

Fraser Tweedale

September 23, 2014
Tweet

More Decks by Fraser Tweedale

Other Decks in Programming

Transcript

  1. Disclosure I work for Red Hat. Red Hat is a

    PaaS provider (OpenShift Online).
  2. What is PaaS? Platform as a Service Software execution environment

    Don’t think about hardware / OS Don’t think (much) about network
  3. What is PaaS? Platform as a Service Software execution environment

    Don’t think about hardware / OS Don’t think (much) about network DNS handled for you
  4. What is PaaS? Platform as a Service Software execution environment

    Don’t think about hardware / OS Don’t think (much) about network DNS handled for you SSL/TLS termination
  5. What is PaaS? Platform as a Service Software execution environment

    Don’t think about hardware / OS Don’t think (much) about network DNS handled for you SSL/TLS termination Auto-scaling (depending on provider/platform)
  6. What is PaaS? Platform as a Service Software execution environment

    Don’t think about hardware / OS Don’t think (much) about network DNS handled for you SSL/TLS termination Auto-scaling (depending on provider/platform) dev/stage/prod environments are easy
  7. Who is PaaS? OpenShift (Red Hat) †‡ Heroku † Cloud

    Foundry (Pivotal) ‡ FP Haskell Centre (FP Complete) ‡
  8. Who is PaaS? OpenShift (Red Hat) †‡ Heroku † Cloud

    Foundry (Pivotal) ‡ FP Haskell Centre (FP Complete) ‡ . . . various others.
  9. Who is PaaS? OpenShift (Red Hat) †‡ Heroku † Cloud

    Foundry (Pivotal) ‡ FP Haskell Centre (FP Complete) ‡ . . . various others. † free tier available
  10. Who is PaaS? OpenShift (Red Hat) †‡ Heroku † Cloud

    Foundry (Pivotal) ‡ FP Haskell Centre (FP Complete) ‡ . . . various others. † free tier available ‡ runs on free software i.e. you can run an instance yourself
  11. Haskell on OpenShift Supported via “community cartridges” GHC 7.8 Variants

    for major frameworks (Snap, Yesod, scotty, HappStack)
  12. Haskell on OpenShift Supported via “community cartridges” GHC 7.8 Variants

    for major frameworks (Snap, Yesod, scotty, HappStack) Manifest URLs: http://www.haskell.org/haskellwiki/Web/Cloud
  13. Haskell on OpenShift Supported via “community cartridges” GHC 7.8 Variants

    for major frameworks (Snap, Yesod, scotty, HappStack) Manifest URLs: http://www.haskell.org/haskellwiki/Web/Cloud Currently a bit broken (I have submitted a PR to fix)
  14. Haskell on OpenShift Supported via “community cartridges” GHC 7.8 Variants

    for major frameworks (Snap, Yesod, scotty, HappStack) Manifest URLs: http://www.haskell.org/haskellwiki/Web/Cloud Currently a bit broken (I have submitted a PR to fix) Manage using rhc command-line tool.
  15. Haskell on OpenShift % rhc app create parks \ http://www.accursoft.com/cartridges/snap.yml

    \ postgresql-8.4 \ --from-code https://github.com/bfpg/brisparks.info.git
  16. Haskell on Heroku Supported via “buildpack”. https://github.com/begriffs/heroku-buildpack-ghc Manage using heroku

    command line tool. Cloud Foundry appears to be similar, but I haven’t tried it yet.
  17. Haskell on Heroku % echo ’web: cabal run -- -p

    $PORT’ > Procfile % git add Procfile ; git commit -m ’add Procfile’ % heroku create --stack=cedar \ --buildpack \ https://github.com/begriffs/heroku-buildpack-ghc.git % git push heroku master
  18. Haskell on FP Application Server The only Haskell-centric PaaS (that

    I know of). So it might be nice. . . ? There is no free tier. #sadface
  19. Haskell on FP Application Server The only Haskell-centric PaaS (that

    I know of). So it might be nice. . . ? There is no free tier. #sadface Haven’t tried it. . .
  20. Haskell on FP Application Server The only Haskell-centric PaaS (that

    I know of). So it might be nice. . . ? There is no free tier. #sadface Haven’t tried it. . . but I would love to hear about your experiences if you have/do!
  21. Configuring apps for PaaS Most PaaS provide app configuration through

    env vars. Differences between providers. More services (databases, metrics, etc) = more config.
  22. Configuring apps for PaaS Most PaaS provide app configuration through

    env vars. Differences between providers. More services (databases, metrics, etc) = more config. I’m chipping away on a small library to abstract (some of) this.
  23. Configuring apps for PaaS Most PaaS provide app configuration through

    env vars. Differences between providers. More services (databases, metrics, etc) = more config. I’m chipping away on a small library to abstract (some of) this. Deployment:
  24. Configuring apps for PaaS Most PaaS provide app configuration through

    env vars. Differences between providers. More services (databases, metrics, etc) = more config. I’m chipping away on a small library to abstract (some of) this. Deployment: Some PaaS run your app according to some convention (e.g. OpenShift)
  25. Configuring apps for PaaS Most PaaS provide app configuration through

    env vars. Differences between providers. More services (databases, metrics, etc) = more config. I’m chipping away on a small library to abstract (some of) this. Deployment: Some PaaS run your app according to some convention (e.g. OpenShift) Some PaaS require you to tell it how to run your app (e.g. Heroku, via Procfile)
  26. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB.
  27. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation.
  28. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas.
  29. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas. Pay $$$ for more disk.
  30. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas. Pay $$$ for more disk. Low memory
  31. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas. Pay $$$ for more disk. Low memory e.g. can’t build haskell-src-exts on small OpenShift gear
  32. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas. Pay $$$ for more disk. Low memory e.g. can’t build haskell-src-exts on small OpenShift gear Solution: ship more cartridge variants with more libs?
  33. Pain points Cabal hell. Low disk space GHC + Haskell

    frameworks take up several hundred MB. I have done some work on OpenShift cartridges to improve the situation. I have some more ideas. Pay $$$ for more disk. Low memory e.g. can’t build haskell-src-exts on small OpenShift gear Solution: ship more cartridge variants with more libs? Pay $$$ for more memory.
  34. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon.
  35. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker
  36. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images.
  37. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images. Layered images = shared base images, smaller framework/app images.
  38. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images. Layered images = shared base images, smaller framework/app images. Lots of Docker hosting providers already.
  39. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images. Layered images = shared base images, smaller framework/app images. Lots of Docker hosting providers already. OpenShift v3 is embracing Docker.
  40. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images. Layered images = shared base images, smaller framework/app images. Lots of Docker hosting providers already. OpenShift v3 is embracing Docker. First-class support for Haskell in popular PaaS providers?
  41. Future Stackage Infrastructure to create stable builds of complete package

    sets. OpenShift cartridges might support Stackage soon. Docker Easier to set up container images. Layered images = shared base images, smaller framework/app images. Lots of Docker hosting providers already. OpenShift v3 is embracing Docker. First-class support for Haskell in popular PaaS providers? Hopefully! FP Complete seem to be on their own, for now.
  42. Summary PaaS is cool. Go play. Help make Haskell on

    PaaS a better experience. Talk to me or Katie for ideas.
  43. Resources PaaS info on HaskellWiki: http://www.haskell.org/haskellwiki/Web/Cloud OpenShift Online: https://www.openshift.com/ Haskell

    on OpenShift blog post by Kate Miller: http://is.gd/7eRZDY OpenShift cartridge development: https://github.com/accursoft/Haskell-Cloud Heroku: https://www.heroku.com/ Heroku buildpack development: https://github.com/begriffs/heroku-buildpack-ghc Keter: https://github.com/snoyberg/keter
  44. Thanks for listening Copyright 2014 Fraser Tweedale This work is

    licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. Slides https://github.com/frasertweedale/talks Email [email protected] Twitter @hackuador