Skip to content

Instantly share code, notes, and snippets.

View quozd's full-sized avatar

Vitali Fokin quozd

View GitHub Profile
- What do Etcd, Consul, and Zookeeper do?
- Service Registration:
- Host, port number, and sometimes authentication credentials, protocols, versions
numbers, and/or environment details.
- Service Discovery:
- Ability for client application to query the central registry to learn of service location.
- Consistent and durable general-purpose K/V store across distributed system.
- Some solutions support this better than others.
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
- Centralized locking can be based on this K/V store.
@quozd
quozd / serializer.py
Created February 6, 2019 08:03
Typehints-based deserializer
def _create_config_hierarchy(config_cls: Type[TConfig], config_data: Mapping) -> TConfig:
sig = signature(config_cls)
cls_data_attributes = getmembers(config_cls, lambda a: isinstance(a, GenericDescriptor))
if len(cls_data_attributes) != len(sig.parameters):
raise TypeError(
'Type {type_name} has invalid __init__.\n'
'Init parameters count should equal to data descriptors count.\n'
'Init parameters: [{init_params}], data descriptors: [{data_descriptors}]'.format(
#!/usr/bin/env bash
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts]
where:
region - the AWS region
stack-name - the stack name
aws-cli-opts - extra options passed directly to create-stack/update-stack
"