Before you run#
Use an installed, authenticated Yak CLI with access to the invite-only preview. Read Quickstart for the full setup and current behavior.
Python example
Declare a task, invoke it remotely, and print its result.
Use an installed, authenticated Yak CLI with access to the invite-only preview. Read Quickstart for the full setup and current behavior.
import asyncio
import yak
app = yak.App(name="hello-task", image="python:3.11")
@app.task()
def square(value: int) -> int:
return value * value
@app.entrypoint()
async def main() -> None:
result = await square.remote.aio(21)
print(f"square(21) = {result}")
if __name__ == "__main__":
asyncio.run(main())
Save the source as hello_task.py, then run:
$ yak run hello_task.py