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

Andy Czerwonka

03/18/2024, 2:42 PM
As an triage adoption spike today, I'm going to attempt to recreate the "Hello World" task and workflow demo via a Scala client that I'll generate against the gRPC interfaces? I'm wondering how much of the Flyte IDL do I need in order to do that? Do I need more that core? e.g. core & service? Do I need
admin
?
@Blake Jackson I don't recall if we covered this in our chat on Friday... do you know which parts I would start with simply to reproduce the demo?
b

Blake Jackson

03/18/2024, 2:52 PM
The demo link is the flyteidl link. Can you update that link?
a

Andy Czerwonka

03/18/2024, 2:53 PM
oops... fixed
Specifically, I have two success criteria: 1. Write the task and workflow in Scala 2. Trigger the workflow from code, not using the
pyflye
CLI
and am using core, admin and service
a

Andy Czerwonka

03/18/2024, 3:01 PM
By
started here
, that's what you used to know what parts to get, but you generated your own client, yes?
b

Blake Jackson

03/18/2024, 3:01 PM
yes
you can see in flyte-java, they chose to write AutoValue classes that represent the core objects, but I chose to get them from the proto
a

Andy Czerwonka

03/18/2024, 3:04 PM
I assume you chose that route because you get the full type vs just an ID?
b

Blake Jackson

03/18/2024, 3:08 PM
I wanted the latest version of the proto to go with the latest version of the API
a

Andy Czerwonka

03/18/2024, 3:12 PM
I'm assuming that's a pretty stable API
b

Blake Jackson

03/18/2024, 3:15 PM
yes, it's the same API they use for flytekit
a

Andy Czerwonka

03/18/2024, 3:24 PM
How does Flyte take care of the encoding of passing data to a task? and then decoding results?
b

Blake Jackson

03/18/2024, 3:45 PM
What kind of data do you mean?
a

Andy Czerwonka

03/18/2024, 3:50 PM
In the demo, it's a simple string that's passed in, but in general, it could be any complex data structure... e.g. could be a trained model and the task is to generate candidates
E.g. the demo hello world signatiure is
Copy code
@task
def say_hello(name: str) -> str:
    return f"Hello, {name}!"
but let's say something more complex like
Copy code
@task
def prediction(model: trained_model) -> prediction
b

Blake Jackson

03/18/2024, 4:12 PM
There's a LiteralMap construct that you'd use to pass input params to create the execution
k

Ketan (kumare3)

03/19/2024, 12:24 AM
the data is sent through protobuf
a

Andy Czerwonka

03/19/2024, 12:28 AM
so I have to create protobufs for each parameter?
k

Ketan (kumare3)

03/19/2024, 1:19 AM
Wdym, it is a literalmap, which is protobuf
Much of this is already done in flytekit-java
2 Views