-
Notifications
You must be signed in to change notification settings - Fork 540
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/python inline task #275
Feature/python inline task #275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I would suggest take a look at the GraalVM implementation that is supposed to offer better performance overall.
https://www.graalvm.org/python/
It will also be useful to add support have pre-defined set of libraries added to the engine, which will allow working with 3P libraries that are statically defined and can be added at runtime.
core/build.gradle
Outdated
@@ -43,6 +43,9 @@ dependencies { | |||
|
|||
implementation "org.openjdk.nashorn:nashorn-core:15.4" | |||
|
|||
//jython dependency | |||
implementation "org.python:jython-standalone:2.7.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using something like https://www.graalvm.org/python/
@v1r3n |
Hi, |
Sorry for jumping in but I'd like to ask that one think that I'm missing is the possibility that expression may be an array of strings where each array element represents a line of the expression. This would make writing the expression in JSON documents much much easier and more maintainable than using \n. Applies in general to INLINE Tasks... |
I am going to merge this for now @dcore94 I think the suggestion to support multiple lines is a good one. I also wonder if there is a way to also reference external files etc. @inv-ajin I suggest if you can followup with a PR to add additional modules (could be part of the build process or env variables etc at the startup) that will really improve the usability. |
// Convert the result to a Java object and return it | ||
return result.as(Object.class); | ||
} else { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a usecase where an expression is useful for the workflow, and can be formed without inputs from the InlineTask?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, uuid generation for example
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApply
to fix any format violations.Changes in this PR
This PR implements support for Python as a scripting language for inline tasks in Netflix Conductor, based on the roadmap outlined here.
The feature extends Conductor's usability by enabling lightweight Python code execution as inline tasks.
The Python environment used for executing scripts is Jython.
Key changes include:
Issue #
Alternatives considered
One alternative approach is to use GraalVM's Python engine instead of Jython, which could offer improved performance and compatibility.
Describe alternative implementation you have considered