Monadic Party 2018
Presented material (including this talk) is very much a Work-in-Progress.
There is little theory, fancy types, and (surprisingly) Haskell in this talk.
PLEASE ASK QUESTIONS DURING THE TALK
- Programming Languages Theory in Haskell/Pen-and-Paper
- ML/Signal Processing in Python/.NET
We wanted to see how difficult would it be to move to Haskell... -- Famous Last Words
I had some serverless workflows running on top of Microsoft Azure. I wanted to see if I could adopt any of them to running Haskell.
Spinning-up a container per each request, or other event.
There is neither physical nor virtual machine to provision or maintain.
Scaling should be at least as easy as adjusting the number of instances. Ideally, you should be able to adjust automatically as the need arises.
Pay only for the resources used by your workload. Do not pay for idle time.
Here is my script, may you run it every 5 minutes, please?
- Provide your application as a set of files,
- Deploy either as a git repo, or as a zip file.
Here is an image for my container, may you run it and keep it alive, please?
- Provide your application as a docker container,
- Deploy via some docker registry.
Cross-platform .NET flavour.
https://www.microsoft.com/net/download
- Azure Functions
- Azure Container Instances
- Microsoft Flow
- Azure Logic Apps
- Azure WebJobs
Detailed Comparison: https://bit.ly/2u3LcZG
I will focus on:
- Azure Functions, and
- Azure Container Instances.
Function as a Service (FaaS).
- Supports BYOF and BYOC
- Windows and Linux instances
- Supports:
- .NET Languages (C#/F#)
- JavaScript
- Java
- Consumption Plan (Windows only)
I will be focusing on Azure Functions V2, wich is cross-platform.
- In Preview,
- Stable probably in late 2018,
- Windows and Linux instances,
- BYOF and BYOC (Linux only),
- Dev tools for Windows, Linux, and macOS.
Runtime available on the instance
- Provides a set of bindings and triggers,
- Basic logging and monitoring,
- Automatic retry for some failing triggers,
- Automatic back-off for some failing triggers,
Github: Azure/azure-functions-host
Run Azure Functions Runtime locally
npm i -g azure-functions-core-tools@core --unsafe-perm true
brew tap azure/functions
brew install azure-functions-core-tools
Github: Azure/azure-functions-core-tools
- Azure File Storage
- Azure Blob Storage
- Azure Queue Storage
- Azure Table Storage
Cross-platform Azure Storage Emulator
npm install -g azurite
Github: Azure/azurite
dotnet-sdk
https://www.microsoft.com/net/downloadazure-functions-core-tools
https://github.com/Azure/azure-functions-core-toolsazurite
https://github.com/Azure/Azuriteazure storage explorer
https://azure.microsoft.com/en-us/features/storage-explorer/
With some demos in F#.
Execute a function every * * * * * * *
(modified cron expression syntax)
Execute a function on HTTP request
--
Execute a function whenever a message is available on a queue.
- Reply on error (by default 5 times),
- After that, move message to a poison queue.
Output the result of a function as a message to Azure Storage Queue.
Output the result of a function as a blob to Azure Blob Storage.
Let's try to run a simple Haskell program for a HTTP request.
Code Samples: https://github.com/jakzale/monadic-party-2018-samples
Demo
- Preview Support for Python
- Protobuf + gRPC
Container as a Service (CaaS).
- Windows and Linux Containers
- Azure Container Registry for hosting images
- Azure File Storage for persisting storage (Linux only)