The Rust Scaffolding Behind Python's Distributed Future: Inside daft-cli

How a single Rust binary bypasses Terraform and Kubernetes to give data scientists a managed Ray cluster in 60 seconds.

7 min read • View on GitHub • More from Eventual-Inc

A wide illustration showing a tiny desk with an open notebook at the base of a massive, brutalist wall made of heavy server racks and tangled cables. The image visualizes the daunting leap from simple local Python development to complex distributed cloud infrastructure.
The transition from local pandas to distributed computing often involves scaling an "infrastructure wall."
Key Takeaways

The Infrastructure Wall

Python is the undisputed lingua franca of data science. Tools like pandas and local Daft DataFrames offer an incredibly ergonomic developer experience right up until the moment a dataset outgrows the RAM on a developer's laptop. At that precise moment, the user experience falls off a cliff.

To scale execution to a distributed cluster, data scientists are traditionally forced to pivot away from their core competency. They must learn infrastructure-as-code (IaC) tools like Terraform, navigate the AWS Console, or wrestle with Kubernetes YAML manifests just to provision the compute necessary to run a single query. This "infrastructure wall" is a massive source of friction in data workflows.

A Rust Binary in a Python Trenchcoat

The solution built by Eventual Inc. for the Daft ecosystem is daft-cli (packaged as daft-launcher). It tackles this friction not by introducing another cloud console, but by hiding complex orchestration inside a familiar package format.

Architecturally, daft-cli is a pure Rust application. However, it uses the maturin build system to compile and distribute itself via PyPI. To a Python developer, acquiring the tool is as simple as running pip install daft-launcher. Behind the scenes, they are downloading a high-performance, dependency-free executable capable of complex systems-level operations.

[build-system]
requires = ["maturin>=1.5,<2.0"]
build-backend = "maturin"

[project]
name = "daft-launcher"
requires-python = ">=3.8"
dependencies = [
    "ray[default]"
]

This approach follows a growing trend in the Python ecosystem (seen in tools like uv and polars) where performance-critical tooling is written in Rust but delivered seamlessly to Python users.

Pragmatic IaC and the SSH Hack

Once installed, daft-cli operates as a "Lite IaC" tool. Instead of requiring the user to write HCL or CloudFormation, it reads a simple .daft.toml manifest. The Rust binary uses the aws-sdk-ec2 and aws-sdk-sts crates to make direct API calls, spinning up a Ray cluster on EC2 instances natively.

The lifecycle of a daft-cli command, from local execution to distributed payload delivery.

The most fascinating technical detail lies in how the tool handles the "last mile" of connectivity. To ensure the cluster is ready and to open the Ray dashboard, the Rust code spawns an SSH process. Instead of relying on complex programmatic SSH libraries, it pragmatically parses the stderr output of the SSH command, waiting for the string "Authenticated to..." to confirm the tunnel is open before proceeding.

Delivering the Payload

The entire orchestration process exists to deliver a remarkably small payload. When a user executes a command like daft job sql "SELECT...", the heavy lifting of the Rust CLI culminates in pushing a tiny, 7-line Python shim (assets/sql.py) across the wire.

A close-up illustration of a highly detailed, polished metal mechanical claw delicately holding a single, glowing glass bead over a vast, churning pool of liquid. This represents the precise Rust CLI injecting a tiny Python script into the massive distributed Ray cluster.
The Rust CLI acts as a precise delivery mechanism for the minimal Python logic required to execute the job.

This script simply imports Daft, sets the execution runner to Ray, and executes the query. It perfectly bridges the systems-level infrastructure management written in Rust with the application-level data processing written in Python.

Our goal is to make Daft the fastest distributed query engine, and we’re making great strides.

The Enterprise Split: Provisioned vs. BYOC

The underlying architecture of daft-cli relies heavily on a ProviderConfig enum, which strictly bifurcates the tool's behavior into two distinct modes: "Provisioned" and "BYOC" (Bring Your Own Cluster).

This split reflects a mature understanding of the market. Scrappy startups and independent data scientists need the "Provisioned" mode to handle the full AWS lifecycle (Up, Down, Kill). Conversely, larger enterprises with locked-down infrastructure only want the "BYOC" mode, allowing them to submit jobs to pre-existing Kubernetes namespaces without the CLI attempting to modify underlying resources.

FeatureProvisioned Mode (AWS)BYOC Mode (Kubernetes)
Lifecycle ControlFull Up/Down via SDKJob Submit Only
Target AudienceData Scientists, StartupsDevOps Teams, Enterprises
Infra SourceAWS EC2 APIExisting K8s Namespace
Setup FrictionLow (TOML based)High (Requires K8s setup)

By embedding infrastructure management directly into a pip-installable binary, daft-cli offers a compelling glimpse into the future of data engineering tooling—one where the boundary between application code and the infrastructure required to run it becomes increasingly invisible.