From dev-return-1619-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Mon Mar 5 15:21:18 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 114D3180608 for ; Mon, 5 Mar 2018 15:21:17 +0100 (CET) Received: (qmail 14028 invoked by uid 500); 5 Mar 2018 14:21:17 -0000 Mailing-List: contact dev-help@openwhisk.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openwhisk.apache.org Delivered-To: mailing list dev@openwhisk.apache.org Delivered-To: moderator for dev@openwhisk.apache.org Received: (qmail 26937 invoked by uid 99); 4 Mar 2018 14:01:37 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.702 X-Spam-Level: X-Spam-Status: No, score=-0.702 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=messagingengine.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=yzq6yr ts7Xr7M70b6W61bukIwjzYqhHA5oWrB60L0cg=; b=VPSnV/guvekG7E8FrG43Ul Pus8BRj0KXyMRBRhfM74qWsObF+prYo45J3ODDJQ1gJpHgQXJIG7W45bAcS4RAut 4k0z/h+XMleNzZY0EslYx7S/0D23B99eFSHlAmCe+xCsXz6zvq+k3XMpFSIszLGf rnyiwMwp4yjSNGbPVcKRUXNm0xuPw+NBYsSeH5wusNwGrphdjKetW6fMr1HFxn2o K4+ZVdMb2mrSCb1awyGWfxLubPAsOjuWKxOaO0dR84I/gTkLoi6Vj+15SdzzlV/D Kiud6S1wtFIjFru8QpW7WoHCu4mE0CtFBTzdGxabxLT9JvT7UIyX9XfYswlVSaig == X-ME-Sender: Message-Id: <1520172092.2958305.1290895920.1D5ECE30@webmail.messagingengine.com> From: Michele Sciabarra To: dev@openwhisk.apache.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-b08ff009 References: Subject: Re: Using bash-based actions Date: Sun, 04 Mar 2018 15:01:32 +0100 In-Reply-To: I am wondering... would be helpful if you could write bash based actions as= a "pipe-loop"? Something reading and writing in stdout like this: ---- #!/bin/bash echo '{"openwhisk":1}' while true do read line hello=3D"Hello, $(echo $line | jq -r .name)" echo '{"greetings":"'$hello'"}' done ---- Because I am buiding support for golang and generic binaries, and implement= ing also support for bash scripts would be as easy as to detect scripts in = addition to elf binaries when they are uploaded.=20 The "Start()" command I use should be able to launch also bash scripts.... --=20 Michele Sciabarra michele@sciabarra.com On Sun, Mar 4, 2018, at 12:53 PM, Carlos Santana wrote: > Hi Herez >=20 > Perl and Bash Actions are supported is just that we need to improve the > documentation to make it more explicit I=E2=80=99m working on improving d= ocker > Actions documentation this week :-) >=20 > Try this: >=20 > wsk action update fooBash foo.sh =E2=80=94native >=20 > Or >=20 > wsk action update fooPerl foo.pl =E2=80=94native >=20 > It can be any script file the action will chmod +x and then executed. >=20 > For the second question I don=E2=80=99t know what you mean for logs. > Any text to stdout and stderr before the last line with the json string > result are capture in te logs in the activation record >=20 > Fell free to open an issue with more info on how to reproduce your proble= m. >=20 > =E2=80=94 Carlos > PS: my employer is also IBM. :-) >=20 > On Sun, Mar 4, 2018 at 5:56 AM Erez Hadad wrote: >=20 > > Hi folks, > > > > I'm working with technical people from different organizations outside = my > > employer (IBM), and we're testing OpenWhisk as a mechanism for integrat= ing > > our different tools and services into a single heterogeneous event-driv= en > > programming model. > > On the face of it, OW seems like a great fit. > > However, when it comes down to implementation, we often hit a case where > > the easiest way to delegate action execution to a custom tool is by > > writing a simple bash script. This is where things get complicated. > > To the best of my understanding (please correct me otherwise), there is= no > > first-class support for bash runtime in OW. > > So, it's down to creating either a "native" action using a zip, or a > > custom docker action. Both options are quite more cumbersome than using > > native runtimes. > > > > So this is my first question - would it make sense to have a native bash > > runtime in OW? especially given that some of the function that OW > > seemingly provides is glue-code between existing tools and services (wh= ere > > bash also shines). > > > > As a second issue, we explored the native action. It seems that output = is > > not captured in the action logs when including ssh calls that invoke ba= sh > > > > My second question - does anyone have a different experience with this > > that they can share? (maybe this problem is not related to OW?) > > > > Regards, > > -- Erez Hadad > > > > Erez Hadad, PhD > > Cloud System Technologies > > IBM Research - Haifa > > email: erezh@il.ibm.com > > phone: +972-4-829-6509 > > > > > > > >