Did anyone tried using FlyteRemote? Specifically, ...
# announcements
m
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
t
That should be possible. @many-farmer-75679, are you providing
image_config
while initialising remote?
m
Oops I did not. Do you know what I should provide for image_config? @tall-lock-23197
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")
t
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"))
)
?
m
@tall-lock-23197 Gee it works! Shouldnt we change this image_config to required then? Should I make PR for this?
t
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.
m
I feel like that should be mentioned somewhere...It was very confusing experience for me
t
Yea, we need to document FlyteRemote, which indeed is underway. Apologies for not yet providing proper examples.
m
Lemme know if you need help on documentation!
t
That would be awesome. Here’s the issue: https://github.com/flyteorg/flyte/issues/1844#issuecomment-1033565904.
m
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? @tall-lock-23197
f
Cc @thankful-minister-83577, @many-farmer-75679 can you use the package and register path
We are working on cleaning this up
Cc @high-accountant-32689
m
@freezing-airport-6809 Is there anyway not using Dockerfile? I am trying to use Jupyter Notebook Environment
f
@many-farmer-75679 shall we have a chat, may tonight's office hour. There are couple ways
m
Sure let me know when you are free
f
I can talk in 20 minutes
šŸ™ 1
m
Should we chat via Zoom or dm?
199 Views