A collection of example workflows that run on Union
16
stars
1,005
commits
Jupyter Notebook
primary language
Sep 10, 2026
updated
This is a repository of runnable examples for Union. Use it as a reference for learning how to build repeatable and scalable AI/ML workflows.
v2/ - Modern examples using Flyte 2.x (recommended)v1/ - Legacy examples for Flyte 1.x compatibility_blogs/ - Example code featured in Union blog posts (temporary)test/ - Automated testing framework for V2 examplesThis repository includes a testing framework that validates Flyte 2.x example scripts in the v2/ directory using uv for dependency management. The testing framework is designed specifically for modern Flyte 2.x workflows and does not support legacy v1 examples.
The testing framework supports three execution modes:
test) - Executes examples on Union's cloud backend using uv runtest-local) - Executes examples locally using flyte run --localtest-preview) - Shows what would be executed without running anything# Test all examples (cloud execution)
make test
# Test all examples (local execution)
make test-local
# Preview what would run (no execution)
make test-preview
# Test specific file in cloud
make test FILE=v2/user-guide/getting-started/hello.py
# Test specific file locally
make test-local FILE=v2/user-guide/getting-started/hello.py
# Test examples matching pattern
make test FILTER=user-guide
make test-local FILTER=user-guide
# Development setup
make setup-venv
source ~/.venv/bin/activate
make update-flyte
# Clean test logs, reports, and virtual environments
make clean
| Target | Description | Usage |
|---|---|---|
test | Run tests with cloud execution | make test [FILE=path] [FILTER=pattern] |
test-local | Run tests with local execution | make test-local [FILE=path] [FILTER=pattern] |
test-preview | Preview tests without execution | make test-preview [FILE=path] [FILTER=pattern] |
setup-venv | Create virtual environment with uv | make setup-venv |
update-flyte | Update to latest Flyte version | make update-flyte |
clean | Clean test logs and reports | make clean |
All testing commands support:
FILE: Test a specific file (takes precedence over FILTER)FILTER: Test files matching a pattern (e.g., user-guide, trading)Cloud Mode (test):
uv run to execute examples with dependenciesLocal Mode (test-local):
uv pip install --requirement to install dependencies from PEP 723 metadataflyte run --local for local executionPreview Mode (test-preview):
Verbosity Control:
# Adjust Flyte verbosity levels
make test-local VERBOSE=v FILE=hello.py # -v (minimal)
make test-local VERBOSE=vv FILE=hello.py # -vv (medium)
make test-local VERBOSE=vvv FILE=hello.py # -vvv (maximum)
make test-local VERBOSE=3 FILE=hello.py # Same as -vvv
Manual Test Runner Usage:
# Direct test runner usage
python3 test/test_runner.py --preview
python3 test/test_runner.py --local --file "v2/user-guide/getting-started/hello.py"
python3 test/test_runner.py --filter "hello" --verbose "vv"
python3 test/test_runner.py --local --filter "user-guide"
After running tests, find outputs in structured directories:
test/reports/: Summary reports
test_report.html: Interactive HTML reporttest_report.json: Machine-readable JSON reporttest/logs/: Individual execution logs
.log files for each scripttest/venvs/: Isolated virtual environments (cleaned up automatically)For running the cloud test you need to have a valid Flyte configuration that points to a Flyte backend.
The Flyte backend is configured in the file test/config.flyte.yaml.
Currently, it is set to point to a Union-internal instance.
To run the cloud tests from your local machine you need to set the environment variable FLYTE_CLIENT_SECRET.
(for the GitHub Actions workflow that runs these tests, this secret is already configured as a repository secret for authentication with the Flyte backend.)
Some examples require additional API keys (e.g., OpenAI, Tavily, Together.ai, and Finnhub). The You.com agent tutorials under v2/tutorials/ need a You.com API key (new accounts start with free credits, no credit card required) and an Anthropic API key. These can be created as Flyte secrets referenced in the example scripts.
The script test/create_secrets.sh can be used to create these secrets in the Flyte backend that is used for testing environment. Make sure to set the corresponding environment variables before running the script.
For the Union-internal test backend these secrets have already been created.
This repository includes automated testing via GitHub Actions.
Currently, it uses manual-only triggers for controlled testing.
test (cloud execution), test-local (local execution), or test-preview (preview only)To enable automatic testing, uncomment the relevant sections in .github/workflows/test-examples.yml:
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
Jupyter Notebook
61.2%
Python
37.7%
A collection of example workflows that run on Union
16
stars
1,005
commits
Jupyter Notebook
primary language
Sep 10, 2026
updated
This is a repository of runnable examples for Union. Use it as a reference for learning how to build repeatable and scalable AI/ML workflows.
v2/ - Modern examples using Flyte 2.x (recommended)v1/ - Legacy examples for Flyte 1.x compatibility_blogs/ - Example code featured in Union blog posts (temporary)test/ - Automated testing framework for V2 examplesThis repository includes a testing framework that validates Flyte 2.x example scripts in the v2/ directory using uv for dependency management. The testing framework is designed specifically for modern Flyte 2.x workflows and does not support legacy v1 examples.
The testing framework supports three execution modes:
test) - Executes examples on Union's cloud backend using uv runtest-local) - Executes examples locally using flyte run --localtest-preview) - Shows what would be executed without running anything# Test all examples (cloud execution)
make test
# Test all examples (local execution)
make test-local
# Preview what would run (no execution)
make test-preview
# Test specific file in cloud
make test FILE=v2/user-guide/getting-started/hello.py
# Test specific file locally
make test-local FILE=v2/user-guide/getting-started/hello.py
# Test examples matching pattern
make test FILTER=user-guide
make test-local FILTER=user-guide
# Development setup
make setup-venv
source ~/.venv/bin/activate
make update-flyte
# Clean test logs, reports, and virtual environments
make clean
| Target | Description | Usage |
|---|---|---|
test | Run tests with cloud execution | make test [FILE=path] [FILTER=pattern] |
test-local | Run tests with local execution | make test-local [FILE=path] [FILTER=pattern] |
test-preview | Preview tests without execution | make test-preview [FILE=path] [FILTER=pattern] |
setup-venv | Create virtual environment with uv | make setup-venv |
update-flyte | Update to latest Flyte version | make update-flyte |
clean | Clean test logs and reports | make clean |
All testing commands support:
FILE: Test a specific file (takes precedence over FILTER)FILTER: Test files matching a pattern (e.g., user-guide, trading)Cloud Mode (test):
uv run to execute examples with dependenciesLocal Mode (test-local):
uv pip install --requirement to install dependencies from PEP 723 metadataflyte run --local for local executionPreview Mode (test-preview):
Verbosity Control:
# Adjust Flyte verbosity levels
make test-local VERBOSE=v FILE=hello.py # -v (minimal)
make test-local VERBOSE=vv FILE=hello.py # -vv (medium)
make test-local VERBOSE=vvv FILE=hello.py # -vvv (maximum)
make test-local VERBOSE=3 FILE=hello.py # Same as -vvv
Manual Test Runner Usage:
# Direct test runner usage
python3 test/test_runner.py --preview
python3 test/test_runner.py --local --file "v2/user-guide/getting-started/hello.py"
python3 test/test_runner.py --filter "hello" --verbose "vv"
python3 test/test_runner.py --local --filter "user-guide"
After running tests, find outputs in structured directories:
test/reports/: Summary reports
test_report.html: Interactive HTML reporttest_report.json: Machine-readable JSON reporttest/logs/: Individual execution logs
.log files for each scripttest/venvs/: Isolated virtual environments (cleaned up automatically)For running the cloud test you need to have a valid Flyte configuration that points to a Flyte backend.
The Flyte backend is configured in the file test/config.flyte.yaml.
Currently, it is set to point to a Union-internal instance.
To run the cloud tests from your local machine you need to set the environment variable FLYTE_CLIENT_SECRET.
(for the GitHub Actions workflow that runs these tests, this secret is already configured as a repository secret for authentication with the Flyte backend.)
Some examples require additional API keys (e.g., OpenAI, Tavily, Together.ai, and Finnhub). The You.com agent tutorials under v2/tutorials/ need a You.com API key (new accounts start with free credits, no credit card required) and an Anthropic API key. These can be created as Flyte secrets referenced in the example scripts.
The script test/create_secrets.sh can be used to create these secrets in the Flyte backend that is used for testing environment. Make sure to set the corresponding environment variables before running the script.
For the Union-internal test backend these secrets have already been created.
This repository includes automated testing via GitHub Actions.
Currently, it uses manual-only triggers for controlled testing.
test (cloud execution), test-local (local execution), or test-preview (preview only)To enable automatic testing, uncomment the relevant sections in .github/workflows/test-examples.yml:
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC
Jupyter Notebook
61.2%
Python
37.7%