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 2021/04/14 15:52:04 UTC

[GitHub] [openwhisk-runtime-dotnet] shawnallen85 opened a new pull request #50: Init json quickstart updates

shawnallen85 opened a new pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50


   Updated Init to decompress incoming binary in memory
   Updated Quick Start to popd appropriately
   Updated Newtonsoft.Json references for the runtimes


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] rabbah commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
rabbah commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r617623111



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -79,17 +115,27 @@ zip -r -0 helloDotNet.zip *
 
 You need to specify the name of the function handler using `--main` argument.
 The value for `main` needs to be in the following format:
-`{Assembly}::{Class Full Name}::{Method}`, e.q.,
-`Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
+`{Assembly}::{Class Full Name}::{Method}`, e.q.:
+
++ Synchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
++ Asynchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::MainAsync`

Review comment:
       Do you want to take a shot at editing the quick start along these lines?
   We do need to show the `async` case for sure, I've worked with enterprise devs who have asked how to write async examples. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] shawnallen85 commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
shawnallen85 commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616803772



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -19,12 +19,20 @@
 
 # Quick .NET Core 2.2 Action
 
-A .NET Core action is a .NET Core class library with a method called `Main` that has the exact signature as follows:
+A .NET Core action is a .NET Core class library with a method called `Main` or `MainAsync` that has the exact signature as follows:

Review comment:
       These are just provided as examples of how you can create it -- it isn't gospel -- the user still has the option of defining the functions full name.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r613426347



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       Right now, because the runtime depends on version 12.0.2 in particular, the instructions for making an action that uses the runtime say that the user must add a dependency to version 12.0.2 in particular of Newtonsoft.Json to their action project. Examples:
   
   https://github.com/apache/openwhisk-runtime-dotnet/blob/master/core/dotnet3.1/QUICKSTART.md
   https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep#prep_dotnet (a particular provider of OpenWhisk as a service)
   Doesn't this mean that for OpenWhisk operators and providers, when they update their version of the 3.1 runtime, they would want their users to be able to continue deploying actions made for previous versions of the 3.1 runtime without having to make changes (that runtime version updates are non-breaking)? If so, we would need to stick to version 12.0.2 of Newtonsoft.Json.
   
   I think the change that @kamyker made to use the built in System.Text.Json instead improves this situation, because there's no 3rd party library for the runtime and actions to need to be in sync with. The earliest version of .NET that System.Text.Json was available in was 3.1 (then known as .NET Core) (https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-5-0), but it wasn't used here for the 3.1 runtime. So, if my understanding of our semver problem is true, then we're stuck with Newtonsoft.Json for the 3.1 runtime, but we could look into using it for the next runtime (6.0 as you state).
   
   I think a better solution btw for the JSON problem is instead if having the actions and runtimes depend on a third party JSON library, create a library managed by OpenWhisk which has a class representing the data that the action's Main method must return. The library could be called the "dotnet6.0 action contract" library etc.
   
   That way, all versions of the runtime and every action ever created for the runtime can depend on the same major version of that library. The runtime would control the implementation of how JSON is handled. It could choose for example between different versions of Newtonsoft.Json or even other JSON libraries like System.Text.Json whenever it wants, with the runtime versions being updated without the action implementers ever having to worry about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] shawnallen85 commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
shawnallen85 commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r614116478



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       @mattwelke Are you fine if I resolve this based on the conversation in https://github.com/apache/openwhisk-runtime-dotnet/issues/34?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r613426347



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       Right now, because the runtime depends on version 12.0.2 in particular, the instructions for making an action that uses the runtime say that the user must add a dependency to version 12.0.2 in particular of Newtonsoft.Json to their action project. Examples:
   
   https://github.com/apache/openwhisk-runtime-dotnet/blob/master/core/dotnet3.1/QUICKSTART.md
   https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep#prep_dotnet (a particular provider of OpenWhisk as a service)
   Doesn't this mean that for OpenWhisk operators and providers, when they update their version of the 3.1 runtime, they would want their users to be able to continue deploying actions made for previous versions of the 3.1 runtime without having to make changes (that runtime version updates are non-breaking)? If so, we would need to stick to version 12.0.2 of Newtonsoft.Json.
   
   I think the change that @kamyker made to use the built in System.Text.Json instead improves this situation, because there's no 3rd party library for the runtime and actions to need to be in sync with. The earliest version of .NET that System.Text.Json was available in was 3.1 (then known as .NET Core) (https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-5-0), but it wasn't used here for the 3.1 runtime. So, if my understanding of our semver problem is true, then we're stuck with Newtonsoft.Json v12.x.x for the 2.2 and 3.1 runtimes, but we could look into using it for the next runtime (6.0 as you state).
   
   I think a better solution btw for the JSON problem is instead if having the actions and runtimes depend on a third party JSON library, create a library managed by OpenWhisk which has a class representing the data that the action's Main method must return. The library could be called the "dotnet6.0 action contract" library etc. Or, since the contract between runtimes and actions is really just an arbitrary map of data (as seen in the Node.js runtime instructions as  https://github.com/apache/openwhisk/blob/master/docs/actions-nodejs.md where they just return `{ done: true }` and `{ message: 'my message' }` etc), no common library would be needed, and you just have the action return a map data structure. C# has `Dictionary` for that (https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2?view=net-5.0).
   
   That way, all versions of the runtime and every action ever created for the runtime can depend on the same major version of that library. The runtime would control the implementation of how JSON is handled. It could choose for example between different versions of Newtonsoft.Json or even other JSON libraries like System.Text.Json whenever it wants, with the runtime versions being updated without the action implementers ever having to worry about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] rabbah commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
rabbah commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616093077



##########
File path: tests/src/test/scala/actionContainers/DotNet3_1ActionContainerTests.scala
##########
@@ -47,10 +47,6 @@ class DotNet3_1ActionContainerTests extends BasicActionRunnerTests with WskActor
     TestConfig(functionb64, main = "Apache.OpenWhisk.Tests.Dotnet::Apache.OpenWhisk.Tests.Dotnet.Environment::Main")
   }
 
-  override val testEnvParameters = {

Review comment:
       why remove this test?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] rabbah commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
rabbah commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616933874



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -79,17 +115,27 @@ zip -r -0 helloDotNet.zip *
 
 You need to specify the name of the function handler using `--main` argument.
 The value for `main` needs to be in the following format:
-`{Assembly}::{Class Full Name}::{Method}`, e.q.,
-`Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
+`{Assembly}::{Class Full Name}::{Method}`, e.q.:
+
++ Synchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
++ Asynchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::MainAsync`

Review comment:
       We could simplify the docs - to show the sync case with `Main` first because i think it's simpler.
   Then describe the async case. The function can be called `Main` in both since the name isn't material.
   I think you're right in that as shown it could lead one to think the name/`Async` suffix is semantically meaningful when it's not.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616847570



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -19,12 +19,20 @@
 
 # Quick .NET Core 2.2 Action
 
-A .NET Core action is a .NET Core class library with a method called `Main` that has the exact signature as follows:
+A .NET Core action is a .NET Core class library with a method called `Main` or `MainAsync` that has the exact signature as follows:

Review comment:
       Because the user has the option to define the function name any way they like, I think the quickstarts should be about getting started as quick as possible with as few decisions to make as possible. Someone new to OpenWhisk is likely to be more interested in getting up and running easily than tweaking a function. They wouldn't even have a function yet.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616276612



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -79,17 +115,27 @@ zip -r -0 helloDotNet.zip *
 
 You need to specify the name of the function handler using `--main` argument.
 The value for `main` needs to be in the following format:
-`{Assembly}::{Class Full Name}::{Method}`, e.q.,
-`Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
+`{Assembly}::{Class Full Name}::{Method}`, e.q.:
+
++ Synchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
++ Asynchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::MainAsync`

Review comment:
       An example of the user having to make a decision where they technically don't need to, adding friction.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] shawnallen85 merged pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
shawnallen85 merged pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616275903



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -19,12 +19,20 @@
 
 # Quick .NET Core 2.2 Action
 
-A .NET Core action is a .NET Core class library with a method called `Main` that has the exact signature as follows:
+A .NET Core action is a .NET Core class library with a method called `Main` or `MainAsync` that has the exact signature as follows:

Review comment:
       Isn't this just a .NET convention, that async methods should end in "Async"? (https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model)
   
   I'd argue that that should be up to the OpenWhisk user. In the end, I imagine the usefulness of this convention is that people writing code and using this function will see right away that it returns `Task` or `Task<T>`. In this case, they're coding a function that the runtime will use, so they don't get any value out of following that convention.
   
   Right now, the runtime detects whether it needs to await the method, and if so, it does. This means the quickstarts are simpler than in these changes because they don't need to worry about following different paths depending on if they're writing an async or sync Main method.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] shawnallen85 commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
shawnallen85 commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616126703



##########
File path: tests/src/test/scala/actionContainers/DotNet3_1ActionContainerTests.scala
##########
@@ -47,10 +47,6 @@ class DotNet3_1ActionContainerTests extends BasicActionRunnerTests with WskActor
     TestConfig(functionb64, main = "Apache.OpenWhisk.Tests.Dotnet::Apache.OpenWhisk.Tests.Dotnet.Environment::Main")
   }
 
-  override val testEnvParameters = {

Review comment:
       Confusion on my part, sorry about that. It's been added back.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616995872



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -79,17 +115,27 @@ zip -r -0 helloDotNet.zip *
 
 You need to specify the name of the function handler using `--main` argument.
 The value for `main` needs to be in the following format:
-`{Assembly}::{Class Full Name}::{Method}`, e.q.,
-`Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
+`{Assembly}::{Class Full Name}::{Method}`, e.q.:
+
++ Synchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
++ Asynchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::MainAsync`

Review comment:
       Glad to hear you agree. After looking again at @shawnallen85 's changs though, I agree there is one spot it's important to show both. That's at the very top where it says "that has the exact signature as follows", because in the async case, the signature is materially different. I think to keep it simple, everywhere after that first part, it should use just `Main` for the function name, and show one example regardless of sync/async, because the user would deploy the sync/async versions (if the main function were named `Main`) the exact same way.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616275903



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -19,12 +19,20 @@
 
 # Quick .NET Core 2.2 Action
 
-A .NET Core action is a .NET Core class library with a method called `Main` that has the exact signature as follows:
+A .NET Core action is a .NET Core class library with a method called `Main` or `MainAsync` that has the exact signature as follows:

Review comment:
       Isn't this just a .NET convention, that async methods should end in "Async"? (https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/async/task-asynchronous-programming-model)
   
   I'd argue that that should be up to the OpenWhisk user. In the end, I imagine the usefulness of this convention is that people writing code and using this function will see right away that it returns `Task` or `Task<T>`. In this case, they're coding a function that the runtime will use, so they don't get any value out of following that convention.
   
   Right now, the runtime detects whether it needs to await the method, and if so, it does. This means the quickstarts before this PR can be used whether the user function is async or sync, and they're simpler that way because the user doesn't need to worry about following different paths depending on if they're writing an async or sync Main method.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r616995872



##########
File path: core/dotnet2.2/QUICKSTART.md
##########
@@ -79,17 +115,27 @@ zip -r -0 helloDotNet.zip *
 
 You need to specify the name of the function handler using `--main` argument.
 The value for `main` needs to be in the following format:
-`{Assembly}::{Class Full Name}::{Method}`, e.q.,
-`Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
+`{Assembly}::{Class Full Name}::{Method}`, e.q.:
+
++ Synchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::Main`
++ Asynchronous: `Apache.OpenWhisk.Example.Dotnet::Apache.OpenWhisk.Example.Dotnet.Hello::MainAsync`

Review comment:
       Glad to hear you agree. After looking again at @shawnallen85 's changes though, I agree there is one spot it's important to show both. That's at the very top where it says "that has the exact signature as follows", because in the async case, the signature is materially different.
   
   I think to keep it simple, we should just use `Main` for the function name everywhere in the quickstart, and everywhere after that first part about the signature, just show one example regardless of sync/async, because the user would deploy the sync/async versions the exact same way with the exact same `wsk` commands.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r613426347



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       Right now, because the runtime depends on version 12.0.2 in particular, the instructions for making an action that uses the runtime say that the user must add a dependency to version 12.0.2 in particular of Newtonsoft.Json to their action project. Examples:
   
   https://github.com/apache/openwhisk-runtime-dotnet/blob/master/core/dotnet3.1/QUICKSTART.md
   https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep#prep_dotnet (a particular provider of OpenWhisk as a service)
   Doesn't this mean that for OpenWhisk operators and providers, when they update their version of the 3.1 runtime, they would want their users to be able to continue deploying actions made for previous versions of the 3.1 runtime without having to make changes (that runtime version updates are non-breaking)? If so, we would need to stick to version 12.0.2 of Newtonsoft.Json.
   
   I think the change that @kamyker made to use the built in System.Text.Json instead improves this situation, because there's no 3rd party library for the runtime and actions to need to be in sync with. The earliest version of .NET that System.Text.Json was available in was 3.1 (then known as .NET Core) (https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-5-0), but it wasn't used here for the 3.1 runtime. So, if my understanding of our semver problem is true, then we're stuck with Newtonsoft.Json v12.x.x for the 2.2 and 3.1 runtimes, but we could look into using it for the next runtime (6.0 as you state).
   
   I think a better solution btw for the JSON problem is instead if having the actions and runtimes depend on a third party JSON library, create a library managed by OpenWhisk which has a class representing the data that the action's Main method must return. The library could be called the "dotnet6.0 action contract" library etc. Or, since the contract between runtimes and actions is really just an arbitrary map of data (as seen in the Node.js runtime instructions as  https://github.com/apache/openwhisk/blob/master/docs/actions-nodejs.md where they just return `{ done: true }` and `{ message: 'my message' }` etc), no common library would be needed, and you just have the action return a map data structure. C# has `Dictionary` for that (https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2?view=net-5.0).
   
   That way, all versions of the runtime and every action ever created for the runtime would not depend on things that need major version updates throughout the lifecycle of a runtime (like dotnet:3.1). The runtime would control the implementation of how JSON is handled. It could choose for example between different versions of Newtonsoft.Json or even other JSON libraries like System.Text.Json whenever it wants, with the runtime versions being updated without the action implementers ever having to worry about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r613426347



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       Right now, because the runtime depends on version 12.0.2 in particular, the instructions for making an action that uses the runtime say that the user must add a dependency to version 12.0.2 in particular of Newtonsoft.Json to their action project. Examples:
   
   https://github.com/apache/openwhisk-runtime-dotnet/blob/master/core/dotnet3.1/QUICKSTART.md
   https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-prep#prep_dotnet (a particular provider of OpenWhisk as a service)
   Doesn't this mean that for OpenWhisk operators and providers, when they update their version of the 3.1 runtime, they would want their users to be able to continue deploying actions made for previous versions of the 3.1 runtime without having to make changes (that runtime version updates are non-breaking)? If so, we would need to stick to version 12.0.2 of Newtonsoft.Json.
   
   I think the change that @kamyker made to use the built in System.Text.Json instead improves this situation, because there's no 3rd party library for the runtime and actions to need to be in sync with. The earliest version of .NET that System.Text.Json was available in was 3.1 (then known as .NET Core) (https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-5-0), but it wasn't used here for the 3.1 runtime. So, if my understanding of our semver problem is true, then we're stuck with Newtonsoft.Json v12.x.x for the 2.2 and 3.1 runtimes, but we could look into using it for the next runtime (6.0 as you state).
   
   I think a better solution btw for the JSON problem is instead if having the actions and runtimes depend on a third party JSON library, create a library managed by OpenWhisk which has a class representing the data that the action's Main method must return. The library could be called the "dotnet6.0 action contract" library etc.
   
   That way, all versions of the runtime and every action ever created for the runtime can depend on the same major version of that library. The runtime would control the implementation of how JSON is handled. It could choose for example between different versions of Newtonsoft.Json or even other JSON libraries like System.Text.Json whenever it wants, with the runtime versions being updated without the action implementers ever having to worry about it.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] rabbah commented on pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
rabbah commented on pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#issuecomment-820584236


   Thanks for engaging @mattwelke 🎉 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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



[GitHub] [openwhisk-runtime-dotnet] mattwelke commented on a change in pull request #50: Init json quickstart updates

Posted by GitBox <gi...@apache.org>.
mattwelke commented on a change in pull request #50:
URL: https://github.com/apache/openwhisk-runtime-dotnet/pull/50#discussion_r614186648



##########
File path: core/dotnet2.2/proxy/Apache.OpenWhisk.Runtime.Common/Apache.OpenWhisk.Runtime.Common.csproj
##########
@@ -28,7 +28,7 @@
         <Version>2.2.0</Version>
       </PackageReference>
       <PackageReference Include="Newtonsoft.Json">
-        <Version>12.0.2</Version>
+        <Version>13.0.1</Version>

Review comment:
       Yup!




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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