vmware-archive / kubeless

Kubernetes Native Serverless Framework
https://kubeless.io
Apache License 2.0
6.86k stars 754 forks source link

Using dotnet runtime with F# #927

Open tamagottschi opened 5 years ago

tamagottschi commented 5 years ago

FEATURE REQUEST:

Is it possible to use the kubeless dotnet runtime with a F# handler and how?

It tried the following library:

hello.fs:

open Kubeless.Functions

type Hello = unit

module Hello =
    let rec handler (k8Event:Event, k8Context:Context) : string =
        "Hello " + k8Event.Data.ToString()

kubelessfs.fsproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Hello.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Kubeless.Functions" Version="0.1.1" />
  </ItemGroup>

</Project>

and deployed it with

kubeless function deploy hellofs --handler Hello.handler --dependencies kubelessfs.fsproj --runtime dotnetcore2.0

->

time="2018-10-21T09:55:40Z" level=info msg="Processing change to Function default/hellofs" pkg=function-controller
time="2018-10-21T09:55:41Z" level=error msg="Function can not be created/updated: Deployment.apps \"hellofs\" is invalid: spec.template.spec.containers[0].image: Required value" pkg=function-controller

or

kubeless function deploy hellofs --handler Hello.handler --dependencies kubelessfs.fsproj --runtime dotnetcore2.0 --from-file Hello.fs

-> The handler will not get ready!!

Environment:

Thanks

andresmgot commented 5 years ago

cc/ @allantargino, bringing you to the conversation. Any comments on this?

allantargino commented 5 years ago

Hi @tamagottschi and @andresmgot, That's absolutely possible and a great request with minimum changes in the code base. I will start working on that!

tamagottschi commented 5 years ago

Thanks 👍 I really like to use it, when you are ready.