You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by dg...@apache.org on 2018/07/06 12:46:29 UTC

[incubator-openwhisk-runtime-python] branch master updated (b296e05 -> de93403)

This is an automated email from the ASF dual-hosted git repository.

dgrove pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-python.git.


    from b296e05  add repo to deploy step, add master tag to docker (#30)
     new 0983e5e  Remove file (redundant with openwhisk repo).
     new de93403  Update base images to openwhisk/dockerskeleton:1.3.1.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 core/python2Action/CHANGELOG.md                    |   6 +-
 core/python2Action/Dockerfile                      |   2 +-
 core/python2Action/invoke.py                       | 102 ---------------------
 core/pythonAction/CHANGELOG.md                     |   6 +-
 core/pythonAction/Dockerfile                       |   2 +-
 tests/.pydevproject                                |   5 -
 .../PythonActionContainerTests.scala               |   5 +
 7 files changed, 15 insertions(+), 113 deletions(-)
 delete mode 100755 core/python2Action/invoke.py
 delete mode 100644 tests/.pydevproject


[incubator-openwhisk-runtime-python] 01/02: Remove file (redundant with openwhisk repo).

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0983e5e69bc1dda64d0d25357c55419d768f4d5a
Author: Rodric Rabbah <ro...@gmail.com>
AuthorDate: Thu Jul 5 15:41:14 2018 -0400

    Remove file (redundant with openwhisk repo).
---
 core/python2Action/invoke.py | 102 -------------------------------------------
 1 file changed, 102 deletions(-)

diff --git a/core/python2Action/invoke.py b/core/python2Action/invoke.py
deleted file mode 100755
index 92d8a6d..0000000
--- a/core/python2Action/invoke.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-"""Executable Python script for testing the action proxy.
-
-  This script is useful for testing the action proxy (or its derivatives)
-  by simulating invoker interactions. Use it in combination with
-  delete-build-run.sh which builds and starts up the action proxy.
-  Examples:
-     ./delete-build-run.sh &
-     ./invoke.py init <action source file> # should return OK
-     ./invoke.py run '{"some":"json object as a string"}'
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-"""
-
-import os
-import re
-import sys
-import json
-import requests
-import codecs
-
-DOCKER_HOST = "localhost"
-if "DOCKER_HOST" in os.environ:
-    try:
-        DOCKER_HOST = re.compile("tcp://(.*):[\d]+").findall(
-            os.environ["DOCKER_HOST"])[0]
-    except Exception:
-        print("cannot determine docker host from %s" %
-              os.environ["DOCKER_HOST"])
-        sys.exit(-1)
-DEST = "http://%s:8080" % DOCKER_HOST
-
-
-def content_from_args(args):
-    if len(args) == 0:
-        return None
-
-    if len(args) == 1 and os.path.exists(args[0]):
-        with open(args[0]) as fp:
-            return json.load(fp)
-
-    # else...
-    in_str = " ".join(args)
-    try:
-        d = json.loads(in_str)
-        if isinstance(d, dict):
-            return d
-        else:
-            raise "Not a dict."
-    except:
-        return in_str
-
-
-def init(args):
-    main = args[1] if len(args) == 2 else "main"
-    args = args[0] if len(args) >= 1 else None
-
-    if args and args.endswith(".zip"):
-        with open(args, "rb") as fp:
-            contents = fp.read().encode("base64")
-        binary = True
-    elif args:
-        with(codecs.open(args, "r", "utf-8")) as fp:
-            contents = fp.read()
-        binary = False
-    else:
-        contents = None
-        binary = False
-
-    r = requests.post("%s/init" % DEST, json={"value": {"code": contents,
-                                                        "binary": binary,
-                                                        "main": main}})
-    print(r.text)
-
-
-def run(args):
-    value = content_from_args(args)
-    # print("Sending value: %s..." % json.dumps(value)[0:40])
-    r = requests.post("%s/run" % DEST, json={"value": value})
-    print(r.text)
-
-
-if sys.argv[1] == "init":
-    init(sys.argv[2:])
-elif sys.argv[1] == "run":
-    run(sys.argv[2:])
-else:
-    print("usage: 'init <filename>' or 'run JSON-as-string'")


[incubator-openwhisk-runtime-python] 02/02: Update base images to openwhisk/dockerskeleton:1.3.1.

Posted by dg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit de93403b5fa122982185c139a9b45f29c0cf5f87
Author: Rodric Rabbah <ro...@gmail.com>
AuthorDate: Thu Jul 5 20:21:45 2018 -0400

    Update base images to openwhisk/dockerskeleton:1.3.1.
---
 core/python2Action/CHANGELOG.md                                     | 6 ++++--
 core/python2Action/Dockerfile                                       | 2 +-
 core/pythonAction/CHANGELOG.md                                      | 6 ++++--
 core/pythonAction/Dockerfile                                        | 2 +-
 tests/.pydevproject                                                 | 5 -----
 .../scala/runtime/actionContainers/PythonActionContainerTests.scala | 5 +++++
 6 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/core/python2Action/CHANGELOG.md b/core/python2Action/CHANGELOG.md
index 6dfd54c..02f5949 100644
--- a/core/python2Action/CHANGELOG.md
+++ b/core/python2Action/CHANGELOG.md
@@ -19,10 +19,12 @@
 
 # Python 2 OpenWhisk Runtime Container
 
-
+## 1.0.1
+Changes:
+  - Update base image to openwhisk/dockerskeleton:1.3.1
 
 ## 1.0.0
-Change: Initial release
+Initial release.
 
 Python version = 2.7.12
 
diff --git a/core/python2Action/Dockerfile b/core/python2Action/Dockerfile
index 32e9446..dd374f6 100644
--- a/core/python2Action/Dockerfile
+++ b/core/python2Action/Dockerfile
@@ -50,7 +50,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools six \
 ENV FLASK_PROXY_PORT 8080
 
 # Add the action proxy
-ADD https://raw.githubusercontent.com/apache/incubator-openwhisk-runtime-docker/dockerskeleton%401.1.0/core/actionProxy/actionproxy.py /actionProxy/actionproxy.py
+ADD https://raw.githubusercontent.com/apache/incubator-openwhisk-runtime-docker/dockerskeleton%401.3.1/core/actionProxy/actionproxy.py /actionProxy/actionproxy.py
 
 ADD pythonrunner.py /pythonAction/
 
diff --git a/core/pythonAction/CHANGELOG.md b/core/pythonAction/CHANGELOG.md
index 1d802a7..9f95463 100644
--- a/core/pythonAction/CHANGELOG.md
+++ b/core/pythonAction/CHANGELOG.md
@@ -19,10 +19,12 @@
 
 # Python 3 OpenWhisk Runtime Container
 
-
+## 1.0.1
+Changes:
+  - Update base image to openwhisk/dockerskeleton:1.3.1
 
 ## 1.0.0
-Change: Initial release
+Initial release.
 
 Python version = 3.6.1
 
diff --git a/core/pythonAction/Dockerfile b/core/pythonAction/Dockerfile
index 9797345..1f4873b 100644
--- a/core/pythonAction/Dockerfile
+++ b/core/pythonAction/Dockerfile
@@ -16,7 +16,7 @@
 #
 
 # Dockerfile for python actions, overrides and extends ActionRunner from actionProxy
-FROM openwhisk/dockerskeleton:1.0.0
+FROM openwhisk/dockerskeleton:1.3.1
 
 RUN apk add --no-cache \
         bzip2-dev \
diff --git a/tests/.pydevproject b/tests/.pydevproject
deleted file mode 100644
index 40e9f40..0000000
--- a/tests/.pydevproject
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?eclipse-pydev version="1.0"?><pydev_project>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
-<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
-</pydev_project>
diff --git a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
index 711fdf3..ecc40e3 100644
--- a/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
+++ b/tests/src/test/scala/runtime/actionContainers/PythonActionContainerTests.scala
@@ -103,6 +103,11 @@ class PythonActionContainerTests extends BasicActionRunnerTests with WskActorSys
          """.stripMargin.trim)
   })
 
+  testInitCannotBeCalledMoreThanOnce("""
+        |def main(args):
+        |    return args
+      """.stripMargin)
+
   it should "support actions using non-default entry points" in {
     withActionContainer() { c =>
       val code = """