Skip to content
Draft

example #1010

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions examples/basics/devbox_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@

import flyte

env = flyte.TaskEnvironment(
name="hello_world",
resources=flyte.Resources(cpu=1, memory="1Gi"),
)
env = flyte.TaskEnvironment(name="hello_world", resources=flyte.Resources(cpu=1, memory="1Gi"), queue="dogfood-1")


@env.task
@env.task(queue="dogfood-2")
async def say_hello(data: str, lt: List[int]) -> str:
print(f"Hello, world! - {flyte.ctx().action}")
return f"Hello {data} {lt}"


@env.task
async def square(i: int = 3) -> int:
@env.task(queue="dogfood-2")
async def square(i: int = 10) -> int:
print(flyte.ctx().action)
return i * i


@env.task(entrypoint=True)
async def say_hello_nested(data: str = "default string", n: int = 3) -> str:
async def say_hello_nested(data: str = "default string", n: int = 10) -> str:
print(f"Hello, nested! - {flyte.ctx().action}")
coros = []
for i in range(n):
coros.append(square(i=i))
if i % 2 == 1:
coros.append(square.override(queue="dogfood-1")(i=i))
else:
coros.append(square(i=i))

vals = await asyncio.gather(*coros)
return await say_hello(data=data, lt=vals)
Expand Down
1 change: 1 addition & 0 deletions src/flyte/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ def _to_cache_lookup_scope(scope: CacheLookupScope | None = None) -> run_pb2.Cac
upload_req.project_id.CopyFrom(project_id)

upload_resp = await get_client().dataproxy_service.upload_inputs(upload_req)
print(f"DEBUG!!! {upload_resp.offloaded_input_data}")

resp = await get_client().run_service.create_run(
run_service_pb2.CreateRunRequest(
Expand Down
Loading