Skip to main content

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

Project description

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

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

prefect-spark-on-k8s-operator-0.1.1.tar.gz (31.8 kB view details)

Uploaded Source

Built Distribution

prefect_spark_on_k8s_operator-0.1.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file prefect-spark-on-k8s-operator-0.1.1.tar.gz.

File metadata

File hashes

Hashes for prefect-spark-on-k8s-operator-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a071160687431b9bb6bc0827bab2186d01895fdf42f5a6533906e7224cd4d2d0
MD5 8fc6cf319acd72bb4c0302115e13e7a9
BLAKE2b-256 3fe877a80dad269781afa7b8b8d5db99e75286eb84c43de46a2a15acb3cdfd83

See more details on using hashes here.

File details

Details for the file prefect_spark_on_k8s_operator-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for prefect_spark_on_k8s_operator-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a9c42ac58fc74d0887eb3ea1b1b131c6b161ffc82bfba5cd4154ddcb63eab27a
MD5 4e5f1e36b2353bc98557e578998a8287
BLAKE2b-256 80cc344d01f724a72ea23de2ba5e7ee79a3c66587d1da0f3032b1df6bc3350cf

See more details on using hashes here.

Supported by

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