From dev-return-1521-archive-asf-public=cust-asf.ponee.io@openwhisk.apache.org Sat Feb 24 19:58:10 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 14C8F180656 for ; Sat, 24 Feb 2018 19:58:09 +0100 (CET) Received: (qmail 46773 invoked by uid 500); 24 Feb 2018 18:58:08 -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 Received: (qmail 46750 invoked by uid 99); 24 Feb 2018 18:58:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Feb 2018 18:58:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id B35BFC02BD for ; Sat, 24 Feb 2018 18:58:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.701 X-Spam-Level: X-Spam-Status: No, score=-0.701 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=messagingengine.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id VsiLEJviAubt for ; Sat, 24 Feb 2018 18:58:05 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C67E05F5B3 for ; Sat, 24 Feb 2018 18:58:04 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 624A220AF8 for ; Sat, 24 Feb 2018 13:58:04 -0500 (EST) Received: from web5 ([10.202.2.215]) by compute2.internal (MEProxy); Sat, 24 Feb 2018 13:58:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=FVO2m3ncZPuhW9VS3S7eNjOsmYE3G GQbZ9gt0e/b0yE=; b=JFfKTkPD8NrjlYJcsATUE/PMRD4zbpVmc7JEEasZ1Iy9a vDd2MXnuQzUXEiSckPN+8qtByuO/D3UfNMwf/j+cvU/hcnDCMdVcPIzORJisaoqO +bFrML9b4pURcutP8OlGC5thcCTgm7/EqCYpcW454V1Eq7K6T6m0dyhU7E75XuDT 8I3yIpYTg+LLMUuuoA3prmsxXx2ADDTgQP/TNERqm8Ood8hSjO4JNp1cHTo+LSqx /tp6B/pUv6Xu6cbChC4Ojhc7U0BtBeYnVZBuOtDh+KVQqea3ZN37wgtT7liy7VFX R9/vsA2KaNB8tbYllB6ddUdfHSfBNpMiWNjpYfyLw== X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id 43A319E0E7; Sat, 24 Feb 2018 13:58:04 -0500 (EST) Message-Id: <1519498684.3209770.1282095880.5988968F@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-efbb3405 Date: Sat, 24 Feb 2018 19:58:04 +0100 Subject: Implementation plan for Go actions Hello, whiskers I am at the risk of expanding too much the scope of what I am trying to do,= so I want to try to focus and work step by step. So I am writing down my plan for review. #=C2=A0Step one: implement a good support for GoLang, with piped standard i= nput and output, and log in stderr. Because there is not a past support for Go, except the generic docker suppo= rt, I think I have some freedom here.=20 The support will then work this way (please review carefully): ## /init The runtime expects posted in /init the usual { "binary": ... "code": ... "main": .. } where "code" is either a zip file (with binary: true) or a source code (wi= th binary: false or absent). If it source code, it expects to be a go source. It places in /action/main/exec.go and compiles it with go build -o /action/= exec /action/main/exec.go, getting a /action/exec to execute. If is is a zip file, it will unzip it in /action. If there is a /action/exe= c file in the zip it will run it.=20 If there is not, it will look if there is a "main" parameter, getting the = . It will compile a /action/main/.go. If the is miss= ing, it will default to /action/main/exec.go. Note the zip can include other source files that will be stored in /action/= . So I will have to use GOPATH=3D/action to find them. ## /run The /run behaviour is: At every request, if no action process is running,it will start one and wil= l pass the first line as an argument and also in standard output. If the executable does not terminate, it will keep feeding more input in st= andard input, expecting output in standard output (line by line) and logs i= n stderr.=20 The server will have to collect stderr logs and write them in docker stdout= , and terminate the output with the markers when an action completes: XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX XXX_THE_END_OF_A_WHISK_ACTIVATION_XXX It the executable DOES terminate, it will execute again at the next /run re= quest ## Step 2: need to implement the same logic for swift actions (we have to = keep the existing compilation infrastructure) Issues to solve here are the compilation and the "warm" startup problem. I = have some ideas but... I do better to discuss them once the Go support is f= inished. ## Step 3: will discuss with the list if it is worth to extend the support = to the generic dockerskeleton, that is based on the python proxy. There are compatibility issues, because the current docker support logs eve= rything in stdout and the last line is the answer, while for using the pipe= you need to do separate log. How does it sound? Suggested or required changes? Am I missing something? Approved? --=20 Michele Sciabarra openwhisk@sciabarra.com