Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Flyte 2 SDK

The next-generation SDK for Flyte.

Publish Python Packages and Official Images

Quickstart

  1. Clone this repo and set unionv2 to working directory.
  2. Run uv venv, and source .venv/bin/activate to create a new virtualenv
  3. Install the latest version of the SDK by running the following:
uv pip install --no-cache --prerelease=allow --upgrade flyte
  1. Create the config and point it to the Dogfood GCP cluster by running the following:
flyte create config --endpoint dns:///dogfood-gcp.cloud-staging.union.ai --org dogfood-gcp --project andrew --domain development 

This will create a config.yaml file in the current directory which will be referenced ahead of any other config.yamls found in your system.

  1. Now you can run stuff with the CLI:
flyte run --follow examples/basics/devbox_one.py say_hello_nested

Note that the --follow command is optional. Use this to stream updates to the terminal!

Hello World Example

  1. Only async tasks are supported right now. Style recommended, import flyte and then flyte.TaskEnvironment etc
  2. You have to create environment for even a single task
  3. look at examples/... for various examples.
  4. For a single script recommend using uv run scripts with metadata headers.
import flyte

env = flyte.TaskEnvironment(name="hello_world")


@env.task
async def say_hello(data: str) -> str:
    return f"Hello {data}"


@env.task
async def say_hello_nested(data: str) -> str:
    return await say_hello.override(resources=flyte.Resources(gpu="A100 80G:4")).execute(data)


if __name__ == "__main__":
    import asyncio

    # to run pure python - the SDK is not invoked at all
    asyncio.run(say_hello_nested("test"))

    # To run locally, but run through type system etc
    flyte.init()
    flyte.run(say_hello_nested, "World")

    # To run remote
    flyte.init(endpoint="dns:///localhost:8090", insecure=True)
    flyte.run(say_hello_nested, "World")
    # It is possible to switch local and remote, but keeping init to have and endpoint, but , changing context during run
    flyte.with_runcontext(mode="local").run(...)  # this will run locally only

    # To run remote with a config
    flyte.init_from_config("config.yaml")

CLI

All commands can be run from any root directory. For examples, it is not needed to have __init__.py in the directory. If you run from a directory, the code will automatically package and upload all modules that are imported. You can change the behaviour by using --copy-style flag.

flyte run examples/basics/devbox_one.py say_hello --data "World"

To Follow the logs for the a0 action, you can use the --follow flag:

flyte run --follow examples/basics/devbox_one.py say_hello --data "World"

Note follow has to be used with run command

Change copy style

flyte run --copy-style examples/basics/devbox_one.py say_hello_nested --data "World"

Building Images

import flyte

env = flyte.TaskEnvironment(
    name="hello_world",
    image=flyte.Image.auto().with_apt_packages(...).with_pip_packages(...),
)

Deploy

flyte deploy examples/basics/devbox_one.py say_hello_nested

CLI shortcuts

Get runs

flyte get run

Get specific run

flyte get run "run-name"

Get run actions

flyte get actions "run-name"

Get specific action

flyte get action "run-name" "action-name"

Get action logs

flyte get logs "run-name" ["action-name"]

defaults to root action if no action name is provided

you can run any python script directly within the script module using main:

if __name__ == "__main__":
    import flyte
    flyte.init()
    flyte.run(say_hello_nested, "World")

You can also run from cli

you can Also run a uv script with metadata headers:

 uv run scripts / hello_world.py

Metadata

Release files for flyte 0.2.0b10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for flyte 0.2.0b10
File Interpreter ABI Platform Actions
flyte-0.2.0b10-py3-none-any.whl Python 3 none any Details for flyte-0.2.0b10-py3-none-any.whl

Release files / flyte-0.2.0b10-py3-none-any.whl

Download URL flyte-0.2.0b10-py3-none-any.whl
Size 343.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3f005c9f165d0b1b7833b7db2b41b907f7a5343bb62c754052e8ef74feff9c7a
BLAKE2b-256 checksum
How to use checksums
9c67999789c34ec2dc7a605744246e511412ef5eb3f52ca5698c4e1d59c9337f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for flyte 0.2.0b10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page