Github user kwmonroe commented on a diff in the pull request:

    https://github.com/apache/bigtop/pull/137#discussion_r81862021
  
    --- Diff: 
bigtop-packages/src/charm/zeppelin/layer-zeppelin/lib/charms/layer/bigtop_zeppelin.py
 ---
    @@ -0,0 +1,238 @@
    +# Licensed to the Apache Software Foundation (ASF) under one or more
    +# contributor license agreements.  See the NOTICE file distributed with
    +# this work for additional information regarding copyright ownership.
    +# The ASF licenses this file to You under the Apache License, Version 2.0
    +# (the "License"); you may not use this file except in compliance with
    +# the License.  You may obtain a copy of the License at
    +#
    +#     http://www.apache.org/licenses/LICENSE-2.0
    +#
    +# Unless required by applicable law or agreed to in writing, software
    +# distributed under the License is distributed on an "AS IS" BASIS,
    +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    +# See the License for the specific language governing permissions and
    +# limitations under the License.
    +
    +import os
    +import json
    +import time
    +import socket
    +from urllib.parse import urljoin
    +
    +import requests
    +from path import Path
    +
    +from jujubigdata import utils
    +from charmhelpers.core import hookenv, host, unitdata
    +from charms import layer
    +from charms.layer.apache_bigtop_base import Bigtop
    +
    +
    +class Zeppelin(object):
    +    """
    +    This class manages Zeppelin.
    +    """
    +    def __init__(self):
    +        self.dist_config = utils.DistConfig(
    +            data=layer.options('apache-bigtop-base'))
    +
    +    def _add_override(self, name, value):
    +        unitdata.kv().update({
    +            name: value,
    +        }, prefix='zeppelin.bigtop.overrides.')
    +
    +    def install(self):
    +        '''
    +        Trigger the Bigtop puppet recipe that handles the Zepplin service.
    +        '''
    +        # Dirs are handled by the bigtop deb. No need to call out to
    +        # dist_config to do that work.
    +        self.dist_config.add_users()
    +        self.trigger_bigtop()
    --- End diff --
    
    If some poor soul changes our layer.yaml ports, they're in trouble.  Let's 
honor them by actually setting the chosen port in an override before calling 
`self.trigger_bigtop()` here.  Something like:
    
    ```python
    self._add_override('zeppelin::server::server_port', 
self.dist_config.port('zeppelin'))
    self._add_override('zeppelin::server::web_socket_port', 
self.dist_config.port('zeppelin_web'))
    ```
    
    Those should be the correct overrides, as defined in zeppelin's init.pp 
here:
    
    
https://github.com/apache/bigtop/blob/master/bigtop-deploy/puppet/modules/zeppelin/manifests/init.pp#L26



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to