You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/02/06 16:08:07 UTC

[GitHub] dubeejw closed pull request #3252: bump docker runtime for large input, perl

dubeejw closed pull request #3252: bump docker runtime for large input, perl
URL: https://github.com/apache/incubator-openwhisk/pull/3252
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/actionRuntimes/actionProxy/Dockerfile b/actionRuntimes/actionProxy/Dockerfile
index 16094a719b..9d28b0acce 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 1ec8e9f89b..c06fafc861 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
+        }
+
+      }
+    }
+  }
+
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services