ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alejandro Fernandez <afernan...@hortonworks.com>
Subject Re: Ambari 2.4 - custom service and condition package instalation
Date Mon, 09 Jan 2017 19:16:13 GMT
Hi Lukas,

It's not finding the method names "should_install_supervisor", "should_install_apache"

Did you add them to this list?

__all__ = ["is_lzo_enabled", "should_install_phoenix", "should_install_ams_collector", "should_install_ams_grafana",
           "should_install_mysql", "should_install_mysql_connector", "should_install_ranger_tagsync"]


Thanks,

Alejandro

From: Lukáš Drbal <lukas.drbal@gmail.com<mailto:lukas.drbal@gmail.com>>
Reply-To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Date: Monday, January 9, 2017 at 8:17 AM
To: "user@ambari.apache.org<mailto:user@ambari.apache.org>" <user@ambari.apache.org<mailto:user@ambari.apache.org>>
Subject: Ambari 2.4 - custom service and condition package instalation

Hi,

i have custom service which provides more components [1].
All components are installed from deb packages and i don't wanna install all packages on all
nodes (just component specific) so i try to use condition [2] but it ends with error:
"resource_management.core.exceptions.Fail: Condition with name 'should_install_confluent_supervisor',
when installing package supervisor. Please check package_conditions.py."

I check source code and it look's [3] like there is hardcoded package "resource_management.libraries.functions".

In 2.2 i was able to use param exclude_packages in install method. How i can achieve same
functionality in 2.4? Did i miss something?

Thanks for help.

[1]
I have list of all packages in metainfo.xml
For example:
<osSpecifics>
  <osSpecific>
    <osFamily>ubuntu14</osFamily>
    <packages>
      <package>
        <name>supervisor</name>
        <condition>should_install_supervisor</condition>
      </package>
      <package>
        <name>apache</name>
        <condition>should_install_apache</condition>
      </package>
    </packages>
  </<osSpecific>
</osSpecifics>

def should_install_supervisor():
    config = Script.get_config()
    # _has_applicable_local_component is copied from ambari-common/src/main/python/resource_management/libraries/functions/package_conditions.py
    return _has_applicable_local_component(config, ["MY_SERVICE"])

[3]  https://github.com/apache/ambari/blob/release-2.4.2/ambari-common/src/main/python/resource_management/libraries/script/script.py#L592

--
Save The World - http://www.worldcommunitygrid.org/
http://www.worldcommunitygrid.org/stat/viewMemberInfo.do?userName=LesTR

LesTR

Mime
View raw message