You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2021/07/16 20:41:47 UTC

[openwhisk-runtime-swift] branch dev created (now 6c4f55d)

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

rabbah pushed a change to branch dev
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-swift.git.


      at 6c4f55d  Support remote builds.

This branch includes the following new commits:

     new 6c4f55d  Support remote builds.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[openwhisk-runtime-swift] 01/01: Support remote builds.

Posted by ra...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/openwhisk-runtime-swift.git

commit 6c4f55da49f963215a6e98967ece3b845b81b2bd
Author: Rodric Rabbah <ro...@gmail.com>
AuthorDate: Tue Jul 13 16:44:14 2021 -0400

    Support remote builds.
    
    - Switch to source builds.
    - Install nim in swift runtime for remote builds.
    - Add defaultBuild script for swift.
    - Update travis script.
---
 .travis.yml                     | 26 +++++--------------------
 README.md                       |  2 +-
 core/swift42Action/Dockerfile   | 10 +++++++---
 core/swift42Action/defaultBuild | 43 +++++++++++++++++++++++++++++++++++++++++
 core/swift54Action/Dockerfile   | 13 +++++++++----
 core/swift54Action/defaultBuild | 43 +++++++++++++++++++++++++++++++++++++++++
 6 files changed, 108 insertions(+), 29 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index d3eb103..2e4370a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -22,13 +22,6 @@ language: java
 services:
   - docker
 
-notifications:
-  email: false
-  webhooks:
-    urls:
-      # travis2slack webhook to enable DMs on openwhisk-team.slack.com to PR authors with TravisCI results
-      secure: "hOGkOouus0A5Wf5i+kmJJ5J6kOOQmdkpQUZffp9AnoN1I0qLJ0g7fggtQg4PTgIfHxrFShpZw/nGpyx1qkV9BUCw9Q+A8YgtLbimD0Hw9o7aPBrln7vtUDw9C+Sd39OXb40B172ME8NN4Apcnf1sVwjNUomQ58yvIrnaA2aBQ2mgqmt5KWpyne1I7R0Cr1R1V7nUcC6qsf7qxCQNjDlEKGZaWJp44bcCP8oWwoX93LUxAHgZirA167vmfmiGrp+gSPTQz45JBS5OMcRXl0tuMp6piJOxX+QfigAGTfP1V1kmTCb0k70UCgcTsUxEBYm85A3Cy8cLWOMi08643dZG9wT0Q9uJgAbb5Gr3B5Fs4IoIdrh4ZSbziqVhmyiJ+99D0n0oTALv1o8QgbYU93FrUcMlCQYDqV9s2wF15GmXSTGIoyxhsUrdMnOdKLTf/repyev7DZgVRePJipB6ZwwLh7Tsd1yNk [...]
-
 before_install:
   - "./tools/travis/setup.sh"
 install: true
@@ -36,22 +29,13 @@ script:
   - "./tools/travis/build.sh && ./tools/travis/deploy.sh && ./tools/travis/test.sh"
 deploy:
   - provider: script
-    script: "./tools/travis/publish.sh openwhisk ${TRAVIS_TAG%@*} ${TRAVIS_TAG##*@}"
+    script: "./tools/travis/publish.sh nimbella 5.4 ${TRAVIS_TAG}"
     on:
       tags: true
       all_branches: true
-      repo: apache/openwhisk-runtime-swift
-  - provider: script
-    script: "./tools/travis/publish.sh openwhisk 4.2 nightly"
-    on:
-      branch: master
-      repo: apache/openwhisk-runtime-swift
+      repo: nimbella-corp/openwhisk-runtime-swift
   - provider: script
-    script: "./tools/travis/publish.sh openwhisk 5.1 nightly && ./tools/travis/publish.sh openwhisk 5.3 nightly && ./tools/travis/publish.sh openwhisk 5.4 nightly"
+    script: "./tools/travis/publish.sh nimbella 5.4 nightly"
     on:
-      branch: master
-      repo: apache/openwhisk-runtime-swift
-env:
-  global:
-  - secure: YqQG7kchpqrqYNCBHmoXs5QJFJQmtuy30WYQnQtudVuqZ1/PqsTJXy6+kNxQ88z5NoU4XZKClB61V8ZVHqGsbQd3lAsTy11QKxf+s4kfsGBuoRlow4eQmnUnnaF3E6KVV2nJ4oXro7RQhP3WwLjpsThrMk322B1ZtlSRALR9hK5wCit8Q1ifSJqmKLwuoNSNQzd7onlDF19Q9pyKkgVu9wLKU5epo76wuFkRfkbr1mB3fF2le2WRNXer2N8rL8McHousFPYA03IIdo6zdX27yGmqSW3teCiVYieGrqtaGhH0WCE7dcmoQ/gs7IBqn1K80wJSR1lbkKDiWzmb73FWScKuXmRn5c4HCq/wPya2I5JNUGyPg5YI0HyMDxGTJ/OdXv2Aizyh3hyNMFjtbjK4N6gz6kFAn8Uo6wFs441Bq+S3+ipLAQ41KIQ7E4/Di6ERSG8KKWKy+LlnA5Qy60CQHRIyJCg3+aqf [...]
-  - secure: HbPHrmRk1LOjFE47jUTUKMrmbVF9GXRmAj+V1vaoshrRJAEh8rj58uQwrU7YS6EybyHOHL/26G2PcQt8HrQcqsQdvfwT5QWYxGjxz24nvU6B9PpNlaG6vOW61ls519zsYSSlgb5e1Wr2bjSxpbwDzLzovi2t4L/ZliRcevZYRGJS7846uWSZ3u6De6bwjR5onE2KQ6A5xG4WzyL1gQ/SISFknb1o7l3YpXJe3KZVZztn9y8eCujgSysNSM6hu60TXd8v2lNp3rtof5Xxb6GZ/5W7aZYQUM5o+/q+vdC/gWXgs7UJwOc1Yxi7Q+kiyQLuR69J9XKwvP+/PakySFrUjysZUqMh8um5Mn1y9gQHVwEOXjshwmIWLfoPQ331QIHgzdlrMw9HAckjO5q1C9EU9XddMTSOiFYRGowKuG3Xzf/migIpxhi+GWPxP0dwQt3ERJJ2yY27yvIz7RBDS1zWQ9erek+w0gi9 [...]
+      branch: dev
+      repo: nimbella-corp/openwhisk-runtime-swift
diff --git a/README.md b/README.md
index c1d76c6..61c65dd 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@
 
 # Apache OpenWhisk runtimes for swift
 [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
-[![Build Status](https://travis-ci.com/apache/openwhisk-runtime-swift.svg?branch=master)](https://travis-ci.com/apache/openwhisk-runtime-swift)
+[![Build Status](https://travis-ci.com/nimbella-corp/openwhisk-runtime-swift.svg?branch=master)](https://travis-ci.com/nimbella-corp/openwhisk-runtime-swift)
 
 
 ## Changelogs
diff --git a/core/swift42Action/Dockerfile b/core/swift42Action/Dockerfile
index b434b2c..48904f8 100644
--- a/core/swift42Action/Dockerfile
+++ b/core/swift42Action/Dockerfile
@@ -17,8 +17,8 @@
 
 # build go proxy from source
 FROM golang:1.15 AS builder_source
-ARG GO_PROXY_GITHUB_USER=apache
-ARG GO_PROXY_GITHUB_BRANCH=master
+ARG GO_PROXY_GITHUB_USER=nimbella-corp
+ARG GO_PROXY_GITHUB_BRANCH=dev
 RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
    https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go /src ;\
    cd /src ; env GO111MODULE=on CGO_ENABLED=0 go build main/proxy.go && \
@@ -36,13 +36,16 @@ RUN curl -sL \
 FROM swift:4.2
 
 # select the builder to use
-ARG GO_PROXY_BUILD_FROM=release
+ARG GO_PROXY_BUILD_FROM=source
 
 RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update \
 	&& apt-get install -y --no-install-recommends locales python3 vim \
 	&& rm -rf /var/lib/apt/lists/* \
 	&& locale-gen en_US.UTF-8
 
+# Add nim
+RUN curl https://apigcp.nimbella.io/downloads/nim/nim-install-linux.sh | bash
+
 ENV LANG="en_US.UTF-8" \
 	LANGUAGE="en_US:en" \
 	LC_ALL="en_US.UTF-8"
@@ -56,6 +59,7 @@ COPY --from=builder_release /bin/proxy /bin/proxy_release
 RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
 ADD swiftbuild.py /bin/compile
 ADD swiftbuild.py.launcher.swift /bin/compile.launcher.swift
+ADD defaultBuild /bin/defaultBuild
 COPY _Whisk.swift /swiftAction/Sources/
 COPY Package.swift /swiftAction/
 COPY buildandrecord.py /swiftAction/
diff --git a/core/swift42Action/defaultBuild b/core/swift42Action/defaultBuild
new file mode 100755
index 0000000..3611164
--- /dev/null
+++ b/core/swift42Action/defaultBuild
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Nimbella CONFIDENTIAL
+# ---------------------
+#
+#   2018 - present Nimbella Corp
+#   All Rights Reserved.
+#
+# NOTICE:
+#
+# All information contained herein is, and remains the property of
+# Nimbella Corp and its suppliers, if any.  The intellectual and technical
+# concepts contained herein are proprietary to Nimbella Corp and its
+# suppliers and may be covered by U.S. and Foreign Patents, patents
+# in process, and are protected by trade secret or copyright law.
+#
+# Dissemination of this information or reproduction of this material
+# is strictly forbidden unless prior written permission is obtained
+# from Nimbella Corp.
+#
+
+# This build invokes the default ActionLoop build for swift when run remotely.
+# Note that it works when (1) there is a Package.swift and Sources (the multi-file case)
+# or (2) when there is a single .swift file.  It exits with an error otherwise.
+# It is my impression that this limitation is inherent in /bin/compile for swift.
+if [ -d "Sources" ] && [ -f "Package.swift" ]; then
+  CURRENT="$PWD"
+	pushd /swiftAction
+	$OW_COMPILER main $CURRENT $CURRENT
+	popd
+  else
+	COUNT=$(ls *.swift | wc -w)
+	if [ "$COUNT" != "1" ]; then
+		echo "Conditions for use of the default action are not met"
+		exit 1
+	fi
+	cp *.swift /swiftAction/exec
+	pushd /swiftAction
+	$OW_COMPILER main . .
+	popd
+	cp /swiftAction/exec .
+fi
+echo exec > .include
diff --git a/core/swift54Action/Dockerfile b/core/swift54Action/Dockerfile
index d6156d6..5878cf2 100644
--- a/core/swift54Action/Dockerfile
+++ b/core/swift54Action/Dockerfile
@@ -17,8 +17,8 @@
 
 # build go proxy from source
 FROM golang:1.15 AS builder_source
-ARG GO_PROXY_GITHUB_USER=apache
-ARG GO_PROXY_GITHUB_BRANCH=master
+ARG GO_PROXY_GITHUB_USER=nimbella-corp
+ARG GO_PROXY_GITHUB_BRANCH=dev
 RUN git clone --branch ${GO_PROXY_GITHUB_BRANCH} \
    https://github.com/${GO_PROXY_GITHUB_USER}/openwhisk-runtime-go /src ;\
    cd /src ; env GO111MODULE=on CGO_ENABLED=0 go build main/proxy.go && \
@@ -36,12 +36,16 @@ RUN curl -sL \
 FROM swift:5.4
 
 # select the builder to use
-ARG GO_PROXY_BUILD_FROM=release
+ARG GO_PROXY_BUILD_FROM=source
 
 RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get -qq update \
 	&& apt-get install -y --no-install-recommends locales python3 vim libssl-dev libicu-dev \
 	&& rm -rf /var/lib/apt/lists/* \
-	&& locale-gen en_US.UTF-8
+	&& locale-gen en_US.UTF-8 \
+	&& ln -s /usr/bin/python3 /usr/bin/python
+
+# Add nim
+RUN curl https://apigcp.nimbella.io/downloads/nim/nim-install-linux.sh | bash
 
 ENV LANG="en_US.UTF-8" \
 	LANGUAGE="en_US:en" \
@@ -55,6 +59,7 @@ COPY --from=builder_release /bin/proxy /bin/proxy_release
 RUN mv /bin/proxy_${GO_PROXY_BUILD_FROM} /bin/proxy
 ADD swiftbuild.py /bin/compile
 ADD swiftbuild.py.launcher.swift /bin/compile.launcher.swift
+ADD defaultBuild /bin/defaultBuild
 COPY _Whisk.swift /swiftAction/Sources/
 COPY Package.swift /swiftAction/
 COPY swiftbuildandlink.sh /swiftAction/
diff --git a/core/swift54Action/defaultBuild b/core/swift54Action/defaultBuild
new file mode 100755
index 0000000..3611164
--- /dev/null
+++ b/core/swift54Action/defaultBuild
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# Nimbella CONFIDENTIAL
+# ---------------------
+#
+#   2018 - present Nimbella Corp
+#   All Rights Reserved.
+#
+# NOTICE:
+#
+# All information contained herein is, and remains the property of
+# Nimbella Corp and its suppliers, if any.  The intellectual and technical
+# concepts contained herein are proprietary to Nimbella Corp and its
+# suppliers and may be covered by U.S. and Foreign Patents, patents
+# in process, and are protected by trade secret or copyright law.
+#
+# Dissemination of this information or reproduction of this material
+# is strictly forbidden unless prior written permission is obtained
+# from Nimbella Corp.
+#
+
+# This build invokes the default ActionLoop build for swift when run remotely.
+# Note that it works when (1) there is a Package.swift and Sources (the multi-file case)
+# or (2) when there is a single .swift file.  It exits with an error otherwise.
+# It is my impression that this limitation is inherent in /bin/compile for swift.
+if [ -d "Sources" ] && [ -f "Package.swift" ]; then
+  CURRENT="$PWD"
+	pushd /swiftAction
+	$OW_COMPILER main $CURRENT $CURRENT
+	popd
+  else
+	COUNT=$(ls *.swift | wc -w)
+	if [ "$COUNT" != "1" ]; then
+		echo "Conditions for use of the default action are not met"
+		exit 1
+	fi
+	cp *.swift /swiftAction/exec
+	pushd /swiftAction
+	$OW_COMPILER main . .
+	popd
+	cp /swiftAction/exec .
+fi
+echo exec > .include