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

Jonatan Eriksson

02/06/2024, 1:10 PM
Hello! I'm having some issues with registering a task using FlyteRemote. I'm trying to follow this guide: https://docs.flyte.org/en/latest/introduction/flyte_fundamentals/run_schedule.html However, instead of runnint pyflyte register ... I want to use FlyteRemote to register the task. But I'm getting an error that seems to be related to the container. How do I specify the which image to register the task with? BR, Jonatan I have a file called test_base.py and I get the error:
ValueError: Empty module name .
from flytekit import task
from flytekit.configuration import Config, ImageConfig, SerializationSettings
from flytekit.remote import FlyteRemote
@task
def my_task() -> str:
return "hello"
def test_stuff():
remote = FlyteRemote(
config=Config.for_endpoint(endpoint="<my_endpoint>"),
default_project="flytesnacks",
default_domain="development",
)
remote_task = remote.register_task(
entity=my_task,
serialization_settings=SerializationSettings(
image_config="???")
),
version="v1",
)
execution = remote.execute(remote_task, inputs={}, wait=True)
assert execution.is_done
if __name__ == "__main__":
test_stuff()
2 Views