You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ja...@apache.org on 2018/02/14 14:48:43 UTC
[incubator-openwhisk-runtime-swift] branch master updated: rename
swift4 o swift40 for kind and image (#20)
This is an automated email from the ASF dual-hosted git repository.
jamesthomas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-runtime-swift.git
The following commit(s) were added to refs/heads/master by this push:
new e9b22b8 rename swift4 o swift40 for kind and image (#20)
e9b22b8 is described below
commit e9b22b85123c48ab06175f25ecd56a904568525a
Author: Carlos Santana <cs...@gmail.com>
AuthorDate: Wed Feb 14 09:48:41 2018 -0500
rename swift4 o swift40 for kind and image (#20)
---
README.md | 18 +++++++++---------
ansible/environments/local/group_vars/all | 4 ++--
core/{swift4Action => swift40Action}/CHANGELOG.md | 0
core/{swift4Action => swift40Action}/Dockerfile | 0
core/swift40Action/build.gradle | 2 ++
.../{swift4Action => swift40Action}/buildandrecord.py | 0
core/{swift4Action => swift40Action}/epilogue.swift | 0
.../spm-build/Package.swift | 0
.../spm-build/_Whisk.swift | 0
core/{swift4Action => swift40Action}/swift4runner.py | 0
core/swift4Action/build.gradle | 2 --
settings.gradle | 2 +-
tests/dat/build.sh | 4 ++--
tests/dat/build/{swift4 => swift4.0}/HelloSwift4.zip | Bin
.../dat/build/{swift4 => swift4.0}/SwiftyRequest.zip | Bin
...rTests.scala => Swift40ActionContainerTests.scala} | 8 ++++----
.../actionContainers/SwiftActionContainerTests.scala | 2 +-
.../{Swift4SDKTests.scala => Swift40SDKTests.scala} | 4 ++--
tools/build/compile.sh | 8 ++++----
tools/travis/build.sh | 2 +-
tools/travis/publish.sh | 2 +-
21 files changed, 29 insertions(+), 29 deletions(-)
diff --git a/README.md b/README.md
index 1ce1104..06cb22f 100644
--- a/README.md
+++ b/README.md
@@ -23,7 +23,7 @@ To avoid the cold-start delay, you can compile your Swift file into a binary and
- Run an interactive Swift action container.
```
- docker run --rm -it -v "$(pwd):/owexec" openwhisk/action-swift-v4 bash
+ docker run --rm -it -v "$(pwd):/owexec" openwhisk/action-swift-v4.0 bash
```
This puts you in a bash shell within the Docker container.
@@ -68,7 +68,7 @@ let package = Package(
```
As you can see this example adds `SwiftyRequest` dependencies.
- Notice that now with swift:4 is no longer required to include `CCurl`, `Kitura-net` and `SwiftyJSON` in your own `Package.swift`.
+ Notice that now with swift:4.0 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.
- Copy Package.swift to spm-build directory
@@ -100,7 +100,7 @@ let package = Package(
- Upload it to OpenWhisk with the action name helloSwifty:
```
- wsk action update helloSwiftly hello.zip openwhisk/action-swift-v4
+ wsk action update helloSwiftly hello.zip openwhisk/action-swift-v4.0
```
- To check how much faster it is, run
@@ -125,29 +125,29 @@ Having a project directory `Hello` under a directory `actions` like the followin
actions/Hello/Package.swift
actions/Hello/Sources/main.swift
```
-Change to the parent directory then run the compile script specify the project directory, the kind `swift:3.1.1` or `swift:4` and any swiftc build flags like the following:
+Change to the parent directory then run the compile script specify the project directory, the kind `swift:3.1.1` or `swift:4.0` and any swiftc build flags like the following:
```
cd actions/
-incubator-runtime-swift/tools/build/compile.sh Hello swift:4 -v
+incubator-runtime-swift/tools/build/compile.sh Hello swift:4.0 -v
```
This will produce a zip `build/swift4/Hello.zip`
### SwiftyJSON using single source action file
-If you have a swift:3.1.1 action not compile, just as source using the `SwiftyJSON` package, you need to precompile your action and specify the version of SwiftyJSON you wan to use for swift:4 kind action.
+If you have a swift:3.1.1 action not compile, just as source using the `SwiftyJSON` package, you need to precompile your action and specify the version of SwiftyJSON you wan to use for swift:4.0 kind action.
Take into account that tarting with Swift 4 there is better support to manage JSON data natively.
Note: This is only applicable to the base image provided for the Swift 4 runtime, other downstream such as IBM Cloud Functions extending this image might provide additional SDK and packages including `SwiftyJSON` and IBM Watson SDK, check the vendor documentation for more specific information about packages and versions.
### Building the Swift4 Image
```
-./gradlew core:swift4Action:distDocker
+./gradlew core:swift40Action:distDocker
```
-This will produce the image `whisk/action-swift-v4`
+This will produce the image `whisk/action-swift-v4.0`
Build and Push image
```
docker login
-./gradlew core:swift4Action:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
+./gradlew core:swift40Action:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
```
diff --git a/ansible/environments/local/group_vars/all b/ansible/environments/local/group_vars/all
index 1ba2818..66e70f7 100755
--- a/ansible/environments/local/group_vars/all
+++ b/ansible/environments/local/group_vars/all
@@ -44,10 +44,10 @@ runtimes_manifest:
image:
name: "action-swift-v3.1.1"
deprecated: false
- - kind: "swift:4"
+ - kind: "swift:4.0"
default: true
image:
- name: "action-swift-v4"
+ name: "action-swift-v4.0"
deprecated: false
blackboxes:
- name: "dockerskeleton"
diff --git a/core/swift4Action/CHANGELOG.md b/core/swift40Action/CHANGELOG.md
similarity index 100%
rename from core/swift4Action/CHANGELOG.md
rename to core/swift40Action/CHANGELOG.md
diff --git a/core/swift4Action/Dockerfile b/core/swift40Action/Dockerfile
similarity index 100%
rename from core/swift4Action/Dockerfile
rename to core/swift40Action/Dockerfile
diff --git a/core/swift40Action/build.gradle b/core/swift40Action/build.gradle
new file mode 100755
index 0000000..fcde7c2
--- /dev/null
+++ b/core/swift40Action/build.gradle
@@ -0,0 +1,2 @@
+ext.dockerImageName = 'action-swift-v4.0'
+apply from: '../../gradle/docker.gradle'
diff --git a/core/swift4Action/buildandrecord.py b/core/swift40Action/buildandrecord.py
similarity index 100%
rename from core/swift4Action/buildandrecord.py
rename to core/swift40Action/buildandrecord.py
diff --git a/core/swift4Action/epilogue.swift b/core/swift40Action/epilogue.swift
similarity index 100%
rename from core/swift4Action/epilogue.swift
rename to core/swift40Action/epilogue.swift
diff --git a/core/swift4Action/spm-build/Package.swift b/core/swift40Action/spm-build/Package.swift
similarity index 100%
rename from core/swift4Action/spm-build/Package.swift
rename to core/swift40Action/spm-build/Package.swift
diff --git a/core/swift4Action/spm-build/_Whisk.swift b/core/swift40Action/spm-build/_Whisk.swift
similarity index 100%
rename from core/swift4Action/spm-build/_Whisk.swift
rename to core/swift40Action/spm-build/_Whisk.swift
diff --git a/core/swift4Action/swift4runner.py b/core/swift40Action/swift4runner.py
similarity index 100%
rename from core/swift4Action/swift4runner.py
rename to core/swift40Action/swift4runner.py
diff --git a/core/swift4Action/build.gradle b/core/swift4Action/build.gradle
deleted file mode 100755
index d4357c5..0000000
--- a/core/swift4Action/build.gradle
+++ /dev/null
@@ -1,2 +0,0 @@
-ext.dockerImageName = 'action-swift-v4'
-apply from: '../../gradle/docker.gradle'
diff --git a/settings.gradle b/settings.gradle
index 2b5078a..ef62d3b 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -10,7 +10,7 @@ include 'tests'
include 'core:swift3.1.1Action'
-include 'core:swift4Action'
+include 'core:swift40Action'
rootProject.name = 'runtime-swift'
diff --git a/tests/dat/build.sh b/tests/dat/build.sh
index e52dd67..9abee43 100755
--- a/tests/dat/build.sh
+++ b/tests/dat/build.sh
@@ -2,5 +2,5 @@
set -e
../../tools/build/compile.sh HelloSwift3 swift:3.1.1 "-v"
-../../tools/build/compile.sh HelloSwift4 swift:4 "-v"
-../../tools/build/compile.sh SwiftyRequest swift:4 "-v"
+../../tools/build/compile.sh HelloSwift4 swift:4.0 "-v"
+../../tools/build/compile.sh SwiftyRequest swift:4.0 "-v"
diff --git a/tests/dat/build/swift4/HelloSwift4.zip b/tests/dat/build/swift4.0/HelloSwift4.zip
similarity index 100%
rename from tests/dat/build/swift4/HelloSwift4.zip
rename to tests/dat/build/swift4.0/HelloSwift4.zip
diff --git a/tests/dat/build/swift4/SwiftyRequest.zip b/tests/dat/build/swift4.0/SwiftyRequest.zip
similarity index 100%
rename from tests/dat/build/swift4/SwiftyRequest.zip
rename to tests/dat/build/swift4.0/SwiftyRequest.zip
diff --git a/tests/src/test/scala/actionContainers/Swift4ActionContainerTests.scala b/tests/src/test/scala/actionContainers/Swift40ActionContainerTests.scala
similarity index 95%
rename from tests/src/test/scala/actionContainers/Swift4ActionContainerTests.scala
rename to tests/src/test/scala/actionContainers/Swift40ActionContainerTests.scala
index ada14ee..586b912 100644
--- a/tests/src/test/scala/actionContainers/Swift4ActionContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/Swift40ActionContainerTests.scala
@@ -23,11 +23,11 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
import spray.json.{JsObject, JsString}
@RunWith(classOf[JUnitRunner])
-class Swift4ActionContainerTests extends SwiftActionContainerTests {
+class Swift40ActionContainerTests extends SwiftActionContainerTests {
- override lazy val swiftContainerImageName = "action-swift-v4"
- override lazy val swiftBinaryName = System.getProperty("user.dir") + "/dat/build/swift4/HelloSwift4.zip"
- val partyCompile = System.getProperty("user.dir") + "/dat/build/swift4/SwiftyRequest.zip"
+ override lazy val swiftContainerImageName = "action-swift-v4.0"
+ override lazy val swiftBinaryName = System.getProperty("user.dir") + "/dat/build/swift4.0/HelloSwift4.zip"
+ val partyCompile = System.getProperty("user.dir") + "/dat/build/swift4.0/SwiftyRequest.zip"
val httpCode = """
| import Dispatch
diff --git a/tests/src/test/scala/actionContainers/SwiftActionContainerTests.scala b/tests/src/test/scala/actionContainers/SwiftActionContainerTests.scala
index f1b8752..aa3af7a 100644
--- a/tests/src/test/scala/actionContainers/SwiftActionContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/SwiftActionContainerTests.scala
@@ -28,7 +28,7 @@ abstract class SwiftActionContainerTests extends BasicActionRunnerTests with Wsk
// note: "out" will likely not be empty in some swift build as the compiler
// prints status messages and there doesn't seem to be a way to quiet them
val enforceEmptyOutputStream = false
- lazy val swiftContainerImageName = "action-swift-v4"
+ lazy val swiftContainerImageName = "action-swift-v4.0"
lazy val swiftBinaryName = System.getProperty("user.dir") + "/dat/actions/swift4zip/build/Hello.zip"
val httpCode: String
diff --git a/tests/src/test/scala/sdk/Swift4SDKTests.scala b/tests/src/test/scala/sdk/Swift40SDKTests.scala
similarity index 91%
rename from tests/src/test/scala/sdk/Swift4SDKTests.scala
rename to tests/src/test/scala/sdk/Swift40SDKTests.scala
index fe9a6ea..319a622 100644
--- a/tests/src/test/scala/sdk/Swift4SDKTests.scala
+++ b/tests/src/test/scala/sdk/Swift40SDKTests.scala
@@ -21,6 +21,6 @@ import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
@RunWith(classOf[JUnitRunner])
-class Swift4SDKTests extends SwiftSDKTests {
- override lazy val actionKind = "swift:4"
+class Swift40SDKTests extends SwiftSDKTests {
+ override lazy val actionKind = "swift:4.0"
}
diff --git a/tools/build/compile.sh b/tools/build/compile.sh
index 716511d..c75646e 100755
--- a/tools/build/compile.sh
+++ b/tools/build/compile.sh
@@ -6,7 +6,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'
+ echo 'Error: Missing runtime docker image name, for example openwhisk/action-swift-v4.0'
exit 2
fi
@@ -15,11 +15,11 @@ DEST_SOURCE="$BASE_PATH/spm-build"
RUNTIME="openwhisk/action-swift-v3.1.1"
if [ ${2} == "swift:3.1.1" ]; then
OUTPUT_DIR="build/swift311"
-elif [ ${2} == "swift:4" ]; then
- RUNTIME="action-swift-v4"
+elif [ ${2} == "swift:4.0" ]; then
+ RUNTIME="action-swift-v4.0"
BASE_PATH="/swift4Action"
DEST_SOURCE="/$BASE_PATH/spm-build/Sources/Action"
- OUTPUT_DIR="build/swift4"
+ OUTPUT_DIR="build/swift4.0"
else
echo "Error: Kind $2 not recognize"
exit 3
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 3a20575..409ea99 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -15,7 +15,7 @@ IMAGE_PREFIX="testing"
cd $ROOTDIR
TERM=dumb ./gradlew \
:core:swift3.1.1Action:distDocker \
-:core:swift4Action:distDocker \
+:core:swift40Action:distDocker \
-PdockerImagePrefix=${IMAGE_PREFIX}
diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh
index 64ebcb9..0cac35c 100755
--- a/tools/travis/publish.sh
+++ b/tools/travis/publish.sh
@@ -16,7 +16,7 @@ IMAGE_TAG=$3
if [ ${RUNTIME_VERSION} == "3.1.1" ]; then
RUNTIME="swift3.1.1Action"
elif [ ${RUNTIME_VERSION} == "4" ]; then
- RUNTIME="swift4Action"
+ RUNTIME="swift40Action"
fi
if [[ ! -z ${DOCKER_USER} ]] && [[ ! -z ${DOCKER_PASSWORD} ]]; then
--
To stop receiving notification emails like this one, please contact
jamesthomas@apache.org.