Did anyone tried using FlyteRemote? Specifically, ...
# announcements
y
Did anyone tried using FlyteRemote? Specifically, did anyone tried registering? Can we register flyte workflow using FlyteRemote?
šŸ‘‹ 1
Also I am getting this weird ā€˜NoneTypeā€™ Object has no attribute ā€˜default_imageā€™ error when I am trying to register
s
That should be possible. @Yongchan Hong, are you providing
image_config
while initialising remote?
y
Oops I did not. Do you know what I should provide for image_config? @Samhita Alla
I am currently mimicking example from youtube:
Copy code
from flytekit.remote import FlyteRemote

remote = FlyteRemote(
    default_project="flytesnacks",
    default_domain="development",
    flyte_admin_url="<http://flyte-dev.xtrm-data.io|flyte-dev.xtrm-data.io>",
    insecure=False
)

from flytekit import kwtypes, task, workflow
from flytekit.extras.sqlite3.task import SQLite3Config, SQLite3Task
from flytekit.types.schema import FlyteSchema

EXAMPLE_DB = "<https://cdn.sqlitetutorial.net/wp-content/uploads/2018/03/chinook.zip>"

interactive_sql_task = SQLite3Task(
    "basic_querying_chan",
    query_template="select Trackid, Name from tracks limit {{.inputs.limit}}",
    inputs=kwtypes(limit=int),
    output_schema_type=FlyteSchema[kwtypes(TrackId=int, Name=str)],
    task_config=SQLite3Config(
        uri=EXAMPLE_DB,
        compressed=True,
    )
)
registered_sql_task = remote.register(my_workflow, "flytetester", "development", "basic_querying_chan", "v1")
s
Can you try
Copy code
from flytekit.core.context_manager import Image, ImageConfig

remote = FlyteRemote(
    default_project="flytesnacks",
    default_domain="development",
    flyte_admin_url="<http://flyte-dev.xtrm-data.io|flyte-dev.xtrm-data.io>",
    insecure=False,
    image_config=ImageConfig(default_image=Image(name="my-image", fqn="your-image-name", tag="v1"))
)
?
y
@Samhita Alla Gee it works! Shouldnt we change this image_config to required then? Should I make PR for this?
s
Awesome!
Shouldnt we change this image_config to required then?
I donā€™t think so cause
image_config
is required only when registering workflows. But if youā€™d like to trigger executions using FlyteRemote, that neednā€™t be mandatorily given.
y
I feel like that should be mentioned somewhere...It was very confusing experience for me
s
Yea, we need to document FlyteRemote, which indeed is underway. Apologies for not yet providing proper examples.
y
Lemme know if you need help on documentation!
s
That would be awesome. Hereā€™s the issue: https://github.com/flyteorg/flyte/issues/1844#issuecomment-1033565904.
y
I am trying to register task & workflow like this:
Copy code
from flytekit import task, workflow

@task
def sum(x: int, y: int) -> int:
   return x + y

@task
def square(z: int) -> int:
   return z * z

@workflow
def my_workflow(x: int, y: int) -> int:
   return sum(x=square(z=x), y=square(z=y))
And I am getting image canā€™t be pulled issue (Back-off pulling image ā€œyour-image-name:v1ā€) when I try to register task. When I try to register workflow, I get ā€˜err missing entity of type TASK with identifier projectā€™ error. Do you know any related info? @Samhita Alla
k
Cc @Yee, @Yongchan Hong can you use the package and register path
We are working on cleaning this up
Cc @Eduardo Apolinario (eapolinario)
y
@Ketan (kumare3) Is there anyway not using Dockerfile? I am trying to use Jupyter Notebook Environment
k
@Yongchan Hong shall we have a chat, may tonight's office hour. There are couple ways
y
Sure let me know when you are free
k
I can talk in 20 minutes
šŸ™ 1
y
Should we chat via Zoom or dm?
191 Views