You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by lz...@apache.org on 2017/09/04 02:38:05 UTC

[incubator-openwhisk-wskdeploy] branch master updated: deprecating swift and php runtimes (#435)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new bd04a56  deprecating swift and php runtimes (#435)
bd04a56 is described below

commit bd04a56ae6802bcc6bcc581087259a691f28420c
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Sun Sep 3 19:38:02 2017 -0700

    deprecating swift and php runtimes (#435)
    
    * deprecating swift and php runtimes
    
    we have swift:3, swift:3.1.1, and php:7.1 supported
    
    * updating unit test
---
 parsers/manifest_parser.go                       |  4 +-
 parsers/manifest_parser_test.go                  |  6 +--
 tests/src/integration/runtimetests/manifest.yaml | 53 ++++++++++++++++++------
 utils/misc.go                                    |  9 ++--
 4 files changed, 48 insertions(+), 24 deletions(-)

diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 8330f09..0e4f477 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -267,7 +267,7 @@ func (dm *YAMLParser) ComposeActions(mani *ManifestYAML, manipath string) (ar []
 
 				switch ext {
 				case ".swift":
-					kind = "swift"
+					kind = "swift:3"
 				case ".js":
 					kind = "nodejs:6"
 				case ".py":
@@ -275,7 +275,7 @@ func (dm *YAMLParser) ComposeActions(mani *ManifestYAML, manipath string) (ar []
 				case ".java":
 					kind = "java"
 				case ".php":
-					kind = "php"
+					kind = "php:7.1"
 				case ".jar":
 					kind = "java"
 				default:
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index b83251e..c4027dd 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -500,16 +500,12 @@ func TestComposeActionsForImplicitRuntimes(t *testing.T) {
 				for i := 0; i < len(actions); i++ {
 					if actions[i].Action.Name == "helloNodejs" {
 						expectedResult = "nodejs:6"
-						// (TODO) change expectedResult in the following condition
-						// (TODO) once issue #306 is fixed as runtime is set to
-						// (TODO) nodejs:default for any kind of action file except
-						// (TODO) files with extension .js, .py, and .swift
 					} else if actions[i].Action.Name == "helloJava" {
 						expectedResult = "java"
 					} else if actions[i].Action.Name == "helloPython" {
 						expectedResult = "python"
 					} else if actions[i].Action.Name == "helloSwift" {
-						expectedResult = "swift"
+						expectedResult = "swift:3"
 					}
 					actualResult := actions[i].Action.Exec.Kind
 					assert.Equal(t, expectedResult, actualResult, "Expected "+expectedResult+" but got "+actualResult)
diff --git a/tests/src/integration/runtimetests/manifest.yaml b/tests/src/integration/runtimetests/manifest.yaml
index 8948af5..9e9482f 100644
--- a/tests/src/integration/runtimetests/manifest.yaml
+++ b/tests/src/integration/runtimetests/manifest.yaml
@@ -3,7 +3,7 @@ package:
   version: 1.0
   license: Apache-2.0
   actions:
-    greeting:
+    greetingnodejs-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/greeting.js
@@ -13,7 +13,16 @@ package:
         place: string
       outputs:
         payload: string
-    greetingphp:
+    greetingnodejs-without-explicit-runtime:
+      web-export: true
+      version: 1.0
+      function: src/greeting.js
+      inputs:
+        name: string
+        place: string
+      outputs:
+        payload: string
+    greetingphp-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.php
@@ -23,7 +32,16 @@ package:
         place: string
       outputs:
         payload: string
-    greetingpython:
+    greetingphp-without-explicit-runtime:
+      web-export: true
+      version: 1.0
+      function: src/hello.php
+      inputs:
+        name: string
+        place: string
+      outputs:
+        payload: string
+    greetingpython-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.py
@@ -33,7 +51,16 @@ package:
         place: string
       outputs:
         payload: string
-    greetingpython:
+    greetingpython-without-explicit-runtime:
+      web-export: true
+      version: 1.0
+      function: src/hello.py
+      inputs:
+        name: string
+        place: string
+      outputs:
+        payload: string
+    greetingpython2-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.py
@@ -43,7 +70,7 @@ package:
         place: string
       outputs:
         payload: string
-    greetingpython:
+    greetingpython3-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.py
@@ -53,7 +80,7 @@ package:
         place: string
       outputs:
         payload: string
-    greetingswift:
+    greetingswift311-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.swift
@@ -63,35 +90,35 @@ package:
         place: string
       outputs:
         payload: string
-    greetingswift:
+    greetingswift3-with-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.swift
-      runtime: swift
+      runtime: swift:3
       inputs:
         name: string
         place: string
       outputs:
         payload: string
-    greetingswift:
+    greetingswift-without-explicit-runtime:
       web-export: true
       version: 1.0
       function: src/hello.swift
-      runtime: swift:3
       inputs:
         name: string
         place: string
       outputs:
         payload: string
-    helloworldjava:
+    helloworldjava-with-explicit-runtime:
       function: src/hello.jar
       runtime: java
       main: Hello
+    helloworldjava-without-explicit-runtime:
+      function: src/hello.jar
+      main: Hello
   triggers:
     locationUpdateRuntime:
   rules:
     myRuleRuntime:
       trigger: locationUpdateRuntime
-      #the action name and the action file greeting.js should consistent.
-      #currently the implementation deside the action name consistent with action file name?
       action: greeting
diff --git a/utils/misc.go b/utils/misc.go
index 11f1afa..deafa4f 100644
--- a/utils/misc.go
+++ b/utils/misc.go
@@ -473,11 +473,12 @@ func ParseOpenWhisk(apiHost string) (op OpenWhiskInfo, err error) {
 
 func ConvertToMap(op OpenWhiskInfo) (rt map[string][]string) {
 	rt = make(map[string][]string)
-	for k, _ := range op.Runtimes {
-		v := op.Runtimes[k]
+	for k, v := range op.Runtimes {
 		rt[k] = make([]string, 0, len(v))
-		for i := range op.Runtimes[k] {
-			rt[k] = append(rt[k], op.Runtimes[k][i].Kind)
+		for i := range v {
+			if (!v[i].Deprecated) {
+				rt[k] = append(rt[k], v[i].Kind)
+			}
 		}
 	}
 	return

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].