I have had some trivial toy Haskell projects running on AppEngine just testing it out.
Using the AppEngine custom runtime it's trivial to deploy an application.
I use OSX as my development machine which complicates it a little but all you need to do is create a statically linked binary and a Dockerfile to start it. The only interesting bit in the Docker file is my app looks for a port environment variable which i hardcore and I use a optimised base image meaning the docker container is around 20Mb in total.
https://github.com/fpco/haskell-scratchFROM fpco/haskell-scratch:integer-gmp
COPY ./.stack-work/install/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/lts-7.0/8.0.1/bin/myapp-exe /usr/bin/
CMD PORT=8080 myapp-exe
I'm using stack to build my projects. As I'm on OSX I need it to tell stack to build the app in a linux docker container to run in the 'fpco/haskell-scratch' container above.
in the stack.yml I add the below
image:
container:
base: "fpco/haskell-scratch:integer-gmp"
docker:
enable: true
Then to build I run the below which generates the executable used in the Dockerfile
If on Linux you probably won't need to build in a docker container and just use: stack build
--ghc-options='-optl-static -optl-pthread' --force-dirty.
Interacting with the services in AppEngine where they have a public API shouldn't be an issue, hit the documented HTTP endpoint as they specify.
It's the API's which don't have a public Google Cloud equivalent that are problematic.
Search being one.
AppEngine give the tools for custom runtimes but don't give docs for interacting with things such as the search API so you can write your own API using your own runtime. I've not had anytime yet to reverse engineer the protocol buffer sidecar they have on the instances....If i wasn't playing with a toy project and on a deadline I'd write a separate service using Scala + the Java sdk's to deploy as a thin REST service for search / mail then call that from Haskell.
With the custom runtimes AppEngine should publish the sidecar API so people can create open source SDK's which would only help grow AppEngine.