openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dube...@apache.org
Subject [incubator-openwhisk] branch master updated: bump docker runtime for large input, perl, and utilities (#3252)
Date Tue, 06 Feb 2018 16:08:08 GMT
This is an automated email from the ASF dual-hosted git repository.

dubeejw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 4463d57  bump docker runtime for large input, perl, and utilities (#3252)
4463d57 is described below

commit 4463d5768bd5f53a87797983c1145da6f19e5540
Author: Carlos Santana <csantana23@gmail.com>
AuthorDate: Tue Feb 6 11:08:03 2018 -0500

    bump docker runtime for large input, perl, and utilities (#3252)
---
 actionRuntimes/actionProxy/Dockerfile              |  2 +-
 .../ActionProxyContainerTests.scala                | 52 ++++++++++++++++++++--
 2 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/actionRuntimes/actionProxy/Dockerfile b/actionRuntimes/actionProxy/Dockerfile
index 16094a7..9d28b0a 100644
--- a/actionRuntimes/actionProxy/Dockerfile
+++ b/actionRuntimes/actionProxy/Dockerfile
@@ -1,2 +1,2 @@
 # Dockerfile for docker skeleton (useful for running blackbox binaries, scripts, or Python
3 actions) .
-FROM openwhisk/dockerskeleton:1.0.0
+FROM openwhisk/dockerskeleton:1.1.0
diff --git a/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala b/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
index 1ec8e9f..c06fafc 100644
--- a/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/ActionProxyContainerTests.scala
@@ -71,8 +71,7 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
                 |print $ARGV[0];
             """.stripMargin.trim
 
-    // excluding perl as it not installed in alpine based image
-    Seq(("bash", bash), ("python", python))
+    Seq(("bash", bash), ("python", python), ("perl", perl))
   }
 
   val stdUnicodeSamples = {
@@ -123,8 +122,32 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
                 |print "{ \"api_host\": \"$a\", \"api_key\": \"$b\", \"namespace\": \"$c\",
\"action_name\": \"$d\", \"activation_id\": \"$e\", \"deadline\": \"$f\" }";
             """.stripMargin.trim
 
-    // excluding perl as it not installed in alpine based image
-    Seq(("bash", bash), ("python", python))
+    Seq(("bash", bash), ("python", python), ("perl", perl))
+  }
+
+  /** Large param samples, echo the input args with input larger than 128K and using STDIN
*/
+  val stdLargeInputSamples = {
+    val bash = """
+                 |#!/bin/bash
+                 |  read inputstring
+                 |  echo $inputstring
+                 """.stripMargin.trim
+
+    val python = """
+                   |#!/usr/bin/env python
+                   |import sys, json
+                   |params = sys.stdin.readline()
+                   |j = json.loads(params)
+                   |print(json.dumps(j))
+                 """.stripMargin.trim
+
+    val perl = """
+                 |#!/usr/bin/env perl
+                 |$params=<STDIN>;
+                 |print $params;
+               """.stripMargin.trim
+
+    Seq(("bash", bash), ("python", python), ("perl", perl))
   }
 
   behavior of "openwhisk/dockerskeleton"
@@ -221,6 +244,7 @@ class ActionProxyContainerTests extends BasicActionRunnerTests with WskActorSyst
   testEcho(stdCodeSamples)
   testUnicode(stdUnicodeSamples)
   testEnv(stdEnvSamples)
+  testLargeInput(stdLargeInputSamples)
 }
 
 trait BasicActionRunnerTests extends ActionProxyContainerTestUtils {
@@ -345,4 +369,24 @@ trait BasicActionRunnerTests extends ActionProxyContainerTestUtils {
       }
     }
   }
+
+  /**
+   * Large param samples, echo the input args with input larger than 128K and using STDIN
+   */
+  def testLargeInput(stdLargeInputSamples: Seq[(String, String)]) = {
+    stdLargeInputSamples.foreach { s =>
+      it should s"run a ${s._1} script with large input" in {
+        val (out, err) = withActionContainer() { c =>
+          val (initCode, _) = c.init(initPayload(s._2))
+          initCode should be(200)
+
+          val arg = JsObject("arg" -> JsString(("a" * 1048561)))
+          val (_, runRes) = c.run(runPayload(arg))
+          runRes.get shouldBe arg
+        }
+
+      }
+    }
+  }
+
 }

-- 
To stop receiving notification emails like this one, please contact
dubeejw@apache.org.

Mime
View raw message