Skip to content

Instantly share code, notes, and snippets.

View denismakogon's full-sized avatar

Denys Makogon denismakogon

View GitHub Profile
E123, 126, 125, 127, 128, 121
tox.ini ------ ignore = E12,F821,F841,H
troveclient/auth.py:108:21: E126 continuation line over-indented for hanging indent
troveclient/auth.py:109:29: E126 continuation line over-indented for hanging indent
troveclient/auth.py:111:21: E123 closing bracket does not match indentation of opening bracket's line
troveclient/auth.py:112:16: E124 closing bracket does not match visual indentation
list service types
GET /service_types
{
"service_types": [
{
"type_id": "Oracle MySql",
},
{
"type_id": "datastax cassandra",
}
@denismakogon
denismakogon / gist:6580664
Last active December 23, 2015 04:29
Cluster API implemenation
Create cluster call
- Define specific stuff for each instance: security group/ruls, dns entry, floating IP etc.
- Connect node group into common network (VLAN, tunneling, flat network)
- Spin-up guestagent on each instance.
- Check statuses of each instance. Generate cluster status.
- Verify by updating cluster status at DВ.
@denismakogon
denismakogon / gist:6613436
Created September 18, 2013 18:32
Force Delete vs Automated rollback
There is huge problem in trove - no ability to delete stucked instance.
For now trove could not do anything with that kind of instances.
This problem could be solved in 2 way:
1. Automated
1.1 Define special method that will do restoring of any component: security groups/rules, volumes, floating ips, dns records
1.2 Each component should have it's own method which will do rollback.
1.3 All this methods should be configurally switched on/off.
2. API-call driven
2.1 Define special method that will do restoring of any component: security groups/rules, volumes, floating ips, dns records
2.2 Each component should have it's own method which will do rollback.
@denismakogon
denismakogon / gist:6705456
Last active December 23, 2015 22:49
DNS workflow for Trove
1. Trove would only supports Designate, nothing else.
2. Factory methods should be more detailed and not relay already formed objects.
3. Using before formed object is bad way, user could make object with None's in it.
DNS workflow:
Config values: support, factory, driver implementation
Workflow:
1. Check dns support.
2. Check floating ips supoort
3. Reserve/Allocate-and-Reserve floating ip for instance before it gets provisioned.
@denismakogon
denismakogon / gist:6784871
Last active December 24, 2015 10:29
Registry
Guestagent conf:
service_registry_ext = dict_opt {service_engine*: trove.guestagent.manager.service_engine.Manager, ...}
service_engine is mysql, percona, cassandra, mongo etc.
------------------------------------------------------------------
common/cfg.py
DictOpt('service_registry_ext', default=dict(), help=...)
------------------------------------------------------------------
guestagent/dbaas.py:
@denismakogon
denismakogon / gist:6791694
Last active December 24, 2015 11:29
Cloud-init service extensions in Trove
Suppose we have to deploy specific database that doesn't
pulls it's own dependencies (probably more than one).
And those dependencies are stored in custom repository (rhel/ppa).
------------------------------------------------------------------------------------
I'm offering next solution:
Let trove store custom additional parameters for cloud-init script as an extensions.
This would let trove-guestagent become a bit simpler
and do not let guestagent perform deployment
@denismakogon
denismakogon / gist:6812917
Last active December 24, 2015 14:29
Heat template dependency of service type
Suppose we want to provide custom heat template for specific service type.
Now trove uses only one heat template for VM pre-configuration and guestagent launching.
-----------------------------------------------------------------------------------------
We should provide dependency between service(mysql, percona, mongo, redis, cassandra)
and specific heat template.
Also, we should externalize heat template from trove.common.template
to trove.extensions.service."service_type".template_module
@denismakogon
denismakogon / gist:6904690
Last active December 25, 2015 02:48
"True reservation" process in Trove
Resource reservation - assigning resource to specific
instance via database model for short period of time.
Resource assigning - temporary resource registration
as component of specific instance by database model.
------------------------------------------------------------------
What Resource reservation consists of?
@denismakogon
denismakogon / gist:6975141
Last active December 25, 2015 12:19
Remote executions
Remote execution via ssh using subprocess:
ip_addr = novaclient.servers.get_fixed_ip(server_id).ip
abc = "any command you want, because you access VM as root via SSH"
ret = subprocess.call(["ssh", "root@%(ip_addr)s" % {'ip_addr': ip_addr}, abc])