https://github.com/nheidloff/openwhisk-data-flows
Data Flows with Apache OpenWhisk and Composer
https://github.com/nheidloff/openwhisk-data-flows
openwhisk orchestration serverless
Last synced: 12 months ago
JSON representation
Data Flows with Apache OpenWhisk and Composer
- Host: GitHub
- URL: https://github.com/nheidloff/openwhisk-data-flows
- Owner: nheidloff
- License: apache-2.0
- Created: 2018-02-22T09:52:26.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-23T14:47:13.000Z (over 8 years ago)
- Last Synced: 2025-05-25T02:44:34.492Z (about 1 year ago)
- Topics: openwhisk, orchestration, serverless
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Data Flows with Apache OpenWhisk and Composer
This project contains samples how to write applications with [Composer](https://github.com/ibm-functions/composer) and [Apache OpenWhisk](https://openwhisk.apache.org/).
While the functions in applications are stateless, the applications manage the state and are responsible how the data flows between the functions. This project contains a pattern how to handle data flows and how to convert data.
For details check out the two articles on my blog:
* [Data Flows in Serverless Cloud-Native Applications](http://heidloff.net/article/serverless-data-flows)
* [Transforming JSON Data in Serverless Applications](http://heidloff.net/article/transforming-json-serverless)
### Setup
Prerequisites:
* Install the [OpenWhisk CLI](https://github.com/apache/incubator-openwhisk-cli)
* Create an [IBM Cloud](https://ibm.biz/nheidloff) account
* Install the [IBM Cloud CLI](https://clis.ng.bluemix.net/)
* Install the [Composer CLI](https://github.com/ibm-functions/composer/tree/master/docs#installing-the-shell) and Redis
Run these commands to deploy the functions and the apps:
```sh
$ git clone https://github.com/nheidloff/openwhisk-data-flows.git
$ cd openwhisk-data-flows
$ bx login -a api.ng.bluemix.net -o yourBluemixOrg -s yourBluemixSpace
$ wsk package create composer-demo-nh
$ wsk action update composer-demo-nh/simple1 functions/simple1.js
$ wsk action update composer-demo-nh/simple2 functions/simple2.js
$ wsk action update composer-demo-nh/error functions/error.js
$ wsk action update composer-demo-nh/read-person-profile functions/read-person-profile.js
$ wsk action update composer-demo-nh/transform-read-person-profile functions/transform-read-person-profile.js
$ wsk action update composer-demo-nh/send-mail functions/send-mail.js
$ cd functions
$ npm install
$ zip -rq transformsendmail.zip transform-send-mail.js package.json node_modules
$ wsk action update composer-demo-nh/transform-send-mail --kind nodejs:8 transformsendmail.zip
$ cd ..
$ fsh app update composer-demo-nh/in-app-conversions apps/in-app-conversions.js
$ fsh app update composer-demo-nh/send-mail-app apps/send-mail-app.js
```
To run the applications invoke these commands:
```sh
$ fsh app invoke composer-demo-nh/in-app-conversions -p input-param1 input-param1-value
$ fsh app invoke composer-demo-nh/send-mail-app -p id nheidloff -p subject Hello
```