https://flyte.org logo
#ask-the-community
Title
# ask-the-community
j

Jimmy Du

02/24/2023, 11:16 PM
Hi Flyte Community, is JFlyte compatible with spring boot applications?
k

Ketan (kumare3)

02/25/2023, 5:17 AM
Cc @Guillaume Perchais / @Nelson Arapé / @honnix / @Sonja Ericsson
h

honnix

02/27/2023, 8:05 AM
Unless there is some dependency conflict, it is an ordinary Java library not bound to any framework. So most likely it is compatible.
j

Jimmy Du

03/02/2023, 9:45 PM
JFlyte takes in JARs and uses the Java Service Loader, which expects files such as the following to exist: •
META-INF/services/org.flyte.flytekit.SdkWorkflow
META-INF/services/org.flyte.flytekit.SdkRunnableTask
Spring boot applications typically generate jars that store these files under a BOOT-INF directory: •
BOOT-INF/classes/META-INF/services/org.flyte.flytekit.SdkWorkflow
BOOT-INF/classes/META-INF/services/org.flyte.flytekit.SdkRunnableTask
I'm concerned that attempting to manually jar the files differently might break the Spring application setup. Would the suggested workaround be to update the JFlyte code to look within the
BOOT-INF/classes
path instead of the root JAR path?
h

honnix

03/03/2023, 9:10 AM
I unfortunately don't think that is a reasonable ask because it is spring-boot specific, and an ordinary service loader (https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html) will not be able to read files under that location. I'm not a spring-boot user so I don't know whether that is really a hard requirement.
j

Jimmy Du

03/03/2023, 7:46 PM
If JFlyte is not compatible with Spring boot applications, would the suggested workaround be to create a raw Docker image with an entrypoint to the spring boot application itself (https://docs.flyte.org/projects/cookbook/en/latest/auto/core/containerization/raw_container.html)? Does JFlyte support defining raw container tasks (or would I need to define these in python)? Are there potential performance concerns with this approach?
k

Ketan (kumare3)

03/04/2023, 4:33 PM
Raw containers cannot today support streaming data and very fast exits may take longer as it depends on watching processes
j

Jimmy Du

03/06/2023, 6:46 PM
Hi Ketan, thank you for calling this out. What are fast exits (and is there some way to workaround the issue of slower exits)? How does JFlyte optimize this performance?
k

Ketan (kumare3)

03/07/2023, 2:02 AM
Like if the container starts and exits immediately it may be possible that the copilot container misses this process
Are you seeing any problems
j

Jimmy Du

03/07/2023, 2:25 AM
Hi Ketan, I'm still working on mapping the task to configmaps in the namespace but will let you know if I see any issues. Is there something that we can do to avoid the edge case you've mentioned?
k

Ketan (kumare3)

03/07/2023, 2:26 AM
Ohh it won’t be a bug, it will eventually exit 30sec delay in the worst case
But I do feel This should Almost never happen as copilot starts much faster
j

Jimmy Du

03/07/2023, 2:27 AM
Got it, thanks for clarifying!
69 Views