You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by mr...@apache.org on 2017/12/07 23:07:15 UTC

[incubator-openwhisk-wskdeploy] branch master updated: Uncommenting managed deployment for rules, package, actions, and sequences (#666)

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

mrutkowski 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 4ea4e1d  Uncommenting managed deployment for rules, package, actions, and sequences (#666)
4ea4e1d is described below

commit 4ea4e1d8550d74ec2a3393281ad156c45009f241
Author: Priti Desai <pd...@us.ibm.com>
AuthorDate: Thu Dec 7 15:07:13 2017 -0800

    Uncommenting managed deployment for rules, package, actions, and sequences (#666)
    
    * Uncommenting managed deployment for rules, package, actions, and sequences
    
    * changing default swift runtime from swift:3 to swift:3.1.1
    
    * Updating hardcoded runtime list
    
    * adding one default per runtime
---
 deployers/servicedeployer.go                     |  12 +-
 parsers/manifest_parser.go                       |   2 +-
 parsers/manifest_parser_test.go                  |   2 +-
 tests/src/integration/runtimetests/manifest.yaml |   2 +-
 utils/misc.go                                    | 192 ++++++++++++-----------
 utils/misc_test.go                               |   4 +-
 6 files changed, 111 insertions(+), 103 deletions(-)

diff --git a/deployers/servicedeployer.go b/deployers/servicedeployer.go
index 183798a..9b33c8a 100644
--- a/deployers/servicedeployer.go
+++ b/deployers/servicedeployer.go
@@ -476,13 +476,13 @@ func (deployer *ServiceDeployer) RefreshManagedEntities(maValue whisk.KeyValue)
 		return err
 	}
 
-	//if err := deployer.RefreshManagedRules(ma); err != nil {
-	//	return err
-	//}
+	if err := deployer.RefreshManagedRules(ma); err != nil {
+		return err
+	}
 
-	//if err := deployer.RefreshManagedPackages(ma); err != nil {
-	//	return err
-	//}
+	if err := deployer.RefreshManagedPackages(ma); err != nil {
+		return err
+	}
 
 	return nil
 
diff --git a/parsers/manifest_parser.go b/parsers/manifest_parser.go
index 4cd2a26..4a651c5 100644
--- a/parsers/manifest_parser.go
+++ b/parsers/manifest_parser.go
@@ -439,7 +439,7 @@ func (dm *YAMLParser) ComposeActions(filePath string, actions map[string]Action,
 
 				switch ext {
 				case ".swift":
-					kind = "swift:3"
+					kind = "swift:3.1.1"
 				case ".js":
 					kind = "nodejs:6"
 				case ".py":
diff --git a/parsers/manifest_parser_test.go b/parsers/manifest_parser_test.go
index b9aca56..f31b55c 100644
--- a/parsers/manifest_parser_test.go
+++ b/parsers/manifest_parser_test.go
@@ -486,7 +486,7 @@ func TestComposeActionsForImplicitRuntimes(t *testing.T) {
                     } else if actions[i].Action.Name == "helloPython" {
                         expectedResult = "python"
                     } else if actions[i].Action.Name == "helloSwift" {
-                        expectedResult = "swift:3"
+                        expectedResult = "swift:3.1.1"
                     }
                     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 1f179a8..922e7c4 100644
--- a/tests/src/integration/runtimetests/manifest.yaml
+++ b/tests/src/integration/runtimetests/manifest.yaml
@@ -94,7 +94,7 @@ packages:
           web-export: true
           version: 1.0
           function: src/hello.swift
-          runtime: swift:3
+          runtime: swift:3.1.1
           inputs:
             name: string
             place: string
diff --git a/utils/misc.go b/utils/misc.go
index b9d862e..246656e 100644
--- a/utils/misc.go
+++ b/utils/misc.go
@@ -441,105 +441,113 @@ func ConvertToMap(op OpenWhiskInfo) (rt map[string][]string) {
 }
 
 var runtimeInfo = []byte(`{
-  "support": {
-    "github": "https://github.com/apache/incubator-openwhisk/issues",
-    "slack": "http://slack.openwhisk.org"
-  },
-  "description": "OpenWhisk",
-  "api_paths": ["/api/v1"],
-  "runtimes": {
-    "nodejs": [{
-      "image": "openwhisk/nodejsaction:latest",
-      "deprecated": true,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "nodejs"
-    }, {
-      "image": "openwhisk/nodejs6action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "nodejs:6"
-    }],
-    "java": [{
-      "image": "openwhisk/java8action:latest",
-      "deprecated": false,
-      "requireMain": true,
-      "default": true,
-      "attached": true,
-      "kind": "java"
-    }],
-    "php": [{
-      "image": "openwhisk/action-php-v7.1:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "php:7.1"
-    }],
-    "python": [{
-      "image": "openwhisk/python2action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "python"
-    }, {
-      "image": "openwhisk/python2action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "python:2"
-    }, {
-      "image": "openwhisk/python3action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "python:3"
-    }],
-    "swift": [{
-      "image": "openwhisk/swiftaction:latest",
-      "deprecated": true,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "swift"
-    }, {
-      "image": "openwhisk/swift3action:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": true,
-      "attached": false,
-      "kind": "swift:3"
-    }, {
-      "image": "openwhisk/action-swift-v3.1.1:latest",
-      "deprecated": false,
-      "requireMain": false,
-      "default": false,
-      "attached": false,
-      "kind": "swift:3.1.1"
-    }]
-  },
-  "limits": {
-    "actions_per_minute": 5000,
-    "triggers_per_minute": 5000,
-    "concurrent_actions": 1000
-  }
-  }
+	"support":{
+		"github":"https://github.com/apache/incubator-openwhisk/issues",
+		"slack":"http://slack.openwhisk.org"
+	},
+	"description":"OpenWhisk",
+	"api_paths":["/api/v1"],
+	"runtimes":{
+		"nodejs":[{
+			"image":"openwhisk/nodejsaction:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"nodejs"
+		},{
+			"image":"openwhisk/nodejs6action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"nodejs:6"
+		},{
+			"image":"openwhisk/action-nodejs-v8:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"nodejs:8"
+		}],
+		"java":[{
+			"image":"openwhisk/java8action:latest",
+			"deprecated":false,
+			"requireMain":true,
+			"default":true,
+			"attached":true,
+			"kind":"java"
+		}],
+		"php":[{
+			"image":"openwhisk/action-php-v7.1:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"php:7.1"
+		}],
+		"python":[{
+			"image":"openwhisk/python2action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"python"
+		},{
+			"image":"openwhisk/python2action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"python:2"
+		},{
+			"image":"openwhisk/python3action:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"python:3"
+		}],
+		"swift":[{
+			"image":"openwhisk/swiftaction:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"swift"
+		},{
+			"image":"openwhisk/swift3action:latest",
+			"deprecated":true,
+			"requireMain":false,
+			"default":false,
+			"attached":false,
+			"kind":"swift:3"
+		},{
+			"image":"openwhisk/action-swift-v3.1.1:latest",
+			"deprecated":false,
+			"requireMain":false,
+			"default":true,
+			"attached":false,
+			"kind":"swift:3.1.1"
+		}]
+	},
+	"limits":{
+		"actions_per_minute":5000,
+		"triggers_per_minute":5000,
+		"concurrent_actions":1000
+	}
+	}
 `)
 
+
 var Rts map[string][]string
 
 var DefaultRts = map[string][]string{
-	"nodejs": {"nodejs", "nodejs:6"},
+	"nodejs": {"nodejs:6"},
 	"java":   {"java"},
 	"php":    {"php:7.1"},
-	"python": {"python", "python:2", "python:3"},
-	"swift":  {"swift", "swift:3", "swift:3.1.1"},
+	"python": {"python:2"},
+	"swift":  {"swift:3.1.1"},
 }
 
 func CheckExistRuntime(rtname string, rts map[string][]string) bool {
diff --git a/utils/misc_test.go b/utils/misc_test.go
index f7a1ade..07a799b 100644
--- a/utils/misc_test.go
+++ b/utils/misc_test.go
@@ -85,11 +85,11 @@ func TestParseOpenWhisk(t *testing.T) {
 	openwhisk, err := ParseOpenWhisk(openwhiskHost)
 	assert.Equal(t, nil, err, "parse openwhisk info error happened.")
 	converted := ConvertToMap(openwhisk)
-	assert.Equal(t, 1, len(converted["nodejs"]), "not expected length")
+	assert.Equal(t, 2, len(converted["nodejs"]), "not expected length")
 	assert.Equal(t, 1, len(converted["php"]),  "not expected length")
 	assert.Equal(t, 1, len(converted["java"]), "not expected length")
 	assert.Equal(t, 3, len(converted["python"]), "not expected length")
-	assert.Equal(t, 2, len(converted["swift"]), "not expected length")
+	assert.Equal(t, 1, len(converted["swift"]), "not expected length")
 }
 
 func TestNewZipWritter(t *testing.T) {

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