Hyper Func is a Docker-centric Serverless platform. You can wrap functions in Docker images and have them run on demand.
- Fire and forget
- Fully managed service
- Easy to use for developers
- Minimal ops overhead
- Docker centric
- Deploy your function in any Docker image
- Any language, any libraries, any dependencies
- Secure Container Runtime
- VM-like isolation
- New container instance for each function call
- Run functions for as long as you wish
How it works
- Hyper Func uses straight Docker images as the underlying format to deploy functions. Code, dependencies and data are baked into your Docker images and then uploaded to any popular container registry. From there you can launch functions with the runtime of your choosing.
- Upon launch, a new container is started with the selected function image. The HTTP request payload is passed to the container STDIN as input to the function and the output is returned or a call ID is returned so you can retrieve output later.
- The maximum number of concurrent functions is subject to the user's quota, which can be upgraded on request. When the quota limit is reached subsequent functions are queued until a slot becomes available.
- Queued functions are processed in a First-In-First-Out order. We cannot however guarantee that the functions will terminate in this order.
- Hyper Func maintains a 50MB cache for each individual function. (Not per function call). This cache is used to store the STDOUT of finished asynchronous function calls. This data therefore needs to be fetched regularly using
hyper func get. Once the 50MB limit is reached the cache will be rotated.
- Hyper Func maintains a 50MB cache for the logs of each function. This data needs to be fetched using
hyper func logs. Once the cache is full the logs will be rotated.
- For each function call, the maximum size of data flowing through STDIN and STDOUT is limited to 1MB.
- The headers of the HTTP request and any environment configuration will be exposed as environment variables in the host container where they can be accessed by the function.
Pull the ubuntu image:
$ hyper pull ubuntu ...
Create a "HelloWorld" function:
$ hyper func create --name helloworld ubuntu echo HelloWorld helloworld is created with the address of https://us-west-1.hyperfunc.io/call/helloworld/e62c014e-386c-42ea-8d07-41d44e98cc3d
Call the function:
$ hyper func call helloworld CallId: 218b7b10-e7f1-4c48-ac3c-66792f8ffc06
Tip: calling with payload
echo Hello | hyper func call helloworld
Check the function logs:
$ hyper func logs helloworld 2017-03-16T15:05:58Z [CALL] CallId: 218b7b10-e7f1-4c48-ac3c-66792f8ffc06, ShortStdin: 2017-03-16T15:05:58Z [PENDING] CallId: 218b7b10-e7f1-4c48-ac3c-66792f8ffc06 2017-03-16T15:06:04Z [RUNNING] CallId: 218b7b10-e7f1-4c48-ac3c-66792f8ffc06 2017-03-16T15:06:10Z [FINISHED] CallId: 218b7b10-e7f1-4c48-ac3c-66792f8ffc06, ShortStdout: HelloWorld , ShortStderr:
Retrieve the function return:
$ hyper func get --wait 218b7b10-e7f1-4c48-ac3c-66792f8ffc06 HelloWorld
--waitblocks the CLI until the call finished (or failed)
Remove the function:
$ hyper func rm helloworld helloworld
Resize picture example
Pull the imagemagick image:
$ hyper pull v4tech/imagemagick ...
Create a "resizer" function:
$ hyper func create --name resizer v4tech/imagemagick convert - -resize 50% fd:1 resizer is created with the address of https://us-west-1.hyperfunc.io/call/resizer/11f91366-2fea-4381-8297-dc12f6ba200a
Call the function with a picture payload:
$ cat picture.jpg | hyper func call --sync resizer > picture_small.jpg