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

Blake Jackson

12/11/2023, 3:26 PM
Hey all 👋 . We have existing java services that process Kafka events. We would like these events to trigger workflows in Flyte. Is this possible with flytekit-java or is there some other recommended way of doing this?
k

Ketan (kumare3)

12/11/2023, 4:24 PM
Flyte has endpoints to do this
The core service is golang - Grpc
So you can use any language clients
Cc @honnix / @Sonja Ericsson do you folks have guidance on using Java client
b

Blake Jackson

12/11/2023, 4:32 PM
Yea, looking through the code, there's a
FlyteAdminClient
that's part of the
jflyte-utils
, but I've not seen anything more official discussed
k

Ketan (kumare3)

12/12/2023, 5:46 AM
@Blake Jackson you can use the buf generated client itself
h

honnix

12/12/2023, 9:47 AM
I would suggest generating stub from proto and calling flyteadmin gRPC endpoints. It's likely too much if you use flytekit-java because it is a full blown Flyte sdk.
https://docs.flyte.org/projects/flyteidl/en/latest/protos/docs/service/service.html is the API ref. I guess it is the
CreateExecution
that you are interested in.
@Ketan (kumare3) I would really love if gh:flyteorg/flyte could publish Java artifact to maven central, with both proto and rpc stubs. 😄
b

Blake Jackson

12/12/2023, 1:45 PM
Thanks for the response. I'll generate the stubs from
flyteidl-protos
dep.
Is there anything around auth w/ flyte admin that can be shared for java impl? Or should I just look at the go code and work from there?
h

honnix

12/12/2023, 2:03 PM
I think go code is the best place to check for the oauth flow.
k

Ketan (kumare3)

12/12/2023, 3:18 PM
@honnix can you help
h

honnix

12/12/2023, 3:23 PM
@Ketan (kumare3) What do you refer to? The auth flow? Internally we don't use the standard flyteadmin auth flow directly, but with our own gateway in front to be able to use GCP auth flow. Between the gateway and flyteadmin, we use the static client_secret setup. The flytekit-java implementation unfortunately takes that assumption which is not very proper as part of open source, to be fair.
So, tl;dr is, there is not much to learn from flytekit-java in terms of auth.
k

Ketan (kumare3)

12/12/2023, 3:25 PM
Cc @Haytham Abuelfutuh why is implementing oauth2 annoying for every client
b

Blake Jackson

12/12/2023, 3:27 PM
For me, I'm not apposed to implementing oAuth, but it's just non-differentiating work that will take up some time. I was hoping for a packaged up client w/ all the auth built in(refreshing token, etc.)
h

honnix

12/12/2023, 3:28 PM
To be clear, I didn't mean it was annoying for us because we had to hook into GCP anyway and that was the reason we had to set up our own gateway.
k

Ketan (kumare3)

12/12/2023, 3:28 PM
Isn’t this sad when you use a standard
h

honnix

12/12/2023, 3:28 PM
I believe there should be standard oauth lib in Java.
k

Ketan (kumare3)

12/12/2023, 3:28 PM
I know @honnix , this just reflection of how hard security makes the life of developers
h

honnix

12/12/2023, 3:29 PM
Yeah, that I fully agree. 😄
k

Ketan (kumare3)

12/12/2023, 3:30 PM
b

Blake Jackson

12/12/2023, 3:31 PM
I'll be doing this with a gRPC interceptor, but yea
3 Views