openwhisk

《代码英雄》第二季(7):无服务器

a 夏天 提交于 2020-10-15 19:49:43
代码英雄讲述了开发人员、程序员、黑客、极客和开源反叛者如何彻底改变技术前景的真实史诗。 什么是《代码英雄》 代码英雄Command Line Heroes是世界领先的企业开源软件解决方案供应商红帽(Red Hat)精心制作的原创音频播客,讲述开发人员、程序员、黑客、极客和开源反叛者如何彻底改变技术前景的真实史诗。该音频博客邀请到了谷歌、NASA 等重量级企业的众多技术大牛共同讲述开源、操作系统、容器、DevOps、混合云等发展过程中的动人故事。 本文是《 代码英雄 》系列播客 第二季(7):无服务器 的 音频 脚本。 导语:无服务器Serverless到底意味着什么?当然,总得有服务器存在 —— 构建网络的基本架构不会改变。不过在将服务器交给一小部分人运维之后,开发者们会发生什么变化呢? 无服务器编程让初学者们可以更加轻松简单地部署自己的应用程序,让工作更有效率,这是它的优点。Andrea Passwater 跟我们分享了抽象底层架构会给我们带来多大的便利。不过凡事必有代价,无服务器化也有很多问题。Rodric Rabbah 解释了无服务器意味着你将部署和回应问题的能力拱手献出 —— 这就是为什么他帮助创建了 Apache OpenWhisk,这是一个开源的无服务环境框架,同时 Himanshu Pant 也来分享了他对于何时应该使用无服务器服务的观点。

Blocking action invocation time-outs after 60s - how to access result?

风格不统一 提交于 2020-01-05 02:32:56
问题 I'm trying to invoke an Apache OpenWhisk action (using the JavaScript SDK) as a remote function. I want to wait for the function result to be available to use in my application. This is normally handled by using a blocking invocation, e.g. ow.actions.invoke({name, blocking: true, result: true, params}) ...but in this case, the action takes multiple minutes to complete which leads to a timeout in the HTTP connection. The SDK throws an error after sixty seconds. How can I retrieve an action

Blocking action invocation time-outs after 60s - how to access result?

老子叫甜甜 提交于 2020-01-05 02:31:57
问题 I'm trying to invoke an Apache OpenWhisk action (using the JavaScript SDK) as a remote function. I want to wait for the function result to be available to use in my application. This is normally handled by using a blocking invocation, e.g. ow.actions.invoke({name, blocking: true, result: true, params}) ...but in this case, the action takes multiple minutes to complete which leads to a timeout in the HTTP connection. The SDK throws an error after sixty seconds. How can I retrieve an action

IBM Cloud Functions - How to use and upload own libraries?

泄露秘密 提交于 2019-12-24 11:35:35
问题 Is it possible to use / upload own libraries to IBM Cloud Functions? Or is it limited to the preinstalled packages? I plan to use Python as programming language. 回答1: You can bundle your own dependencies. See the docs here https://github.com/apache/incubator-openwhisk/blob/master/docs/actions-python.md#packaging-python-actions-with-a-virtual-environment-in-zip-files for creating a virtual environment with your libraries. The docs provide an example installing dependencies via requirements.txt

How can one do parallel actions in OpenWhisk?

耗尽温柔 提交于 2019-12-24 07:35:45
问题 I have two actions (each one does a different REST call to a service to collect some data), and I want to create a meta-Action which essentially triggers the two actions and aggregates the results. I am just getting started with OpenWhisk, And I pretty much know how I would do this in the given language I am using to implement actions, but I am curious what the appropriate OpenWhisk way to do this might be? 回答1: If you want to aggregate the results, there is no other way currently than the

How do I make a Python Docker image an OpenWhisk action?

拈花ヽ惹草 提交于 2019-12-23 15:18:15
问题 I have a Docker image which runs a Python program. I want now to run this container as an OpenWhisk action. How do I do this? I have seen several examples in other programming languages, and an excellent black box skeleton approach in C and Node.js. but I want to understand more about how OpenWhisk interacts with the container and, if possible, employ just Python. 回答1: It's a lot simpler now (Sept 2016) than in my previous answer. After having created the dockerSkeleton directory with the

How to invoke openwhisk action within openwhisk platform on bluemix?

萝らか妹 提交于 2019-12-12 04:22:23
问题 I have created two actions on OpenWhisk on Bluemix. Both independently work fine when I can call them from outside the OpenWhisk platform. But I want to call action1 from within action2, and am using the following syntax: var openwhisk = require('openwhisk'); function main(args){ const name = 'action2'; const blocking = true; const params = { param1: 'sthing'}; var ow = openwhisk(); ow.actions.invoke({name, blocking, params}) .then(result => { console.log('result: ', result); return result; /

Web Action returns HTTP 200 response with empty body

99封情书 提交于 2019-12-11 16:42:45
问题 Having created an OpenWhisk Web Action from the CLI, invoking the action over the public Web Action URL always returns an empty response body. The HTTP status code returned (200) indicating a successful invocation. Regardless of the return value from the function, nothing is included in the empty response body. const fs = require('fs') const execFile = require('child_process').execFile function hello(params) { return new Promise((resolve, reject) => { fs.writeFileSync('test.js', params.code)

How to invoke an OpenWhisk action from IoT Platform in Bluemix

我的未来我决定 提交于 2019-12-11 04:43:12
问题 We would like to know how to invoke an OpenWhisk action from IoT Platform in Bluemix. What we want to accomplish is: Send an event data from a device to IoT Platform Subscribe the event Call an OpenWhisk action. We are assuming the event data is JSON format. We know we can develop an application that subscribes to an event on the IoT Platform like: https://console.bluemix.net/docs/services/IoT/applications/libraries/java.html#java. However, we believe that there must be a more simpler way. If

Install OpenWhisk CLI on mac

孤人 提交于 2019-12-06 11:10:42
问题 I am unable to install OpenWhisk command line for some reason. I download the CLI and double click to run it. I see a terminal window saying [Process Complete] But then it says -bash: wsk: command not found 回答1: The OpenWhisk command line is not an installer but rather the binary itself. Open your Terminal.app , navigate to the folder you downloaded the binary to (like cd ~/Downloads ) and use the binary from there, for example ./wsk action list . To be able to use the binary from everywhere,