← Back to team overview

cf-charmers team mailing list archive

Re: [Merge] lp:~whitmo/charms/trusty/cloudfoundry/add-collector into lp:~cf-charmers/charms/trusty/cloudfoundry/trunk

 

Inline comments, below.

Diff comments:

> === modified file 'Makefile'
> --- Makefile	2014-09-30 17:22:35 +0000
> +++ Makefile	2014-11-12 22:03:54 +0000
> @@ -18,6 +18,7 @@
>  	rm -fr build/
>  	rm -fr dist/
>  	rm -fr *.egg-info
> +	rm -fr .tox
>  
>  clean-pyc:
>  	find . -name '*.pyc' -exec rm -f {} +
> 
> === modified file 'charmgen/placements.yaml'
> --- charmgen/placements.yaml	2014-09-30 17:22:35 +0000
> +++ charmgen/placements.yaml	2014-11-12 22:03:54 +0000
> @@ -6,7 +6,7 @@
>          c: [login, uaa, mysql]
>          d: [dea, hm, etcd]
>          e: [loggregator, loggregator-trafficcontrol]
> -        f: [haproxy]
> +        f: [haproxy, collector]
>  local:
>      __default__:
>          constraints: arch=amd64 root-disk=20G mem=12G
> 
> === modified file 'cloudfoundry/contexts.py'
> --- cloudfoundry/contexts.py	2014-11-06 23:37:55 +0000
> +++ cloudfoundry/contexts.py	2014-11-12 22:03:54 +0000
> @@ -71,6 +71,29 @@
>              return data
>  
>  
> +class GraphiteRelation(RelationContext):
> +    name = 'carbon'
> +    interface = 'tcp'
> +    required_keys = 'port', 'hostname'
> +
> +    def is_ready(self):
> +        return True
> +
> +    def erb_mapping(self):
> +        orch = OrchestratorRelation()
> +        deployment_name = 'cf'
> +
> +        if orch.is_ready():
> +            deployment_name = orch.get_first('deployment_name')
> +
> +        if self.name in self:  # check due to everreadiness
> +            return {'collector.use_graphite': True,
> +                    'collector.deployment_name': deployment_name,
> +                    'collector.graphite.address': self.get_first('hostname'),
> +                    'collector.graphite.port': self.get_first('port')}
> +        return {}
> +
> +
>  class NatsRelation(RelationContext):
>      name = 'nats'
>      interface = 'nats'
> @@ -505,6 +528,7 @@
>      def provide_data(self):
>          pub_key = path(hookenv.charm_dir()) / 'orchestrator-key.pub'
>          result = {
> +            'deployment_name': hookenv.service_name(),

I like this.  There are a couple of places where "cloudfoundry" is hard-coded that should be switched to use this.

>              'artifacts_url': self.get_artifacts_url(),
>              'cf_version': self.get_version(),
>              'ssh_key': pub_key.text(),
> 
> === modified file 'cloudfoundry/releases.py'
> --- cloudfoundry/releases.py	2014-09-30 17:22:35 +0000
> +++ cloudfoundry/releases.py	2014-11-12 22:03:54 +0000
> @@ -11,6 +11,7 @@
>      ('loggregator-v1', 'loggregator'),
>      ('hm9000-v1', 'hm'),
>      ('haproxy-v1', 'haproxy'),
> +    ('collector-v1', 'collector'),
>  
>      ('cs:trusty/mysql', 'mysql'),
>      ('cs:~hazmat/trusty/etcd', 'etcd'),
> 
> === modified file 'cloudfoundry/services.py'
> --- cloudfoundry/services.py	2014-11-06 23:37:55 +0000
> +++ cloudfoundry/services.py	2014-11-12 22:03:54 +0000
> @@ -362,5 +362,20 @@
>              'provided_data': [],
>              'required_data': [contexts.RouterRelation],
>              }]
> -        }
> +        },
> +
> +    'collector-v1': {
> +        'service': 'collector',
> +        'summary': 'collect health information on cf internal services',
> +        'description': '',
> +        'jobs': [{
> +            'job_name': 'collector',
> +            'ports': [],
> +            'mapping': {},
> +            'provided_data': [],
> +            'required_data': [contexts.NatsRelation,
> +                              contexts.GraphiteRelation,
> +                              contexts.OrchestratorRelation]
> +            }]
> +    }
>  }
> 
> === added file 'docs/debugging.rst'
> --- docs/debugging.rst	1970-01-01 00:00:00 +0000
> +++ docs/debugging.rst	2014-11-12 22:03:54 +0000
> @@ -0,0 +1,8 @@
> +==================
> + Cloud controller
> +==================
> +
> +The cc console
> +==============
> +
> +bin/console /var/vcap/jobs/cloud_controller_ng/config/cloud_controller_ng.yml

This could use more explanation.  I have no idea what this is for, and it's not clear where it needs to be run.

> 
> === modified file 'hooks/common.py'
> --- hooks/common.py	2014-11-06 23:37:55 +0000
> +++ hooks/common.py	2014-11-12 22:03:54 +0000
> @@ -14,7 +14,8 @@
>  from cloudfoundry.releases import RELEASES
>  from cloudfoundry.services import SERVICES
>  from cloudfoundry.contexts import JujuAPICredentials
> -from cloudfoundry.contexts import OrchestratorRelation, CloudFoundryCredentials
> +from cloudfoundry.contexts import OrchestratorRelation
> +from cloudfoundry.contexts import CloudFoundryCredentials
>  from cloudfoundry.contexts import RequiredConfig
>  from cloudfoundry.path import path
>  from cloudfoundry.utils import wait_for
> 
> === modified file 'reconciler/app.py'
> --- reconciler/app.py	2014-11-03 16:13:57 +0000
> +++ reconciler/app.py	2014-11-12 22:03:54 +0000
> @@ -78,10 +78,14 @@
>  
>  def poll_health():
>      for service_name, service in db.real['Services'].iteritems():
> -        for unit_name, unit in service.get('Units', {}).iteritems():
> +        logging.debug("Poll health for %s: %s", service_name, service)
> +        units = service.get('Units', {}) or {}
> +        for unit_name, unit in units.iteritems():
>              unit_addr = unit.get('PublicAddress')
>              if unit_addr:
> -                tornado.ioloop.IOLoop.instance().add_callback(check_health, service_name, unit_name, unit_addr)
> +                loop = tornado.ioloop.IOLoop.instance()
> +                loop.add_callback(check_health, service_name,
> +                                  unit_name, unit_addr)
>  
>  
>  def check_health(service_name, unit_name, unit_addr):
> 
> === modified file 'tests/test_contexts.py'
> --- tests/test_contexts.py	2014-11-04 15:36:48 +0000
> +++ tests/test_contexts.py	2014-11-12 22:03:54 +0000
> @@ -240,10 +240,13 @@
>          gv.return_value = 'version'
>          gd.return_value = 'domain'
>          path.return_value.__div__.return_value.text.return_value = 'mock_key'
> -        result = contexts.OrchestratorRelation().provide_data()
> +        with mock.patch('charmhelpers.core.hookenv.service_name') as hs:
> +            hs.return_value = 'cf'
> +            result = contexts.OrchestratorRelation().provide_data()
>          self.assertEqual(result, {
>              'artifacts_url': 'artifacts_url',
>              'cf_version': 'version',
> +            'deployment_name': 'cf',
>              'domain': 'domain',
>              'ssh_key': 'mock_key',
>          })
> 
> === modified file 'wheelhouse/args-0.1.0-py2-none-any.whl'
> Binary files wheelhouse/args-0.1.0-py2-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/args-0.1.0-py2-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === removed file 'wheelhouse/boto-2.32.1-py2.py3-none-any.whl'
> Binary files wheelhouse/boto-2.32.1-py2.py3-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/boto-2.32.1-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === added file 'wheelhouse/boto-2.34.0-py2.py3-none-any.whl'
> Binary files wheelhouse/boto-2.34.0-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/boto-2.34.0-py2.py3-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === removed file 'wheelhouse/clint-0.3.7-py2-none-any.whl'
> Binary files wheelhouse/clint-0.3.7-py2-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/clint-0.3.7-py2-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === added file 'wheelhouse/clint-0.4.1-py2-none-any.whl'
> Binary files wheelhouse/clint-0.4.1-py2-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/clint-0.4.1-py2-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === added file 'wheelhouse/futures-2.2.0-py2.py3-none-any.whl'
> Binary files wheelhouse/futures-2.2.0-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/futures-2.2.0-py2.py3-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === removed file 'wheelhouse/path.py-6.2-py2-none-any.whl'
> Binary files wheelhouse/path.py-6.2-py2-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/path.py-6.2-py2-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === added file 'wheelhouse/path.py-7.0-py2-none-any.whl'
> Binary files wheelhouse/path.py-7.0-py2-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/path.py-7.0-py2-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === removed file 'wheelhouse/raindance-0.2dev-py2-none-any.whl'
> Binary files wheelhouse/raindance-0.2dev-py2-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/raindance-0.2dev-py2-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === added file 'wheelhouse/raindance-0.3dev_r0-py2-none-any.whl'
> Binary files wheelhouse/raindance-0.3dev_r0-py2-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/raindance-0.3dev_r0-py2-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === removed file 'wheelhouse/requests-2.2.1-py2.py3-none-any.whl'
> Binary files wheelhouse/requests-2.2.1-py2.py3-none-any.whl	2014-06-25 07:08:08 +0000 and wheelhouse/requests-2.2.1-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === removed file 'wheelhouse/requests-2.4.1-py2.py3-none-any.whl'
> Binary files wheelhouse/requests-2.4.1-py2.py3-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/requests-2.4.1-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 differ
> === added file 'wheelhouse/requests-2.4.3-py2.py3-none-any.whl'
> Binary files wheelhouse/requests-2.4.3-py2.py3-none-any.whl	1970-01-01 00:00:00 +0000 and wheelhouse/requests-2.4.3-py2.py3-none-any.whl	2014-11-12 22:03:54 +0000 differ
> === modified file 'wheelhouse/subparse-0.3.3-py2-none-any.whl'
> Binary files wheelhouse/subparse-0.3.3-py2-none-any.whl	2014-09-30 21:15:05 +0000 and wheelhouse/subparse-0.3.3-py2-none-any.whl	2014-11-12 22:03:54 +0000 differ


-- 
https://code.launchpad.net/~whitmo/charms/trusty/cloudfoundry/add-collector/+merge/241628
Your team Cloud Foundry Charmers is subscribed to branch lp:~cf-charmers/charms/trusty/cloudfoundry/trunk.


References