https://github.com/rainbyte/openwhisk-wrapper
Haskell-based OpenWhisk services
https://github.com/rainbyte/openwhisk-wrapper
Last synced: 11 months ago
JSON representation
Haskell-based OpenWhisk services
- Host: GitHub
- URL: https://github.com/rainbyte/openwhisk-wrapper
- Owner: rainbyte
- License: gpl-3.0
- Created: 2016-07-29T18:31:49.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-10T20:57:19.000Z (almost 10 years ago)
- Last Synced: 2025-04-03T15:44:41.869Z (about 1 year ago)
- Language: Haskell
- Homepage:
- Size: 18.6 KB
- Stars: 20
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# openwhisk-wrapper: Haskell-based OpenWhisk services
## Provides:
- A library which wraps functions as OpenWhisk services (based on dockerSkeleton).
- An example using split docker images:
* Build phase: based on `haskell:7.10.3` image
* Deploy phase: uses `haskell-scratch` image
## Usage:
1. Write the logic of your service, which should be a function with type `Value -> IO (Maybe Value)`
```
myService :: Value -> IO (Maybe Value) -- consumes and produces JSON objects
myService = pure . Right . id -- service logic, e.g. this echoes input data
```
2. Wrap your service with `openwhiskWrapper` function (see `Network.OpenWhisk` module)
```
main :: IO ()
main = openwhiskWrapper myService
```
3. Create docker image (see `Dockerfile` and `make-image.sh` script)
4. Upload the image to docker hub
5. Use `wsk` utility in order to instantiate an action with your image.
```bash
wsk action update --docker action-name docker-hub-user/docker-hub-image
```