Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: JobSink Integration / Long Running Functions #2586

Open
philipbjorge opened this issue Nov 21, 2024 · 3 comments
Open

feature request: JobSink Integration / Long Running Functions #2586

philipbjorge opened this issue Nov 21, 2024 · 3 comments

Comments

@philipbjorge
Copy link

philipbjorge commented Nov 21, 2024

Usecase

We are evaluating using KNative in our organization and one of our usecases are long-running event handlers -- Think 5-120 minutes. We would like to use KNative Functions but from reading the documentations we believe we would run into trouble with such usecases.

JobSink

We saw the JobSink capability in the Event system, but it does not appear to cleanly integrate with the knative functions concept.

(We would have to produce our own docker images and surrounding runtime to forward in the mounted event to our handler.)

Dev Notes

I reached out to @pierDipi who implemented the JobSink and they had the following to share:

I think we have a few options, what I'm leaning towards is:

  • JobSink injects an env variable like KNATIVE_EXECUTION_MODE: batch
  • when KNATIVE_EXECUTION_MODE: batch various func runtimes would read the event from the file and pass it to the handler
  • If the function returns a new event it would be produced to an endpoint that is pointed by K_SINK env variable (so that you can use JobSink in combination with SinkBinding to have "job callbacks")

https://cloud-native.slack.com/archives/C04LGHDR9K7/p1732225883467409?thread_ts=1732216204.039569&channel=C04LGHDR9K7&message_ts=1732225883.467409

I'm very new to this platform, but the above should work well for our usecase and seems to fit well with the existing platform conventions.

pierDipi added a commit to pierDipi/eventing that referenced this issue Nov 25, 2024
To support long running functions in Knative Functions, we will
inject a `KNATIVE_EXECUTION_MODE` environment variable with value
`batch` so that function can change it's runtime behavior to
read the event file rather than starting a long-running server.

Ref: knative/func#2586

Signed-off-by: Pierangelo Di Pilato <[email protected]>
pierDipi added a commit to pierDipi/eventing that referenced this issue Nov 25, 2024
To support long running functions in Knative Functions, we will
inject a `KNATIVE_EXECUTION_MODE` environment variable with value
`batch` so that function can change it's runtime behavior to
read the event file rather than starting a long-running server.

Ref: knative/func#2586

Signed-off-by: Pierangelo Di Pilato <[email protected]>
pierDipi added a commit to pierDipi/eventing that referenced this issue Nov 25, 2024
To support long running functions in Knative Functions, we will
inject a `KNATIVE_EXECUTION_MODE` environment variable with value
`batch` so that function can change it's runtime behavior to
read the event file rather than starting a long-running server.

Ref: knative/func#2586

Signed-off-by: Pierangelo Di Pilato <[email protected]>
pierDipi added a commit to pierDipi/eventing that referenced this issue Nov 25, 2024
To support long running functions in Knative Functions, we will
inject a `KNATIVE_EXECUTION_MODE` environment variable with value
`batch` so that function can change it's runtime behavior to
read the event file rather than starting a long-running server.

Ref: knative/func#2586

Signed-off-by: Pierangelo Di Pilato <[email protected]>
knative-prow bot pushed a commit to knative/eventing that referenced this issue Nov 26, 2024
…value `batch` (#8346)

JobSink: Inject execution mode as env variable

To support long running functions in Knative Functions, we will
inject a `KNATIVE_EXECUTION_MODE` environment variable with value
`batch` so that function can change it's runtime behavior to
read the event file rather than starting a long-running server.

Ref: knative/func#2586

Signed-off-by: Pierangelo Di Pilato <[email protected]>
@matejvasek
Copy link
Contributor

@pierDipi @lkingland Do we need to do integration in each language/runtime? Couldn't we just include some sidecar that would do the translation?

@matejvasek
Copy link
Contributor

@pierDipi @lkingland @matzew WDYT ^^^ ?

@lkingland
Copy link
Member

That might work. I'd love to hear your thoughts on how this would work. Would you mind writing it up, or we can discuss the solution on the next functions meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants