Skip to main content

ascii_library.orchestration.pipes.instance_config module

class ascii_library.orchestration.pipes.instance_config.CloudInstanceConfig

Bases: object

__init__(**kwargs)

create_filters(instance, ops='Linux', region='us-east-1')

create an array with the filters fo price :param insance: json that from of an available instances on EMR, :param ops: operative system, EMR only takes Linux :param region: the region we work, by default it’s us-east-1 :return:

  • Parameters:
    • ops (str)
    • region (str)

get_instance_price(prices)

parse json with prices for getting the price fo the right type :param prics: a list with the return of pricing client :return: float with the right price

add_prefix_suffix_to_instances(instances)

Adds ‘Prefix’ and ‘Suffix’ to each instance dictionary based on the ‘Type’.

  • Parameters: instances – List of instance dictionaries with a ‘Type’ key.
  • Returns: The original list of instances, modified to include ‘Prefix’ and ‘Suffix’.

filter_by_numeric_value(instances, key, value)

filter_by_exact_match(instances, key, value)

filter_by_enum(instances, value, base=<enum 'Suffix'>)

filter_instances(instances, **kwargs)

Filters instances based on given criteria. Numeric fields are compared for greater or equal values, while string fields must match exactly.

  • Parameters:
    • instances – List of instance dictionaries.
    • kwargs – Criteria for filtering (e.g., MemoryGB=16, VCPU=4, Prefix=’m5’).
  • Returns: List of filtered instances.

get_instance_config()

gen_instance_type_config()

get_launch_spec()

get_fleet_config()

get_default_fleet(**kwargs)

get_available_instances(emr_client, releaseLabel='emr-7.10.0', **kwargs)

  • Parameters: releaseLabel (str | None)
  • Return type: List[Any]

get_instance_w_price(price_client, instances, n=15)

  • Parameters:
    • instances (Sequence *[*Dict ])
    • n (int)

gen_instance_type_configs()

get_fleet_programatically(emrClient, priceClient)

get_group_default()