This is an automated email from the ASF dual-hosted git repository.
dgrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk.git
The following commit(s) were added to refs/heads/master by this push:
new eacbe1a remove swift:4.2 (#5160)
eacbe1a is described below
commit eacbe1a3d63539bcc9aa3a6c57cdcabc302b92cd
Author: David Grove <[email protected]>
AuthorDate: Sat Sep 25 11:15:14 2021 -0400
remove swift:4.2 (#5160)
---
ansible/files/runtimes.json | 14 ----
.../src/main/resources/apiv1swagger.json | 1 -
.../core/controller/test/ActionsApiTests.scala | 6 +-
.../openwhisk/core/entity/test/ExecHelpers.scala | 4 +-
.../openwhisk/core/entity/test/SchemaTests.scala | 6 +-
tools/build/compile_swift.sh | 85 ----------------------
6 files changed, 8 insertions(+), 108 deletions(-)
diff --git a/ansible/files/runtimes.json b/ansible/files/runtimes.json
index 36c85b8..f27d916 100644
--- a/ansible/files/runtimes.json
+++ b/ansible/files/runtimes.json
@@ -74,20 +74,6 @@
],
"swift": [
{
- "kind": "swift:4.2",
- "default": false,
- "image": {
- "prefix": "openwhisk",
- "name": "action-swift-v4.2",
- "tag": "nightly"
- },
- "deprecated": false,
- "attached": {
- "attachmentName": "codefile",
- "attachmentType": "text/plain"
- }
- },
- {
"kind": "swift:5.1",
"default": false,
"image": {
diff --git a/core/controller/src/main/resources/apiv1swagger.json
b/core/controller/src/main/resources/apiv1swagger.json
index 162c89c..44954d6 100644
--- a/core/controller/src/main/resources/apiv1swagger.json
+++ b/core/controller/src/main/resources/apiv1swagger.json
@@ -2010,7 +2010,6 @@
"go:1.15",
"go:default",
"sequence",
- "swift:4.2",
"swift:5.1",
"swift:5.3",
"swift:5.4",
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
index cf38dd8..403c015 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/controller/test/ActionsApiTests.scala
@@ -899,7 +899,7 @@ class ActionsApiTests extends ControllerTestCommon with
WhiskActionsApi {
val nodeAction = WhiskAction(namespace, aname(),
jsDefault(nonInlinedCode(entityStore)), Parameters("x", "b"))
val swiftAction = WhiskAction(namespace, aname(),
swift(nonInlinedCode(entityStore)), Parameters("x", "b"))
val bbAction = WhiskAction(namespace, aname(), bb("bb",
nonInlinedCode(entityStore), Some("bbMain")))
- val actions = Seq((javaAction, JAVA_DEFAULT), (nodeAction, NODEJS),
(swiftAction, SWIFT4), (bbAction, BLACKBOX))
+ val actions = Seq((javaAction, JAVA_DEFAULT), (nodeAction, NODEJS),
(swiftAction, SWIFT5), (bbAction, BLACKBOX))
actions.foreach {
case (action, kind) =>
@@ -1076,7 +1076,7 @@ class ActionsApiTests extends ControllerTestCommon with
WhiskActionsApi {
val nodeAction = WhiskAction(namespace, aname(),
jsDefault(nonInlinedCode(entityStore)), Parameters("x", "b"))
val swiftAction = WhiskAction(namespace, aname(),
swift(nonInlinedCode(entityStore)), Parameters("x", "b"))
val bbAction = WhiskAction(namespace, aname(), bb("bb",
nonInlinedCode(entityStore), Some("bbMain")))
- val actions = Seq((nodeAction, NODEJS), (swiftAction, SWIFT4), (bbAction,
BLACKBOX))
+ val actions = Seq((nodeAction, NODEJS), (swiftAction, SWIFT5), (bbAction,
BLACKBOX))
actions.foreach {
case (action, kind) =>
@@ -1183,7 +1183,7 @@ class ActionsApiTests extends ControllerTestCommon with
WhiskActionsApi {
val nodeAction = WhiskAction(namespace, aname(),
jsDefault(nonInlinedCode(entityStore)), Parameters("x", "b"))
val swiftAction = WhiskAction(namespace, aname(),
swift(nonInlinedCode(entityStore)), Parameters("x", "b"))
val bbAction = WhiskAction(namespace, aname(), bb("bb",
nonInlinedCode(entityStore), Some("bbMain")))
- val actions = Seq((nodeAction, NODEJS), (swiftAction, SWIFT4), (bbAction,
BLACKBOX))
+ val actions = Seq((nodeAction, NODEJS), (swiftAction, SWIFT5), (bbAction,
BLACKBOX))
actions.foreach {
case (action, kind) =>
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
index 18f35b3..04ecd2a 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/ExecHelpers.scala
@@ -36,7 +36,7 @@ trait ExecHelpers extends Matchers with WskActorSystem with
StreamLogging {
ExecManifest.initialize(config) should be a 'success
protected val NODEJS = "nodejs:14"
- protected val SWIFT4 = "swift:4.2"
+ protected val SWIFT5 = "swift:5.3"
protected val BLACKBOX = "blackbox"
protected val JAVA_DEFAULT = "java:8"
@@ -101,7 +101,7 @@ trait ExecHelpers extends Matchers with WskActorSystem with
StreamLogging {
protected def swift(code: String, main: Option[String] = None) = {
val attachment = attFmt[String].read(code.trim.toJson)
- val manifest =
ExecManifest.runtimesManifest.resolveDefaultRuntime(SWIFT4).get
+ val manifest =
ExecManifest.runtimesManifest.resolveDefaultRuntime(SWIFT5).get
CodeExecAsAttachment(manifest, attachment, main.map(_.trim),
Exec.isBinaryCode(code))
}
diff --git
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala
index ee5ea2a..3af4bd2 100644
---
a/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala
+++
b/tests/src/test/scala/org/apache/openwhisk/core/entity/test/SchemaTests.scala
@@ -502,8 +502,8 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with
ExecHelpers with Mat
val json = Seq[JsObject](
JsObject("kind" -> "nodejs:14".toJson, "code" -> "js1".toJson, "binary"
-> false.toJson),
JsObject("kind" -> "nodejs:14".toJson, "code" -> "js2".toJson, "binary"
-> false.toJson, "foo" -> "bar".toJson),
- JsObject("kind" -> "swift:4.2".toJson, "code" -> "swift1".toJson,
"binary" -> false.toJson),
- JsObject("kind" -> "swift:4.2".toJson, "code" -> b64Body.toJson,
"binary" -> true.toJson),
+ JsObject("kind" -> "swift:5.3".toJson, "code" -> "swift1".toJson,
"binary" -> false.toJson),
+ JsObject("kind" -> "swift:5.3".toJson, "code" -> b64Body.toJson,
"binary" -> true.toJson),
JsObject("kind" -> "nodejs:14".toJson, "code" -> b64Body.toJson,
"binary" -> true.toJson))
val execs = json.map { e =>
@@ -668,7 +668,7 @@ class SchemaTests extends FlatSpec with BeforeAndAfter with
ExecHelpers with Mat
assert(execs(0) == JsObject("kind" -> "blackbox".toJson, "image" ->
"container".toJson, "binary" -> false.toJson))
assert(execs(1) == JsObject("kind" -> "nodejs:14".toJson, "code" ->
"js".toJson, "binary" -> false.toJson))
assert(execs(2) == JsObject("kind" -> "nodejs:14".toJson, "code" ->
"js".toJson, "binary" -> false.toJson))
- assert(execs(3) == JsObject("kind" -> "swift:4.2".toJson, "code" ->
"swift".toJson, "binary" -> false.toJson))
+ assert(execs(3) == JsObject("kind" -> "swift:5.3".toJson, "code" ->
"swift".toJson, "binary" -> false.toJson))
}
behavior of "Parameter"
diff --git a/tools/build/compile_swift.sh b/tools/build/compile_swift.sh
deleted file mode 100755
index 36edf8d..0000000
--- a/tools/build/compile_swift.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-# 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 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 CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-set -ex
-
-if [ -z "$1" ] ; then
- echo 'Error: Missing action name'
- exit 1
-fi
-if [ -z "$2" ] ; then
- echo 'Error: Missing kind, for example swift:4.1'
- exit 2
-fi
-OUTPUT_DIR="build"
-if [ ${2} == "swift:3.1.1" ]; then
- BASE_PATH="/swift3Action"
- DEST_SOURCE="$BASE_PATH/spm-build"
- RUNTIME="openwhisk/action-swift-v3.1.1"
-elif [ ${2} == "swift:4.1" ]; then
- RUNTIME="openwhisk/action-swift-v4.1"
- BASE_PATH="/swift4Action"
- DEST_SOURCE="/$BASE_PATH/spm-build/Sources/Action"
-else
- echo "Error: Kind $2 not recognize"
- exit 3
-fi
-DEST_PACKAGE_SWIFT="$BASE_PATH/spm-build/Package.swift"
-
-BUILD_FLAGS=""
-if [ -n "$3" ] ; then
- BUILD_FLAGS=${3}
-fi
-
-echo "Using runtime $RUNTIME to compile swift"
-docker run --rm --name=compile-ow-swift -it -v "$(pwd):/owexec" $RUNTIME bash
-ex -c "
-
-if [ -f \"/owexec/$OUTPUT_DIR/$1.zip\" ] ; then
- rm \"/owexec/$OUTPUT_DIR/$1.zip\"
-fi
-
-echo 'Setting up build...'
-cp /owexec/actions/$1/Sources/*.swift $DEST_SOURCE/
-
-# action file can be either {action name}.swift or main.swift
-if [ -f \"$DEST_SOURCE/$1.swift\" ] ; then
- echo 'renaming $DEST_SOURCE/$1.swift $DEST_SOURCE/main.swift'
- mv \"$DEST_SOURCE/$1.swift\" $DEST_SOURCE/main.swift
-fi
-# Add in the OW specific bits
-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
-# we have our own Package.swift, do a full compile
-swift build ${BUILD_FLAGS} -c release
-
-echo 'Creating archive $1.zip...'
-#.build/release/Action
-mkdir -p /owexec/$OUTPUT_DIR
-zip \"/owexec/$OUTPUT_DIR/$1.zip\" .build/release/Action
-
-"