Skip to main content

prefect-spark-on-k8s-operator

PyPI

Visit the full docs here to see additional examples and the API reference.

Prefect integrations for orchestrating and monitoring apache spark jobs on kubernetes using spark-on-k8s-operator.

Welcome!

prefect-spark-on-k8s-operator is a collection of Prefect flows enabling orchestration, observation and management of SparkApplication custom kubernetes resources defined according to spark-on-k8s-operator CRD v1Beta2 API Spec.

Jump to examples.

Resources

For more tips on how to use tasks and flows in a Collection, check out Using Collections!

Installation

You need to configure the kubernetes credentials as per prefect-kubernetes documentation.
Install prefect-spark-on-k8s-operator with pip:

pip install prefect-spark-on-k8s-operator

Requires an installation of Python 3.7+.

We recommend using a Python virtual environment manager such as pipenv, conda or virtualenv.

These flows are designed to work with Prefect 2.0. For more information about how to use Prefect, please refer to the Prefect documentation.

Example Usage

Specify and run a SparkApplication from a yaml file

import asyncio

from prefect_kubernetes.credentials import KubernetesCredentials
from prefect_spark_on_k8s_operator import (
    SparkApplication,
    run_spark_application, # this is a flow
)

app = SparkApplication.from_yaml_file(
    credentials=KubernetesCredentials.load("k8s-creds"),
    manifest_path="path/to/spark_application.yaml",
)


if __name__ == "__main__":
    # run the flow
    asyncio.run(run_spark_application(app))

Feedback

If you encounter any bugs while using prefect-spark-on-k8s-operator, feel free to open an issue in the prefect-spark-on-k8s-operator repository.

If you have any questions or issues while using prefect-spark-on-k8s-operator, you can find help in either the Prefect Discourse forum or the Prefect Slack community.

Feel free to star or watch prefect-spark-on-k8s-operator for updates too!

Contributing

If you'd like to help contribute to fix an issue or add a feature to prefect-spark-on-k8s-operator, please propose changes through a pull request from a fork of the repository.

Here are the steps:

  1. Fork the repository
  2. Clone the forked repository
  3. Install the repository and its dependencies:
pip install -e ".[dev]"
  1. Make desired changes
  2. Add tests
  3. Insert an entry to CHANGELOG.md
  4. Install pre-commit to perform quality checks prior to commit:
pre-commit install
  1. git commit, git push, and create a pull request

Metadata

Release files for prefect-spark-on-k8s-operator 0.1.2

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

Source distribution (sdist)

Source distribution for prefect-spark-on-k8s-operator 0.1.2
File Size Uploaded
prefect-spark-on-k8s-operator-0.1.2.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prefect-spark-on-k8s-operator 0.1.2
File Interpreter ABI Platform
prefect_spark_on_k8s_operator-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 46.6 kB

Release files / prefect-spark-on-k8s-operator-0.1.2.tar.gz

Download URL prefect-spark-on-k8s-operator-0.1.2.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
35e27b38ba9a469bd28eaf6d8a00b8ee728c8889000dfff542e30bce46e47dd4
BLAKE2b-256 checksum
How to use checksums
167aee4ecaac15489161b83794877d313c8c3fd2afc481aab36611538c11785c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release files / prefect_spark_on_k8s_operator-0.1.2-py3-none-any.whl

Download URL prefect_spark_on_k8s_operator-0.1.2-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38f7055a6b17c3f3738b4134d2c21af6c7396e2bc1c2aef1951889548c4de3ce
BLAKE2b-256 checksum
How to use checksums
e02be0718ace0cd465a58240614ea0dcf35a9391a2cccfc9cb030fb72fc53450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

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