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/03/27 19:28:54 UTC

[GitHub] dgrove-oss closed pull request #39: split write of wait command insert in runner.py

dgrove-oss closed pull request #39: split write of wait command insert in runner.py
URL: https://github.com/apache/incubator-openwhisk-runtime-swift/pull/39
 
 
   

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/README.md b/README.md
index 5fefccc..2075e72 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
 <!--
 #
-# Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-# license agreements.  See the NOTICE file distributed with this work for additional 
+# 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 
+# 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 
+# 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.
 #
@@ -86,7 +86,7 @@ func main(input: Employee, respondWith: (Employee?, Error?) -> Void) -> Void {
         throw VendingMachineError.insufficientFunds(coinsNeeded: 5)
     } catch {
         respondWith(nil, error)
-    } 
+    }
 }
 ```
 ```
@@ -157,10 +157,10 @@ let package = Package(
         dependencies: ["SwiftyRequest"],
         path: "."
       )
- 
+
 ```
   As you can see this example adds `SwiftyRequest` dependencies.
-  
+
   Notice that now with swift:4.1 is no longer required to include `CCurl`, `Kitura-net` and `SwiftyJSON` in your own `Package.swift`.
   You are free now to use no dependencies, or add the combination that you want with the versions you want.
 
@@ -240,7 +240,7 @@ This will produce the image `whisk/action-swift-v4.1`
 Build and Push image
 ```
 docker login
-./gradlew core:swift40Action:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io 
+./gradlew core:swift40Action:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
 ```
 
 ### Swift 4.1 Experimental
@@ -298,7 +298,7 @@ func main(input: Employee, respondWith: (Employee?, Error?) -> Void) -> Void {
         throw VendingMachineError.insufficientFunds(coinsNeeded: 5)
     } catch {
         respondWith(nil, error)
-    } 
+    }
 }
 ```
 ```
@@ -320,32 +320,32 @@ wsk action invoke helloCodableError -b -p id 42 -p name Carlos
 }
 ```
 
-### Using Swift 3.1.1
+### Using Swift 4.1
 To use as a docker action
 ```
-wsk action update myAction myAction.swift --docker openwhisk/action-swift-v3.1.1:1.0.0
+wsk action update myAction myAction.swift --docker openwhisk/action-swift-v4.1:1.0.0
 ```
 This works on any deployment of Apache OpenWhisk
 
 ### To use on deployment that contains the rutime as a kind
 To use as a kind action
 ```
-wsk action update myAction myAction.swift --kind swift:3.1.1
+wsk action update myAction myAction.swift --kind swift:4.1
 ```
 
 ## Local development
 ```
 ./gradlew core:swift41Action:distDocker
 ```
-This will produce the image `whisk/action-swift-v3.1.1`
+This will produce the image `whisk/action-swift-v4.1`
 
 Build and Push image
 ```
 docker login
-./gradlew core:swiftAction:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io 
+./gradlew core:swift41Action:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
 ```
 
-Deploy OpenWhisk using ansible environment that contains the kind `swift:3.1.1`
+Deploy OpenWhisk using ansible environment that contains the kind `swift:4.1`
 Assuming you have OpenWhisk already deploy localy and `OPENWHISK_HOME` pointing to root directory of OpenWhisk core repository.
 
 Set `ROOTDIR` to the root directory of this repository.
@@ -389,12 +389,12 @@ Using IntelliJ:
 #### Using container image to test
 To use as docker action push to your own dockerhub account
 ```
-docker tag whisk/action-swift-v3.1.1 $user_prefix/action-swift-v3.1.1
-docker push $user_prefix/action-swift-v3.1.1
+docker tag whisk/action-swift-v4.1 $user_prefix/action-swift-v4.1
+docker push $user_prefix/action-swift-v4.1
 ```
 Then create the action using your the image from dockerhub
 ```
-wsk action update myAction myAction.swift --docker $user_prefix/action-swift-v3.1.1
+wsk action update myAction myAction.swift --docker $user_prefix/action-swift-v4.1
 ```
 The `$user_prefix` is usually your dockerhub user id.
 
diff --git a/core/swift41Action/swift4runner.py b/core/swift41Action/swift4runner.py
index f9f4293..d3609d3 100644
--- a/core/swift41Action/swift4runner.py
+++ b/core/swift41Action/swift4runner.py
@@ -66,7 +66,8 @@ def epilogue(self, init_message):
             with codecs.open(SRC_EPILOGUE_FILE, 'r', 'utf-8') as ep:
                 fp.write(ep.read())
 
-            fp.write('_run_main(mainFunction: %s)\n_ = _whisk_semaphore.wait(timeout: .distantFuture)\n' % main_function)
+            fp.write('_run_main(mainFunction: %s)\n' % main_function)
+            fp.write('_ = _whisk_semaphore.wait(timeout: .distantFuture)\n')
 
     def build(self, init_message):
         # short circuit the build, if there already exists a binary


 

----------------------------------------------------------------
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