Skip to main content

Union.ai Actors

Developer Setup

Make sure you have a virtual environment set up and activated. Use uv.

Go into the folder this readme is in (cd fasttask/worker-v2 from base of repo). Then,

uv venv --python 3.13
source .venv/bin/activate

To build wheels containing the Rust code you'll also need this for now. make build-builders to build the builder images

This is because the manylinux by default don't come with rust installed. Installing them into the manylinux image every time is too time-consuming, so these are really lightweight images that just install rust/cargo/maturin.

We can get rid of these once we find better ways to build multi-arch wheels, or find maintained public images. I'm sure they exist, just haven't looked in depth.

End to end iterating

make build-wheels to build the wheels. This compiles all the Rust code

Do something like this on the Python side

actor_dist_folder = Path("/Users/ytong/go/src/github.com/unionai/flyte/fasttask/worker-v2/dist")
wheel_layer = PythonWheels(wheel_dir=actor_dist_folder, package_name="unionai-reuse")
base = flyte.Image.from_debian_base()
actor_image = base.clone(addl_layer=wheel_layer)

and also run make dist as you would normally when iterating just in the flyte-sdk.

From examples folder of flyte-sdk, using a different virtual environment. Make sure to update the wheel folder in the example code.

flyte -c ~/.flyte/config-k3d.yaml run -d development reuse/oomer_reuse.py failure_recovery

Note when hitting Ctrl-C during the make command, the docker process doesn't stop. You'll have to docker stop/rm the container if you don't want to wait around for the build to finish.

Executor iteration

To make a change to the python side

  • Just make sure that the flyte-sdk library is installed in editable mode and changes should get picked up. Test with a print statement to confirm.

To make a change to the rust side These instructions may be incomplete

Run the test server so that the executor has something to attach to.

cargo run -p unionai_actor_bridge --bin test_server

Another test service is available called ping_test - it doesn't ping, it calls devbox one.

cargo run -p unionai_actor_bridge --bin ping_test
cargo run -p unionai_actor_bridge --bin ping_test -- --test-cancel --cancel-wait 10

Run the executor (see below for building)

unionai-actor-executor --executor-registration-addr 127.0.0.1:15606 --id 0 --num-workers 1

This adds local flyte-sdk changes to the path. Also adds the examples folder to the path so that the manual override added (need to document), can be picked up.

When using this, you'll also need to pull this test branch in flyte-sdk, which helps short-circuit part of the task execution process. https://github.com/flyteorg/flyte-sdk/compare/rusty-test-abort?expand=1

PYTHONPATH=/Users/ytong/go/src/github.com/flyteorg/flyte-sdk/examples:/Users/ytong/go/src/github.com/flyteorg/flyte-sdk/src: unionai-actor-executor --executor-registration-addr 127.0.0.1:15606 --id 0 --num-workers 1

Will need to uv pip install -e . from base folder (the dir this readme is in) to pick up changes - need to investigate how to run maturin develop from the executor/ folder, which doesn't seem to work currently. Changes don't get pick up.

Bridge iteration

fill this in next time someone is working only on the bridge side.

SDK side

In addition to the test branch above, to get the flyte-sdk to pick up the whls that are build as part of the make build-wheels target, you can use this Python snippet as the image in the TaskEnvironment

from pathlib import Path
from flyte._image import PythonWheels

actor_dist_folder = Path("/Users/yourusername/go/src/github.com/unionai/flyte/fasttask/worker-v2/dist")
wheel_layer = PythonWheels(wheel_dir=actor_dist_folder, package_name="unionai-reuse")
base = flyte.Image.from_debian_base()
actor_image = base.clone(addl_layer=wheel_layer)

If a test version has been published to test pypi, then you can use it in the task Image with

flyte.Image.from_debian_base().with_pip_packages("unionai-reuse==0.1.8b4", extra_index_urls=["https://test.pypi.org/simple/"])

Releasing

There is some CI in .github/workflows/wheels.yml at the base of this repo, but it is slow. That workflow will build and publish wheels to pypi and test pypi based on the following:

To trigger the workflow, create and push a tag (or create on GitHub) matching unionai_reuse-v*.

  • Tags on the master branch publish to PyPI, while tags on feature branches publish to TestPyPI for testing.
  • Beta/prerelease versions (identified by b, rc, alpha, beta, or dev in the version string, e.g., unionai_reuse-v0.1.8b0) pushed from master will also publish to TestPyPI.
  • The workflow builds wheels for Linux (x86_64 and aarch64) and macOS platforms.

To tag locally, run

git tag unionai_reuse-v0.1.15
git push origin unionai_reuse-v0.1.15

However the CI is super, super slow - like running the ARM build takes like 40-50 mins. Can investigate ARM machines in the future. The below commands use the local commands and override the python version. This is the better option if you're in a hurry. Building for amd64 on a macbook arm is much faster, at least on my M4 I'm typing this on. The make targets are needed anyways in local development so we'll definitely keep these around.

make build-wheels SETUPTOOLS_SCM_PRETEND_VERSION=0.1.15
SETUPTOOLS_SCM_PRETEND_VERSION=0.1.15 python -m build --wheel

but wheels need to be renamed to this pattern

mv unionai_reuse-0.1.15-cp310-abi3-linux_aarch64.whl unionai_reuse-0.1.15-cp310-abi3-manylinux_2_28_aarch64.whl;
mv unionai_reuse-0.1.15-cp310-abi3-linux_x86_64.whl unionai_reuse-0.1.15-cp310-abi3-manylinux_2_28_x86_64.whl

Metadata

Release files for unionai-reuse 0.2.1

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

Built distributions (wheels)

Table of built distributions (wheels) for unionai-reuse 0.2.1
File Interpreter ABI Platform Actions
unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
unionai_reuse-0.2.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for unionai_reuse-0.2.1-cp310-abi3-macosx_11_0_arm64.whl

Total release size: 6.0 MB

Release files / unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
60005f3f2321dc98c2787215b58324c1cf144a1e1cf630e66e4dbd976667615a
BLAKE2b-256 checksum
How to use checksums
349e5bde0c59b4a9e66414e9bbc418f1e1181f5af39f595c1d2f6cc4f3c4fe1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL unionai_reuse-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.1 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d2dcb54d566c570f223f42e957a51691422c510ac28db6e342dbdfa2ae080ad7
BLAKE2b-256 checksum
How to use checksums
278b288031d8f66bc4d8c2e788ec30619bb82624360df3b0b53651bf16249684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / unionai_reuse-0.2.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL unionai_reuse-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Size 1.8 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
16f64bef8803d1f5450add29169f548a1e6be1c84ab2b105e6a0e2914b3c7cd4
BLAKE2b-256 checksum
How to use checksums
53e90074592c0ab694488d5913ad5d769f8dbdf4ab6a32fa8f19fcacaa8c9ed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Security for unionai-reuse 0.2.1

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

0.2.1 This release

3 release files No provenance

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