The EMR Helper library tries to help when setting up and managing an EMR cluster.
AWS EMR has three distinct objects:
Cluster
Fleet
Step
This library collects some of the most common types of these elements and manages them at the python class level.
Dependencies
Boto3
Classes
Step
There is a general class Step to wrap all subtypes of steps. Currently there are only CommandRunnerStep implemented to launch a Command Runner step.
You can create a step as follow:
import boto3
from emrhelper import CommandRunnerStep
step = CommandRunnerStep(
name='StepName',
args=process_arguments)
It can be added to a cluster before it starts (see Cluster) or append to a started cluster:
step.run_on_cluster(‘clusterID’)
If clusterID is None, step is added to any available cluster.
Fleet
The instance fleets configuration for a cluster contains instances information for computation capacity of cluster. As steps, there is a main class ‘Fleet’ and several subclasses: OnDemandFleet and SpotFleet, depending on whether you want to launch spot or on-demand instances.
You can create a fleet as follow:
from emrhelper import SpotFleet
fleet = SpotFleet(name='My Fleet', capacity=4, fleet_type='CORE')
fleet.add_instance_config(instance_type='r5d.xlarge', capacity=2)
fleet.add_instance_config(instance_type='r5d.2xlarge', capacity=4)
Cluster
You can create a cluster, add steps and fleets, and run it.
from emrhelper import Cluster
cluster = Cluster(
name='my-cluster',
key_pair='keypair',
subnets='...',
sg_master='...',
sg_slave='...',
sg_service='...',
instance_profile='...',
service_role='...',
log_uri='...'
)
cluster.add_step(step)
cluster.add_fleet(fleet)
cluster.run_cluster()
You can add as many steps and fleets as you need.
Installation
pip install emrhelper
Metadata
Release files for emr-helper 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| emr-helper-1.0.0.tar.gz | 7.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| emr_helper-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / emr-helper-1.0.0.tar.gz
| Download URL | emr-helper-1.0.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd1f57c74631299486d30a8319c16c8c80b3ebc1fe292acbee979d67a705e691
|
|
BLAKE2b-256 checksum How to use checksums |
7c67ec1ef7f1eb5cfdbea74839e544e7d8760e52530f6cd6a6cc6b164fe1ec2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
|
Release files / emr_helper-1.0.0-py3-none-any.whl
| Download URL | emr_helper-1.0.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af367ec50bfaa6872144f20899a405c1b5018f6ee4f0f5695d0a53587b5cdec3
|
|
BLAKE2b-256 checksum How to use checksums |
44f2e458df3e1dae5b0eaa617498d23805cbc457d07e9d551948611d42878a01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2
|