csantanapr closed pull request #3509: Bump swift 4.1 to latest release
URL: https://github.com/apache/incubator-openwhisk/pull/3509
 
 
   

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/swift4.1Action/Dockerfile 
b/actionRuntimes/swift4.1Action/Dockerfile
index 3a225fe19a..fec96272ae 100755
--- a/actionRuntimes/swift4.1Action/Dockerfile
+++ b/actionRuntimes/swift4.1Action/Dockerfile
@@ -1 +1 @@
-FROM openwhisk/action-swift-v4.1:1.0.1
+FROM openwhisk/action-swift-v4.1:1.0.4
diff --git a/docs/actions.md b/docs/actions.md
index 5c264280bd..6e79509bb5 100644
--- a/docs/actions.md
+++ b/docs/actions.md
@@ -629,7 +629,7 @@ wsk action create helloPHP --kind php:7.1 helloPHP.zip
 
 ## Creating Swift actions
 
-The process of creating Swift actions is similar to that of JavaScript 
actions. The following sections guide you through creating and invoking a 
single swift action, and packaging an action in a zip file. 
+The process of creating Swift actions is similar to that of JavaScript 
actions. The following sections guide you through creating and invoking a 
single swift action, and packaging an action in a zip file.
 
 You can also use the online [Online Swift 
Playground](http://online.swiftplayground.run) to test your Swift code without 
having to install Xcode on your machine.
 
@@ -719,7 +719,7 @@ Find out more about parameters in the [Working with 
parameters](./parameters.md)
 
 When you create an OpenWhisk Swift action with a Swift source file, it has to 
be compiled into a binary before the action is run. Once done, subsequent calls 
to the action are much faster until the container holding your action is 
purged. This delay is known as the cold-start delay.
 
-To avoid the cold-start delay, you can compile your Swift file into a binary 
and then upload to OpenWhisk in a zip file. As you need the OpenWhisk 
scaffolding, the easiest way to create the binary is to build it within the 
same environment as it will be run in. 
+To avoid the cold-start delay, you can compile your Swift file into a binary 
and then upload to OpenWhisk in a zip file. As you need the OpenWhisk 
scaffolding, the easiest way to create the binary is to build it within the 
same environment as it will be run in.
 
 ### Using a script to build Swift packaged action
 You can use a script to automate the packaging of the action. Create  script 
`compile.sh`h file the following.
@@ -732,7 +732,7 @@ if [ -z "$1" ] ; then
     exit 1
 fi
 if [ -z "$2" ] ; then
-    echo 'Error: Missing runtime docker image name, for example 
openwhisk/action-swift-v4.0'
+    echo 'Error: Missing kind, for example swift:4.1'
     exit 2
 fi
 OUTPUT_DIR="build"
@@ -774,6 +774,12 @@ fi
 cat $BASE_PATH/epilogue.swift >> $DEST_SOURCE/main.swift
 echo '_run_main(mainFunction:main)' >> $DEST_SOURCE/main.swift
 
+# Only for Swift4
+if [ ${2} != "swift:3.1.1" ]; then
+  echo 'Adding wait to deal with escaping'
+  echo '_ = _whisk_semaphore.wait(timeout: .distantFuture)' >> 
$DEST_SOURCE/main.swift
+fi
+
 echo \"Compiling $1...\"
 cd /$BASE_PATH/spm-build
 cp /owexec/actions/$1/Package.swift $DEST_PACKAGE_SWIFT
@@ -887,7 +893,7 @@ func main(param: Input, completion: (Output?, Error?) -> 
Void) -> Void {
         throw VendingMachineError.insufficientFunds(coinsNeeded: 5)
     } catch {
         completion(nil, error)
-    } 
+    }
 }
 ```
 
@@ -1105,7 +1111,7 @@ import "os"
 func main() {
     //program receives one argument: the JSON object as a string
     arg := os.Args[1]
-   
+
     // unmarshal the string to a JSON object
     var obj map[string]interface{}
     json.Unmarshal([]byte(arg), &obj)
diff --git a/tools/build/compile_swift.sh b/tools/build/compile_swift.sh
index 7deb9341b0..ff8ab1554f 100755
--- a/tools/build/compile_swift.sh
+++ b/tools/build/compile_swift.sh
@@ -23,7 +23,7 @@ if [ -z "$1" ] ; then
     exit 1
 fi
 if [ -z "$2" ] ; then
-    echo 'Error: Missing runtime docker image name, for example 
openwhisk/action-swift-v4.0'
+    echo 'Error: Missing kind, for example swift:4.1'
     exit 2
 fi
 OUTPUT_DIR="build"
@@ -65,6 +65,12 @@ fi
 cat $BASE_PATH/epilogue.swift >> $DEST_SOURCE/main.swift
 echo '_run_main(mainFunction:main)' >> $DEST_SOURCE/main.swift
 
+# Only for Swift4
+if [ ${2} != "swift:3.1.1" ]; then
+  echo 'Adding wait to deal with escaping'
+  echo '_ = _whisk_semaphore.wait(timeout: .distantFuture)' >> 
$DEST_SOURCE/main.swift
+fi
+
 echo \"Compiling $1...\"
 cd /$BASE_PATH/spm-build
 cp /owexec/actions/$1/Package.swift $DEST_PACKAGE_SWIFT
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index f65e7e60d7..ee2750db57 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -47,7 +47,7 @@ fi
 cd $ROOTDIR/ansible
 
 ANSIBLE_CMD="ansible-playbook -i environments/local -e 
docker_image_prefix=testing"
-GRADLE_PROJS_SKIP="-x :actionRuntimes:pythonAction:distDocker  -x 
:actionRuntimes:python2Action:distDocker -x 
actionRuntimes:swift3.1.1Action:distDocker -x 
:actionRuntimes:javaAction:distDocker"
+GRADLE_PROJS_SKIP="-x :actionRuntimes:pythonAction:distDocker  -x 
:actionRuntimes:python2Action:distDocker -x 
actionRuntimes:swift3.1.1Action:distDocker -x 
actionRuntimes:swift4.1Action:distDocker -x 
:actionRuntimes:javaAction:distDocker"
 
 $ANSIBLE_CMD setup.yml -e mode=HA
 $ANSIBLE_CMD prereq.yml


 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to