Skip to main content

Orchestrates Spark standalone clusters on HPCs.

Project description

sparkctl

This package implements configuration and orchestration of Spark clusters with standalone cluster managers. This is useful in environments like HPCs where the infrastructure implemented by cloud providers, such as AWS, is not available. It is particularly helpful when users want to deploy Spark but do not have administrative control of the servers.

Example usage

There are two main ways to use this package:

First, allocate compute nodes. For example, with Slurm (1 compute node for the Spark master and 4 compute nodes for Spark workers):

$ salloc -t 01:00:00 -n4 --partition=shared --mem=30G : -N4 --account=<your-account> --mem=240G
  1. Configure a Spark cluster and run Spark jobs with spark-submit or pyspark.
$ sparkctl configure
$ sparkctl start
$ spark-submit --master spark://$(hostname):7077 my-job.py
$ sparkctl stop
  1. Run Spark jobs in a Python script using the sparkctl library to manage the cluster.
from sparkctl import ClusterManager, make_default_spark_config

config = make_default_spark_config()
mgr = ClusterManager(config)
with mgr.managed_cluster() as spark:
    df = spark.createDataFrame([(x, x + 1) for x in range(1000)], ["a", "b"])
    df.show()

Refer to the user documentation for a description of features and detailed usage instructions.

Project Status

The package is actively maintained and used at the National Laboratory of the Rockies (NLR). The software is primarily geared toward HPCs that use Slurm. It also supports a generic list of servers as long as the servers have access to a shared filesystem and are accessible via SSH without password login.

It would be straightforward to extend the functionality to support other HPC resource managers. Please submit an issue or idea or discussion if you have interest in this package but need that support.

Contributions are welcome.

License

sparkctl is released under a BSD 3-Clause license.

Software Record

This package is developed under NLR Software Record SWR-25-109.

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

sparkctl-0.3.2.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

sparkctl-0.3.2-py3-none-any.whl (33.1 kB view details)

Uploaded Python 3

File details

Details for the file sparkctl-0.3.2.tar.gz.

File metadata

  • Download URL: sparkctl-0.3.2.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sparkctl-0.3.2.tar.gz
Algorithm Hash digest
SHA256 07e75a4b9047679d77756a3e7da232b7208200bc9a7a235da00cd400d0aeb22b
MD5 6dfecdcf779e6bbbb166bb394b98a61f
BLAKE2b-256 0dbd72930f9faf842a17ef99dcc13cfb102de8437718a5f759cc6e3308a305a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkctl-0.3.2.tar.gz:

Publisher: publish_to_pypi.yml on NatLabRockies/sparkctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sparkctl-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: sparkctl-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 33.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sparkctl-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8cfec4e7b4399f9633baf6d75d8459c93230665163efd9623f29eead6e238e34
MD5 7a3ee061413e93da6507999d935ca3f2
BLAKE2b-256 f77db3947b5bb74e5b17d23d28a6e7d5cee902c2a746bc77bfc6e4af34dd5a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sparkctl-0.3.2-py3-none-any.whl:

Publisher: publish_to_pypi.yml on NatLabRockies/sparkctl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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