https://flyte.org logo
y

Yongchan Hong

02/09/2022, 7:31 AM
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

Samhita Alla

02/09/2022, 8:54 AM
That should be possible. @Yongchan Hong, are you providing
image_config
while initialising remote?
y

Yongchan Hong

02/09/2022, 8:56 AM
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

Samhita Alla

02/09/2022, 9:09 AM
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

Yongchan Hong

02/09/2022, 9:29 AM
@Samhita Alla Gee it works! Shouldnt we change this image_config to required then? Should I make PR for this?
s

Samhita Alla

02/09/2022, 9:34 AM
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

Yongchan Hong

02/09/2022, 9:35 AM
I feel like that should be mentioned somewhere...It was very confusing experience for me
s

Samhita Alla

02/09/2022, 9:36 AM
Yea, we need to document FlyteRemote, which indeed is underway. Apologies for not yet providing proper examples.
y

Yongchan Hong

02/09/2022, 9:41 AM
Lemme know if you need help on documentation!
s

Samhita Alla

02/09/2022, 9:46 AM
That would be awesome. Here’s the issue: https://github.com/flyteorg/flyte/issues/1844#issuecomment-1033565904.
y

Yongchan Hong

02/09/2022, 2:13 PM
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

Ketan (kumare3)

02/09/2022, 3:13 PM
Cc @Yee, @Yongchan Hong can you use the package and register path
We are working on cleaning this up
Cc @Eduardo Apolinario (eapolinario)
y

Yongchan Hong

02/09/2022, 3:28 PM
@Ketan (kumare3) Is there anyway not using Dockerfile? I am trying to use Jupyter Notebook Environment
k

Ketan (kumare3)

02/09/2022, 4:22 PM
@Yongchan Hong shall we have a chat, may tonight's office hour. There are couple ways
y

Yongchan Hong

02/09/2022, 4:38 PM
Sure let me know when you are free
k

Ketan (kumare3)

02/09/2022, 4:38 PM
I can talk in 20 minutes
šŸ™ 1
y

Yongchan Hong

02/09/2022, 5:01 PM
Should we chat via Zoom or dm?
13 Views