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/12/12 11:59:47 UTC

[GitHub] rabbah closed pull request #4: Upgrade to dotnet 2.2

rabbah closed pull request #4: Upgrade to dotnet 2.2
URL: https://github.com/apache/incubator-openwhisk-runtime-dotnet/pull/4
 
 
   

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/.gitignore b/.gitignore
index 6a25af9..527340a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,3 +10,8 @@ tests/out/
 tests/bin/
 .project
 .classpath
+
+obj/
+bin/
+*.zip
+
diff --git a/.travis.yml b/.travis.yml
index f19648f..0e33749 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,8 +17,9 @@
 
 sudo: required
 group: deprecated-2017Q3
-language: csharp
-dotnet: 2.1.300
+language: scala
+scala:
+   - 2.12.7
 services:
 - docker
 notifications:
@@ -40,7 +41,7 @@ deploy:
     all_branches: true
     repo: apache/incubator-openwhisk-runtime-dotnet
 - provider: script
-  script: "./tools/travis/publish.sh openwhisk 2.1 latest"
+  script: "./tools/travis/publish.sh openwhisk 2.2 latest"
   on:
     branch: master
     repo: apache/incubator-openwhisk-runtime-dotnet
diff --git a/README.md b/README.md
index 2d7503e..72f6eda 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,7 @@
 [![Build Status](https://travis-ci.org/apache/incubator-openwhisk-runtime-dotnet.svg?branch=master)](https://travis-ci.org/apache/incubator-openwhisk-runtime-dotnet)
 
 ## Changelogs
-- [.NET Core 2.1 CHANGELOG.md](core/dotnet2.1/CHANGELOG.md)
+- [.NET Core 2.2 CHANGELOG.md](core/dotnet2.2/CHANGELOG.md)
 
 
 ## Quick .NET Core Action
@@ -44,7 +44,7 @@ cd Apache.OpenWhisk.Example.Dotnet
 Install the [Newtonsoft.Json](https://www.newtonsoft.com/json) NuGet package as follows:
 
 ```bash
-dotnet add package Newtonsoft.Json -v 11.0.2
+dotnet add package Newtonsoft.Json -v 12.0.1
 ```
 
 Now create a file called `Hello.cs` with the following content:
@@ -92,7 +92,7 @@ The value for `main` needs to be in the following format:
 ### Create the .NET Core Action
 To use on a deployment of OpenWhisk that contains the runtime as a kind:
 ```bash
-wsk action update helloDotNet helloDotNet.bin --main Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main --kind dotnet:2.1
+wsk action update helloDotNet helloDotNet.bin --main Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main --kind dotnet:2.2
 ```
 
 ### Invoke the .NET Core Action
@@ -110,17 +110,17 @@ wsk action invoke --result helloDotNet --param name World
 
 ## Local development
 ```bash
-./gradlew core:dotnet2.1:distDocker
+./gradlew core:dotnet2.2:distDocker
 ```
-This will produce the image `whisk/action-dotnet-v2.1`
+This will produce the image `whisk/action-dotnet-v2.2`
 
 Build and Push image
 ```bash
 docker login
-./gradlew core:action-dotnet-v2.1:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
+./gradlew core:action-dotnet-v2.2:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
 ```
 
-Deploy OpenWhisk using ansible environment that contains the kind `dotnet:2.1`
+Deploy OpenWhisk using ansible environment that contains the kind `dotnet:2.2`
 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.
@@ -165,12 +165,12 @@ Using IntelliJ:
 #### Using container image to test
 To use as docker action push to your own dockerhub account
 ```bash
-docker tag whisk/action-dotnet-v2.1 $user_prefix/action-dotnet-v2.1
-docker push $user_prefix/action-dotnet-v2.1
+docker tag whisk/action-dotnet-v2.2 $user_prefix/action-dotnet-v2.2
+docker push $user_prefix/action-dotnet-v2.2
 ```
 Then create the action using your the image from dockerhub
 ```bash
-wsk action update helloDotNet helloDotNet.bin --main Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main --docker $user_prefix/action-dotnet-v2.1
+wsk action update helloDotNet helloDotNet.bin --main Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main --docker $user_prefix/action-dotnet-v2.2
 ```
 The `$user_prefix` is usually your dockerhub user id.
 
diff --git a/core/dotnet2.1/CHANGELOG.md b/core/dotnet2.2/CHANGELOG.md
similarity index 91%
rename from core/dotnet2.1/CHANGELOG.md
rename to core/dotnet2.2/CHANGELOG.md
index 9a89851..dc50cac 100644
--- a/core/dotnet2.1/CHANGELOG.md
+++ b/core/dotnet2.2/CHANGELOG.md
@@ -17,9 +17,9 @@
 #
 -->
 
-# .NET Core 2.1 OpenWhisk Runtime Container
+# .NET Core 2.2 OpenWhisk Runtime Container
 
 
-## 1.0.0
+## 1.13 (next Apache release)
 Changes:
 - Initial release
diff --git a/core/dotnet2.1/Dockerfile b/core/dotnet2.2/Dockerfile
similarity index 94%
rename from core/dotnet2.1/Dockerfile
rename to core/dotnet2.2/Dockerfile
index 2026600..21b9816 100644
--- a/core/dotnet2.1/Dockerfile
+++ b/core/dotnet2.2/Dockerfile
@@ -15,7 +15,7 @@
 # limitations under the License.
 #
 
-FROM microsoft/dotnet:2.1-sdk-alpine AS build
+FROM microsoft/dotnet:2.2-sdk-alpine AS build
 
 WORKDIR /app
 COPY proxy/Apache.OpenWhisk.Runtime.Common/*.csproj ./Apache.OpenWhisk.Runtime.Common/
@@ -28,7 +28,7 @@ COPY proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/. ./Apache.OpenWhisk.Runtime.
 WORKDIR /app/Apache.OpenWhisk.Runtime.Dotnet.Minimal
 RUN dotnet publish -c Release -r alpine.3.7-x64 -o out
 
-FROM microsoft/dotnet:2.1-runtime-alpine AS runtime
+FROM microsoft/dotnet:2.2-runtime-alpine AS runtime
 WORKDIR /app
 COPY --from=build /app/Apache.OpenWhisk.Runtime.Dotnet.Minimal/out ./
 ENV ASPNETCORE_URLS http://+:8080
diff --git a/core/dotnet2.1/build.gradle b/core/dotnet2.2/build.gradle
similarity index 95%
rename from core/dotnet2.1/build.gradle
rename to core/dotnet2.2/build.gradle
index 80ed6e1..cc42196 100644
--- a/core/dotnet2.1/build.gradle
+++ b/core/dotnet2.2/build.gradle
@@ -15,6 +15,6 @@
  * limitations under the License.
  */
 
-ext.dockerImageName = 'action-dotnet-v2.1'
+ext.dockerImageName = 'action-dotnet-v2.2'
 
 apply from: '../../gradle/docker.gradle'
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
similarity index 88%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
index 9a36c86..d667e84 100644
--- a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
+++ b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
@@ -17,18 +17,18 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
     <PropertyGroup>
-        <TargetFramework>netcoreapp2.1</TargetFramework>
+        <TargetFramework>netcoreapp2.2</TargetFramework>
     </PropertyGroup>
 
     <ItemGroup>
       <PackageReference Include="Microsoft.AspNetCore">
-        <Version>2.1.3</Version>
+        <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel">
-        <Version>2.1.3</Version>
+        <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>11.0.2</Version>
+        <Version>12.0.1</Version>
       </PackageReference>
     </ItemGroup>
 
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/HttpResponseExtension.cs b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/HttpResponseExtension.cs
similarity index 100%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/HttpResponseExtension.cs
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/HttpResponseExtension.cs
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs
similarity index 100%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Init.cs
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Run.cs b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Run.cs
similarity index 100%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Run.cs
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Run.cs
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs
similarity index 100%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Startup.cs
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj
similarity index 89%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj
index 561c649..ce08efe 100644
--- a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj
+++ b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Apache.OpenWhisk.Runtime.Dotnet.Minimal.csproj
@@ -18,18 +18,18 @@
 
     <PropertyGroup>
         <OutputType>Exe</OutputType>
-        <TargetFramework>netcoreapp2.1</TargetFramework>
+        <TargetFramework>netcoreapp2.2</TargetFramework>
     </PropertyGroup>
 
     <ItemGroup>
       <PackageReference Include="Microsoft.AspNetCore">
-        <Version>2.1.3</Version>
+        <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel">
-        <Version>2.1.3</Version>
+        <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>11.0.2</Version>
+        <Version>12.0.1</Version>
       </PackageReference>
     </ItemGroup>
 
diff --git a/core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Program.cs b/core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Program.cs
similarity index 100%
rename from core/dotnet2.1/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Program.cs
rename to core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Dotnet.Minimal/Program.cs
diff --git a/core/dotnet2.1/proxy/build.gradle b/core/dotnet2.2/proxy/build.gradle
similarity index 94%
rename from core/dotnet2.1/proxy/build.gradle
rename to core/dotnet2.2/proxy/build.gradle
index b40ee14..6a5d94e 100644
--- a/core/dotnet2.1/proxy/build.gradle
+++ b/core/dotnet2.2/proxy/build.gradle
@@ -16,7 +16,7 @@
  */
 
 plugins {
-  id "net.karlmartens.dotnet" version "0.2.18"
+  id "net.karlmartens.dotnet" version "0.2.20"
 }
 
 repositories {
diff --git a/core/dotnet2.1/proxy/gradle/wrapper/gradle-wrapper.jar b/core/dotnet2.2/proxy/gradle/wrapper/gradle-wrapper.jar
similarity index 100%
rename from core/dotnet2.1/proxy/gradle/wrapper/gradle-wrapper.jar
rename to core/dotnet2.2/proxy/gradle/wrapper/gradle-wrapper.jar
diff --git a/core/dotnet2.1/proxy/gradle/wrapper/gradle-wrapper.properties b/core/dotnet2.2/proxy/gradle/wrapper/gradle-wrapper.properties
similarity index 100%
rename from core/dotnet2.1/proxy/gradle/wrapper/gradle-wrapper.properties
rename to core/dotnet2.2/proxy/gradle/wrapper/gradle-wrapper.properties
diff --git a/core/dotnet2.1/proxy/gradlew b/core/dotnet2.2/proxy/gradlew
similarity index 100%
rename from core/dotnet2.1/proxy/gradlew
rename to core/dotnet2.2/proxy/gradlew
diff --git a/core/dotnet2.1/proxy/gradlew.bat b/core/dotnet2.2/proxy/gradlew.bat
similarity index 100%
rename from core/dotnet2.1/proxy/gradlew.bat
rename to core/dotnet2.2/proxy/gradlew.bat
diff --git a/core/dotnet2.1/proxy/openwhisk-runtime-dotnet.sln b/core/dotnet2.2/proxy/openwhisk-runtime-dotnet.sln
similarity index 100%
rename from core/dotnet2.1/proxy/openwhisk-runtime-dotnet.sln
rename to core/dotnet2.2/proxy/openwhisk-runtime-dotnet.sln
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 15c07a0..8b0d452 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,6 +3,6 @@
 
 distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
diff --git a/settings.gradle b/settings.gradle
index 7bce0d7..c7465fe 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -18,8 +18,8 @@
 include ':tests'
 include ':tests:dotnet'
 
-include ':core:dotnet2.1'
-include ':core:dotnet2.1:proxy'
+include ':core:dotnet2.2'
+include ':core:dotnet2.2:proxy'
 
 rootProject.name = 'runtime-dotnet'
 
diff --git a/tests/dotnet/build.gradle b/tests/dotnet/build.gradle
index 6ee5c55..19b2ee5 100644
--- a/tests/dotnet/build.gradle
+++ b/tests/dotnet/build.gradle
@@ -16,7 +16,7 @@
  */
 
 plugins {
-  id "net.karlmartens.dotnet" version "0.2.18"
+  id "net.karlmartens.dotnet" version "0.2.20"
 }
 
 repositories {
diff --git a/tests/src/test/scala/actionContainers/DotNetActionContainerTests.scala b/tests/src/test/scala/actionContainers/DotNetActionContainerTests.scala
index 4a618ea..6dfa575 100644
--- a/tests/src/test/scala/actionContainers/DotNetActionContainerTests.scala
+++ b/tests/src/test/scala/actionContainers/DotNetActionContainerTests.scala
@@ -30,7 +30,7 @@ class DotNetActionContainerTests extends BasicActionRunnerTests with WskActorSys
 
   // Helpers specific to java actions
   override def withActionContainer(env: Map[String, String] = Map.empty)(
-    code: ActionContainer => Unit): (String, String) = withContainer("action-dotnet-v2.1", env)(code)
+    code: ActionContainer => Unit): (String, String) = withContainer("action-dotnet-v2.2", env)(code)
 
   behavior of "dotnet action"
 
diff --git a/tools/travis/build.sh b/tools/travis/build.sh
index 7fd1f4d..6246203 100755
--- a/tools/travis/build.sh
+++ b/tools/travis/build.sh
@@ -31,6 +31,21 @@ export OPENWHISK_HOME=$WHISKDIR
 cd $UTILDIR
 scancode/scanCode.py --config scancode/ASF-Release.cfg $ROOTDIR
 
+# Upgrade docker version
+curl -fsSL https://get.docker.com -o get-docker.sh
+sudo sh get-docker.sh
+docker version
+
+# Upgrade dpkg avoid problems installing dotnet 2.2
+# https://github.com/travis-ci/travis-ci/issues/9361#issuecomment-408431262
+sudo apt-get install -y --force-yes -q -qq dpkg
+# Install dotnet
+wget -q https://packages.microsoft.com/config/ubuntu/14.04/packages-microsoft-prod.deb
+sudo dpkg -i packages-microsoft-prod.deb
+sudo apt-get install -y apt-transport-https
+sudo apt-get -y update -qq
+sudo apt-get install -y dotnet-sdk-2.2
+
 # Build OpenWhisk deps before we run tests
 cd $WHISKDIR
 TERM=dumb ./gradlew install
@@ -38,11 +53,6 @@ TERM=dumb ./gradlew install
 echo "openwhisk.home=$WHISKDIR" > whisk.properties
 echo "vcap.services.file=" >> whisk.properties
 
-# Upgrade docker version
-curl -fsSL https://get.docker.com -o get-docker.sh
-sudo sh get-docker.sh
-docker version
-
 # Build runtime and dependencies
 cd $ROOTDIR
 
diff --git a/tools/travis/publish.sh b/tools/travis/publish.sh
index b230016..397947d 100755
--- a/tools/travis/publish.sh
+++ b/tools/travis/publish.sh
@@ -27,7 +27,7 @@ WHISKDIR="$ROOTDIR/../openwhisk"
 export OPENWHISK_HOME=$WHISKDIR
 
 IMAGE_PREFIX=$1
-RUNTIME_VERSION=$2
+RUNTIME=$2
 IMAGE_TAG=$3
 
 if [[ ! -z ${DOCKER_USER} ]] && [[ ! -z ${DOCKER_PASSWORD} ]]; then
@@ -36,7 +36,7 @@ fi
 
 if [[ ! -z ${RUNTIME} ]]; then
 TERM=dumb ./gradlew \
-:core:${RUNTIME}:distDocker \
+:core:dotnet${RUNTIME}:distDocker \
 -PdockerRegistry=docker.io \
 -PdockerImagePrefix=${IMAGE_PREFIX} \
 -PdockerImageTag=${IMAGE_TAG}
@@ -45,7 +45,7 @@ TERM=dumb ./gradlew \
   if [ ${IMAGE_TAG} == "latest" ]; then
   SHORT_COMMIT=`git rev-parse --short HEAD`
   TERM=dumb ./gradlew \
-  :core:${RUNTIME}:distDocker \
+  :core:dotnet${RUNTIME}:distDocker \
   -PdockerRegistry=docker.io \
   -PdockerImagePrefix=${IMAGE_PREFIX} \
   -PdockerImageTag=${SHORT_COMMIT}
diff --git a/tools/travis/setup.sh b/tools/travis/setup.sh
index 3424cdb..8b8a0e6 100755
--- a/tools/travis/setup.sh
+++ b/tools/travis/setup.sh
@@ -26,9 +26,8 @@ HOMEDIR="$SCRIPTDIR/../../../"
 
 # clone OpenWhisk utilities repo. in order to run scanCode
 cd $HOMEDIR
-git clone https://github.com/apache/incubator-openwhisk-utilities.git
+git clone --depth=1 https://github.com/apache/incubator-openwhisk-utilities.git
 
 # clone main openwhisk repo. for testing purposes
 git clone --depth=1 https://github.com/apache/incubator-openwhisk.git openwhisk
-cd openwhisk
-./tools/travis/setup.sh
+


 

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