Skip to main content

Airflow provider for Onehouse QuantonSparkApplication Kubernetes CRDs

Project description

airflow-provider-quanton-spark-k8s

This airflow provider will make it easy to run a quanton spark job on kubernetes using airflow.

Requirements

Apache Airflow >= 2.7.0 Python >= 3.10

Installation

pip install airflow-provider-quanton-spark-k8s

Usage

Basic Example DAG

from datetime import datetime

from airflow import DAG
from quanton_provider.operators.quanton_spark_application import (
    QuantonSparkApplicationOperator,
)

with DAG(
    dag_id="test_quanton_spark_pi",
    start_date=datetime(2026, 3, 1),
    schedule=None,
    catchup=False,
    tags=["quanton", "spark", "test"],
) as dag:
    run_spark_pi = QuantonSparkApplicationOperator(
        task_id="run_spark_pi",
        name="quanton-spark-pi-java-example",
        namespace="spark-operator",
        timeout=600,
        delete_on_success=True,
        spark_application_spec={
            "type": "Java",
            "mode": "cluster",
            "image": "apache/spark:3.5.0",
            "imagePullPolicy": "IfNotPresent",
            "mainClass": "org.apache.spark.examples.JavaSparkPi",
            "mainApplicationFile": "https://repo1.maven.org/maven2/org/apache/spark/spark-examples_2.10/1.1.1/spark-examples_2.10-1.1.1.jar",
            "arguments": ["100"],
            "sparkVersion": "3.5.0",
            "restartPolicy": {
                "type": "Never",
            },
            "driver": {
                "cores": 1,
                "coreLimit": "1200m",
                "memory": "1024m",
                "labels": {"version": "3.5.0"},
                "serviceAccount": "spark-service-account",
            },
            "executor": {
                "cores": 1,
                "instances": 2,
                "memory": "512m",
                "labels": {"version": "3.5.0"},
            },
        },
    )

Testing

Install the package with test dependencies:

pip install -e .
pip install -r requirements-dev.txt

Run the test suite:

pytest

Run with coverage report:

pytest --cov=quanton_provider --cov-report=term-missing

The project enforces a minimum of 95% code coverage.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airflow_provider_quanton_spark_k8s-0.0.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file airflow_provider_quanton_spark_k8s-0.0.2.tar.gz.

File metadata

File hashes

Hashes for airflow_provider_quanton_spark_k8s-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8b311148f76b265ec00c470792d104f2cd42ffbdff4323f67e6e08213e1fa402
MD5 ffd4ad2b0fc1f4c7a121e96d9aea23d1
BLAKE2b-256 ed0db4ef17014303f5809061e53efa090a93b3180b9284812c4c2910aafa66d6

See more details on using hashes here.

File details

Details for the file airflow_provider_quanton_spark_k8s-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for airflow_provider_quanton_spark_k8s-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 82fc9d07fc45c98909d482556ac39fd19802a8e85c129d159a460e7b77c18950
MD5 4bbd8a86b5e350d40edba55b6500494e
BLAKE2b-256 b5b3874aac0b930fd71d78f5543e55ff73bd1443d2d15a2ce3e5b31454fce725

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page