[ambari] branch trunk updated: AMBARI-24707. Build fails due to missing ambari-utility (#2395)
This is an automated email from the ASF dual-hosted git repository. adoroszlai pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new 06ea839 AMBARI-24707. Build fails due to missing ambari-utility (#2395) 06ea839 is described below commit 06ea8398cb82975f14524e323614ac0812b2357c Author: Doroszlai, Attila <6454655+adorosz...@users.noreply.github.com> AuthorDate: Fri Sep 28 07:51:36 2018 +0200 AMBARI-24707. Build fails due to missing ambari-utility (#2395) --- pom.xml | 5 + 1 file changed, 5 insertions(+) diff --git a/pom.xml b/pom.xml index cba30bc..36a928d 100644 --- a/pom.xml +++ b/pom.xml @@ -420,6 +420,7 @@ ambari-serviceadvisor +ambari-utility ambari-web ambari-project ambari-views @@ -440,6 +441,7 @@ ambari-serviceadvisor +ambari-utility ambari-web ambari-project ambari-views @@ -462,6 +464,7 @@ ambari-funtest ambari-agent ambari-serviceadvisor +ambari-utility @@ -481,6 +484,7 @@ ambari-funtest ambari-agent ambari-serviceadvisor +ambari-utility @@ -498,6 +502,7 @@ ambari-serviceadvisor +ambari-utility ambari-web ambari-project ambari-views
[ambari] branch branch-2.7 updated: Branch 2.7 cherry picked commits (#2396)
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch branch-2.7 in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/branch-2.7 by this push: new 0e77456 Branch 2.7 cherry picked commits (#2396) 0e77456 is described below commit 0e7745639ed3f5fe56bd1e5578590b6e5780642c Author: avijayanhwx AuthorDate: Thu Sep 27 22:12:07 2018 -0700 Branch 2.7 cherry picked commits (#2396) * [AMBARI-24653] YARN Timeline server v2 related system tests fail. (#2367) * [AMBARI-24653] YARN Timeline server v2 related system tests fail. * [AMBARI-24653] YARN Timeline server v2 related system tests fail. * AMBARI-24661. While registering agent can miss updates from server (aonishuk) * [AMBARI-24679] Fix race condition in agent during registration and topology updates. (#2368) --- .../main/python/ambari_agent/HeartbeatThread.py| 23 - .../main/python/ambari_agent/listeners/__init__.py | 40 +- .../src/main/resources/scripts/Ambaripreupload.py | 1 + 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/ambari-agent/src/main/python/ambari_agent/HeartbeatThread.py b/ambari-agent/src/main/python/ambari_agent/HeartbeatThread.py index 2d4e06b..ded5edd 100644 --- a/ambari-agent/src/main/python/ambari_agent/HeartbeatThread.py +++ b/ambari-agent/src/main/python/ambari_agent/HeartbeatThread.py @@ -134,15 +134,22 @@ class HeartbeatThread(threading.Thread): self.handle_registration_response(response) for endpoint, cache, listener, subscribe_to in self.post_registration_requests: - # should not hang forever on these requests - response = self.blocking_request({'hash': cache.hash}, endpoint, log_handler=listener.get_log_message) try: -listener.on_event({}, response) - except: -logger.exception("Exception while handing response to request at {0}. {1}".format(endpoint, response)) -raise - - self.subscribe_to_topics([subscribe_to]) +listener.enabled = False +self.subscribe_to_topics([subscribe_to]) +response = self.blocking_request({'hash': cache.hash}, endpoint, log_handler=listener.get_log_message) + +try: + listener.on_event({}, response) +except: + logger.exception("Exception while handing response to request at {0}. {1}".format(endpoint, response)) + raise + finally: +with listener.event_queue_lock: + logger.info("Enabling events for listener {0}".format(listener)) + listener.enabled = True + # Process queued messages if any + listener.dequeue_unprocessed_events() self.subscribe_to_topics(Constants.POST_REGISTRATION_TOPICS_TO_SUBSCRIBE) diff --git a/ambari-agent/src/main/python/ambari_agent/listeners/__init__.py b/ambari-agent/src/main/python/ambari_agent/listeners/__init__.py index 7e66197..b50bdaa 100644 --- a/ambari-agent/src/main/python/ambari_agent/listeners/__init__.py +++ b/ambari-agent/src/main/python/ambari_agent/listeners/__init__.py @@ -25,15 +25,40 @@ import copy from ambari_stomp.adapter.websocket import ConnectionIsAlreadyClosed from ambari_agent import Constants from ambari_agent.Utils import Utils +from Queue import Queue +import threading logger = logging.getLogger(__name__) class EventListener(ambari_stomp.ConnectionListener): + + unprocessed_messages_queue = Queue(100) + """ Base abstract class for event listeners on specific topics. """ def __init__(self, initializer_module): self.initializer_module = initializer_module +self.enabled = True +self.event_queue_lock = threading.RLock() + + def dequeue_unprocessed_events(self): +while not self.unprocessed_messages_queue.empty(): + payload = self.unprocessed_messages_queue.get_nowait() + if payload: +logger.info("Processing event from unprocessed queue {0} {1}".format(payload[0], payload[1])) +destination = payload[0] +headers = payload[1] +message_json = payload[2] +message = payload[3] +try: + self.on_event(headers, message_json) +except Exception as ex: + logger.exception("Exception while handing event from {0} {1} {2}".format(destination, headers, message)) + self.report_status_to_sender(headers, message, ex) +else: + self.report_status_to_sender(headers, message) + def on_message(self, headers, message): """ @@ -55,10 +80,23 @@ class EventListener(ambari_stomp.ConnectionListener): return logger.info("Event from server at {0}{1}".format(destination, self.get_log_message(headers, copy.deepcopy(message_json + + if not self.enabled: +with self.event_queue_lock: + if not self.enabled: +logger.info("Queuing event as unprocessed {0} since event " +
[ambari-metrics] branch master updated: Update README.md
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git The following commit(s) were added to refs/heads/master by this push: new 7c9b16d Update README.md 7c9b16d is described below commit 7c9b16d0ff5664979c194ab848550033ac0667f9 Author: avijayanhwx AuthorDate: Thu Sep 27 22:06:10 2018 -0700 Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b5f0f41..1c3911f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# ambari-metrics -Apache Ambari subproject - Ambari Metrics +# Apache Ambari Metrics +Apache Ambari subproject [![Build Status](https://builds.apache.org/buildStatus/icon?job=Ambari-Metrics-master-Commit)](https://builds.apache.org/view/A/view/Ambari/job/Ambari-Metrics-master-Commit/) ![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg)
[ambari-metrics] branch master updated: Update README.md
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git The following commit(s) were added to refs/heads/master by this push: new 219875e Update README.md 219875e is described below commit 219875e3c81428d19e027fee4a1e2e95690a15ad Author: avijayanhwx AuthorDate: Thu Sep 27 22:05:10 2018 -0700 Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index f8158ca..b5f0f41 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,9 @@ # ambari-metrics Apache Ambari subproject - Ambari Metrics +[![Build Status](https://builds.apache.org/buildStatus/icon?job=Ambari-Metrics-master-Commit)](https://builds.apache.org/view/A/view/Ambari/job/Ambari-Metrics-master-Commit/) +![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg) + **Ambari Metrics System** ("AMS") is a system for collecting, aggregating, serving and visualizing daemon and system metrics in Ambari-managed clusters. The original JIRA Epic for Ambari Metrics System can be found here: https://issues.apache.org/jira/browse/AMBARI-5707
[ambari-metrics] branch master updated: [AMBARI-24705] Fix build issues in ambari-metrics repo. (#2)
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git The following commit(s) were added to refs/heads/master by this push: new e4ff317 [AMBARI-24705] Fix build issues in ambari-metrics repo. (#2) e4ff317 is described below commit e4ff3177e202ad7bcbdf5498d99608f648967861 Author: avijayanhwx AuthorDate: Thu Sep 27 16:10:07 2018 -0700 [AMBARI-24705] Fix build issues in ambari-metrics repo. (#2) * [AMBARI-24705] Fix build issues in ambari-metrics repo. * [AMBARI-24705] Fix build issues in ambari-metrics repo. (Make ambari-python-wrap executable) --- ambari-metrics-assembly/pom.xml| 187 +- .../src/main/assembly/collector-windows-choco.xml | 51 -- .../src/main/assembly/collector-windows.xml| 112 .../src/main/assembly/monitor-windows-choco.xml| 51 -- .../src/main/assembly/monitor-windows.xml | 89 --- .../src/main/assembly/sink-windows-choco.xml | 51 -- .../src/main/assembly/sink-windows.xml | 69 --- .../conf/windows/ambari-metrics-monitor.cmd| 17 - .../conf/windows/metric_groups.conf| 19 - .../conf/windows/metric_monitor.ini| 33 -- ambari-metrics-host-monitoring/pom.xml | 74 +-- .../src/main/python/amhm_service.py| 189 -- .../src/main/python/core/config_reader.py | 18 - .../src/main/python/core/stop_handler.py | 40 -- .../src/main/unix/ambari-python-wrap | 35 +- .../src/test/python/core/TestEmitter.py| 6 +- .../src/test/python/unitTests.py | 8 +- .../conf/windows/ambari-metrics-collector.cmd | 17 - .../conf/windows/ams-env.cmd | 16 - .../conf/windows/ams-site.xml | 25 - .../conf/windows/ams.properties| 17 - .../conf/windows/amshbase_metrics_whitelist| 162 - .../conf/windows/metrics_whitelist | 654 - ambari-metrics-timelineservice/pom.xml | 56 -- pom.xml| 39 +- src/main/assemblies/empty.xml | 21 + 26 files changed, 92 insertions(+), 1964 deletions(-) diff --git a/ambari-metrics-assembly/pom.xml b/ambari-metrics-assembly/pom.xml index 4f36e5a..6244649 100644 --- a/ambari-metrics-assembly/pom.xml +++ b/ambari-metrics-assembly/pom.xml @@ -54,6 +54,7 @@ ambari-metrics-storm-sink-with-common-${project.version}.jar ambari-metrics-flume-sink-with-common-${project.version}.jar ambari-metrics-kafka-sink-with-common-${project.version}.jar + ${monitor.dir}/target/ambari-python/site-packages/ambari_commons @@ -589,9 +590,7 @@ ${resmonitor.install.dir}/ambari_commons - - ${project.basedir}/../../ambari-common/src/main/python/ambari_commons - + ${ambari.commons.location} @@ -736,7 +735,7 @@ directory - ${project.basedir}/../../ambari-common/src/main/python/ambari_commons + ${ambari.commons.location} perm ${resmonitor.install.dir}/ambari_commons @@ -1049,7 +1048,7 @@ linux / : - ${project.basedir}/../ambari-common/src/main/unix/ambari-python-wrap + ${monitor.dir}/src/main/unix/ambari-python-wrap sh sh @@ -1108,184 +1107,6 @@ - - windows - - - win - - - -win -\ -; -python -cmd -cmd -.cmd - src/main/assembly/collector-windows.xml - src/main/assembly/monitor-windows.xml - src/main/assembly/sink-windows.xml - src/main/assembly/collector-windows-choco.xml - src/main/assembly/monitor-windows-choco.xml - src/main/assembly/sink-windows-choco.xml -jar -2.7 - - - - -org.apache.maven.plugins -maven-antrun-plugin -1.7 - - -download-hadoop -generate-resources - - run - - - - - - - - - - - - - - - - choco - - - Windows - - - - - -
[ambari-infra] branch master updated: Update README.md
This is an automated email from the ASF dual-hosted git repository. oleewere pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-infra.git The following commit(s) were added to refs/heads/master by this push: new 7d5083e Update README.md 7d5083e is described below commit 7d5083e0d1f76e55b354430fb14979859e55f0d5 Author: Olivér Szabó AuthorDate: Thu Sep 27 22:47:33 2018 +0200 Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4530715..484f038 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Core shared service used by Ambari managed components. (Infra Solr and Infra Manager) +Ambari Infra is a sub-project of [Apache Ambari](https://github.com/apache/ambari) + ## Development Requires JDK 8 @@ -24,4 +26,4 @@ mvn clean package -Dbuild-deb ## License - http://ambari.apache.org/license.html -- See more at [Ambari repository](https://github.com/apache/ambari) \ No newline at end of file +- See more at [Ambari repository](https://github.com/apache/ambari)
[ambari-infra] branch master updated: Add README.md and LICENSE
This is an automated email from the ASF dual-hosted git repository. oleewere pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-infra.git The following commit(s) were added to refs/heads/master by this push: new dbb361f Add README.md and LICENSE dbb361f is described below commit dbb361fb83e92f93b801b353d28bbeb9da65f935 Author: Oliver Szabo AuthorDate: Thu Sep 27 22:38:25 2018 +0200 Add README.md and LICENSE --- LICENSE | 720 +++ README.md| 27 ++ ambari-infra-assembly/pom.xml| 2 +- ambari-infra-solr-plugin/pom.xml | 2 +- pom.xml | 2 + 5 files changed, 751 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..294538f --- /dev/null +++ b/LICENSE @@ -0,0 +1,720 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor
[ambari] branch trunk updated: [AMBARI-24706] Fix issues in ambari common python package publishing utility. (#2394)
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new ece44a9 [AMBARI-24706] Fix issues in ambari common python package publishing utility. (#2394) ece44a9 is described below commit ece44a9a217423f54f8eb01a3fd17dbe53c1ee93 Author: avijayanhwx AuthorDate: Thu Sep 27 12:11:59 2018 -0700 [AMBARI-24706] Fix issues in ambari common python package publishing utility. (#2394) --- install-ambari-python.sh | 2 +- setup.py | 6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/install-ambari-python.sh b/install-ambari-python.sh index eb7e853..c5d9e99 100755 --- a/install-ambari-python.sh +++ b/install-ambari-python.sh @@ -97,7 +97,7 @@ function deploy() { local version="$2" local repo_id="$3" local repo_url="$4" - mvn deploy:deploy-file -Dfile=$artifact_file -Dpackaging=tar.gz -DgeneratePom=true -Dversion=$version -DartifactId=ambari-python -DgroupId=org.apache.ambari -Durl="$repo_url" -DrepositoryId="$repo_url" + mvn gpg:sign-and-deploy-file -Dfile=$artifact_file -Dpackaging=tar.gz -DgeneratePom=true -Dversion=$version -DartifactId=ambari-python -DgroupId=org.apache.ambari -Durl="$repo_url" -DrepositoryId="$repo_url" } function run_setup_py() { diff --git a/setup.py b/setup.py index 0b7f2eb..47fc82d 100755 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ from setuptools import find_packages, setup AMBARI_COMMON_PYTHON_FOLDER = "ambari-common/src/main/python" AMBARI_SERVER_TEST_PYTHON_FOLDER = "ambari-server/src/test/python" +AMBARI_COMMON_TEST_PYTHON_FOLDER = "ambari-common/src/test/python" def get_ambari_common_packages(): return find_packages(AMBARI_COMMON_PYTHON_FOLDER, exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) @@ -31,7 +32,7 @@ def get_ambari_server_stack_package(): return ["stacks.utils"] def get_extra_common_packages(): - return ["urlinfo_processor", "ambari_jinja2", "ambari_jinja2._markupsafe"] + return ["urlinfo_processor", "ambari_jinja2", "ambari_jinja2._markupsafe", "mock", "mock.test"] def create_package_dir_map(): package_dirs = {} @@ -45,6 +46,8 @@ def create_package_dir_map(): package_dirs["ambari_jinja2"] = AMBARI_COMMON_PYTHON_FOLDER + "/ambari_jinja2/ambari_jinja2" package_dirs["ambari_jinja2._markupsafe"] = AMBARI_COMMON_PYTHON_FOLDER + "/ambari_jinja2/ambari_jinja2/_markupsafe" package_dirs["urlinfo_processor"] = AMBARI_COMMON_PYTHON_FOLDER + "/urlinfo_processor" + package_dirs["mock"] = AMBARI_COMMON_TEST_PYTHON_FOLDER + "/mock" + package_dirs["mock.test"] = AMBARI_COMMON_TEST_PYTHON_FOLDER + "/mock/tests" return package_dirs @@ -102,7 +105,6 @@ setup( packages = get_ambari_common_packages() + get_ambari_server_stack_package() + get_extra_common_packages(), package_dir = create_package_dir_map(), install_requires=[ - 'mock==1.0.1', 'coilmq==1.0.1' ], include_package_data = True,
[ambari-metrics] branch master updated: Create LICENSE.txt
This is an automated email from the ASF dual-hosted git repository. avijayan pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-metrics.git The following commit(s) were added to refs/heads/master by this push: new 258c1e8 Create LICENSE.txt 258c1e8 is described below commit 258c1e880a531b5c93996fbe0f7b00200f04cc04 Author: avijayanhwx AuthorDate: Thu Sep 27 11:00:08 2018 -0700 Create LICENSE.txt --- LICENSE.txt | 201 1 file changed, 201 insertions(+) diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 000..261eeb9 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use,
[ambari] branch branch-feature-AMBARI-14714 updated (2e6ddbb -> c706f41)
This is an automated email from the ASF dual-hosted git repository. swapan pushed a change to branch branch-feature-AMBARI-14714 in repository https://gitbox.apache.org/repos/asf/ambari.git. from 2e6ddbb [AMBARI 24678] Config group mapping should allow multiple service instances (benyoka) add a520f0e AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. (mpapirkovskyy) add 07b7009 AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. (mpapirkovskyy) add a1c0475 AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. (mpapirkovskyy) new c706f41 AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .../python/ambari_agent/ConfigurationBuilder.py| 6 +- .../ambari/server/agent/ExecutionCommand.java | 23 --- .../ambari/server/agent/HeartbeatMonitor.java | 178 - .../server/agent/stomp/HostLevelParamsHolder.java | 52 +- .../ambari/server/agent/stomp/MetadataHolder.java | 3 + .../ambari/server/agent/stomp/TopologyHolder.java | 2 + .../agent/stomp/dto/HostLevelParamsCluster.java| 12 +- .../server/agent/stomp/dto/MetadataCluster.java| 44 - .../server/agent/stomp/dto/TopologyComponent.java | 15 ++ .../AmbariCustomCommandExecutionHelper.java| 6 - .../controller/AmbariManagementController.java | 10 -- .../controller/AmbariManagementControllerImpl.java | 98 +--- .../controller/internal/HostResourceProvider.java | 3 +- .../UpgradePlanInstallResourceProvider.java| 9 -- .../ambari/server/events/MetadataUpdateEvent.java | 3 +- .../upgrade/MpackInstallStateListener.java | 34 +++- .../server/metadata/ClusterMetadataGenerator.java | 73 ++--- .../org/apache/ambari/server/state/Cluster.java| 6 +- .../ambari/server/state/ServiceComponentHost.java | 7 + .../ambari/server/state/ServiceGroupImpl.java | 1 + .../ambari/server/state/cluster/ClusterImpl.java | 29 +++- .../svccomphost/ServiceComponentHostImpl.java | 5 + .../ambari/server/agent/TestHeartbeatHandler.java | 4 +- .../ambari/server/agent/TestHeartbeatMonitor.java | 14 +- .../agent/stomp/HostLevelParamsHolderTest.java | 20 +-- .../controller/AmbariManagementControllerTest.java | 80 - .../apache/ambari/server/orm/OrmTestHelper.java| 1 + .../ambari/server/state/cluster/ClustersTest.java | 4 +- 28 files changed, 238 insertions(+), 504 deletions(-)
[ambari] 01/01: AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates.
This is an automated email from the ASF dual-hosted git repository. swapan pushed a commit to branch branch-feature-AMBARI-14714 in repository https://gitbox.apache.org/repos/asf/ambari.git commit c706f41366616dc21206a74bac9081decb072692 Merge: 2e6ddbb a1c0475 Author: swapanshridhar AuthorDate: Thu Sep 27 10:50:54 2018 -0700 AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. AMBARI-24651. Add cluster and stack settings properties to agent STOMP updates. .../python/ambari_agent/ConfigurationBuilder.py| 6 +- .../ambari/server/agent/ExecutionCommand.java | 23 --- .../ambari/server/agent/HeartbeatMonitor.java | 178 - .../server/agent/stomp/HostLevelParamsHolder.java | 52 +- .../ambari/server/agent/stomp/MetadataHolder.java | 3 + .../ambari/server/agent/stomp/TopologyHolder.java | 2 + .../agent/stomp/dto/HostLevelParamsCluster.java| 12 +- .../server/agent/stomp/dto/MetadataCluster.java| 44 - .../server/agent/stomp/dto/TopologyComponent.java | 15 ++ .../AmbariCustomCommandExecutionHelper.java| 6 - .../controller/AmbariManagementController.java | 10 -- .../controller/AmbariManagementControllerImpl.java | 98 +--- .../controller/internal/HostResourceProvider.java | 3 +- .../UpgradePlanInstallResourceProvider.java| 9 -- .../ambari/server/events/MetadataUpdateEvent.java | 3 +- .../upgrade/MpackInstallStateListener.java | 34 +++- .../server/metadata/ClusterMetadataGenerator.java | 73 ++--- .../org/apache/ambari/server/state/Cluster.java| 6 +- .../ambari/server/state/ServiceComponentHost.java | 7 + .../ambari/server/state/ServiceGroupImpl.java | 1 + .../ambari/server/state/cluster/ClusterImpl.java | 29 +++- .../svccomphost/ServiceComponentHostImpl.java | 5 + .../ambari/server/agent/TestHeartbeatHandler.java | 4 +- .../ambari/server/agent/TestHeartbeatMonitor.java | 14 +- .../agent/stomp/HostLevelParamsHolderTest.java | 20 +-- .../controller/AmbariManagementControllerTest.java | 80 - .../apache/ambari/server/orm/OrmTestHelper.java| 1 + .../ambari/server/state/cluster/ClustersTest.java | 4 +- 28 files changed, 238 insertions(+), 504 deletions(-)
[ambari] branch trunk updated: [AMBARI-24696] UI: Options Page to choose Rolling or Express Restart. (#2389)
This is an automated email from the ASF dual-hosted git repository. ishanbha pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new 0a271d4 [AMBARI-24696] UI: Options Page to choose Rolling or Express Restart. (#2389) 0a271d4 is described below commit 0a271d4a6ed22120b3a841b5c2ca800fcd8952cc Author: Ishan Bhatt AuthorDate: Thu Sep 27 09:54:43 2018 -0700 [AMBARI-24696] UI: Options Page to choose Rolling or Express Restart. (#2389) * [AMBARI-24696] UI: Options Page to choose Rolling or Express Restart. * Small tweaks * Added new files to git. --- ambari-web/app/config.js |3 +- ambari-web/app/controllers/main/service/item.js|5 + ambari-web/app/messages.js |7 + ambari-web/app/models/host_component.js|8 + ambari-web/app/styles/application.less | 34 + .../app/templates/common/service_restart.hbs | 39 + ambari-web/app/utils/batch_scheduled_requests.js | 16 + ambari-web/app/views.js|1 + .../app/views/common/service_restart_view.js | 51 + ambari-web/app/views/main/service/item.js |4 + ambari-web/brunch-config.js|1 + ambari-web/vendor/styles/font-awesome-4.css| 2337 12 files changed, 2505 insertions(+), 1 deletion(-) diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js index 807b841..f368a63 100644 --- a/ambari-web/app/config.js +++ b/ambari-web/app/config.js @@ -92,7 +92,8 @@ App.supports = { manageJournalNode: true, enableToggleKerberos: true, enableAddDeleteServices: true, - regenerateKeytabsOnSingleHost: false + regenerateKeytabsOnSingleHost: false, + enableNewServiceRestartOptions: false }; if (App.enableExperimental) { diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js index b4d059c..6fb0522 100644 --- a/ambari-web/app/controllers/main/service/item.js +++ b/ambari-web/app/controllers/main/service/item.js @@ -966,6 +966,11 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow } }, + chooseAndRestartHostComponents: function () { +let serviceName = this.get('serviceName'); +batchUtils.showServicRestartPopup(serviceName); + }, + restartCertainHostComponents: function (context) { const serviceDisplayName = this.get('content.displayName'), {components, hosts, label, serviceName} = context; diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 4b8deb5..bbcece5 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -370,6 +370,7 @@ Em.I18n.translations = { 'common.critical.error': 'Critical', 'common.with': 'with', 'common.propertyName': 'Property Name', + 'common.configure.restart': 'Configure Restart', 'models.alert_instance.tiggered.verbose': "Occurred on {0} Checked on {1}", 'models.alert_definition.triggered.verbose': "Occurred on {0}", @@ -3279,6 +3280,12 @@ Em.I18n.translations = { 'rollingrestart.context.selectedComponentOnSelectedHost':'Restart {0}', 'rollingrestart.context.default':'Restart components', + 'service.restart.choose.text': 'Please choose which type of restart should be performed.', + 'service.rolling.restart.choose.info': 'Critical services remain running while the upgrade is performed. Minimized disruption, but is a slower upgrade.', + 'service.express.restart.choose.info': 'Services are stopped when this upgrade is performed. Incurs downtime, but is a faster upgrade.', + 'service.restart.show.advanced.info': 'Show advanced configurations options (Restart by batches/hosts, interval between restarts, etc.)', + + 'rolling.command.context': 'Rolling set {0} to state "{1}" - batch {2} of {3}', 'rolling.nothingToDo.header': 'Nothing to do', 'rolling.nothingToDo.body': '{0} on selected hosts are already in selected state or in Maintenance Mode.', diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js index cc054a3..c5d3090 100644 --- a/ambari-web/app/models/host_component.js +++ b/ambari-web/app/models/host_component.js @@ -356,6 +356,14 @@ App.HostComponentActionMap = { hasSubmenu: hasMultipleMasterComponentGroups, submenuOptions: hasMultipleMasterComponentGroups ? this.getMastersSubmenu(ctx, 'restartCertainHostComponents') : [] }, + //Ongoing feature. Will later replace RESTART_ALL + RESTART_SERVICE: { +action: 'chooseAndRestartHostComponents', +context: ctx.get('serviceName'), +label: Em.I18n.t('restart.service.rest.context').format(ctx.get('displayName')), +cssClass: 'glyphicon glyphicon-time', +disabled: false + }, RESTART_NAMENODES: {
[ambari-logsearch] branch master updated: Add LICENSE and references to original Ambari repository
This is an automated email from the ASF dual-hosted git repository. oleewere pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-logsearch.git The following commit(s) were added to refs/heads/master by this push: new de65e27 Add LICENSE and references to original Ambari repository de65e27 is described below commit de65e27b90388b5ec68bfd5de69f9485f8021898 Author: Oliver Szabo AuthorDate: Thu Sep 27 17:02:38 2018 +0200 Add LICENSE and references to original Ambari repository --- LICENSE | 720 ++ README.md | 9 +- pom.xml | 1 + 3 files changed, 729 insertions(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE new file mode 100644 index 000..294538f --- /dev/null +++ b/LICENSE @@ -0,0 +1,720 @@ + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive,
[ambari] branch trunk updated: AMBARI-24466. Add README.md for Ambari project (#2390)
This is an automated email from the ASF dual-hosted git repository. oleewere pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new 88f1d46 AMBARI-24466. Add README.md for Ambari project (#2390) 88f1d46 is described below commit 88f1d461df878065333b9766039eb31783b63ebb Author: Olivér Szabó AuthorDate: Thu Sep 27 15:52:11 2018 +0200 AMBARI-24466. Add README.md for Ambari project (#2390) * AMBARI-24466 Add README.md for Ambari project * AMBARI-24466. Add sub-project + fix rat issue * AMBARI-24466. Add jenkins build badge. * AMBARI-24466. Us trunk commit build status instead of PR one for jenkins build badge. --- README.md | 43 +++ 1 file changed, 43 insertions(+) diff --git a/README.md b/README.md new file mode 100644 index 000..c31e69f --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ + +# Apache Ambari +[![Build Status](https://builds.apache.org/buildStatus/icon?job=Ambari-trunk-Commit)](https://builds.apache.org/view/A/view/Ambari/job/Ambari-trunk-Commit/) +![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg) + +Apache Ambari is a tool for provisioning, managing, and monitoring Apache Hadoop clusters. Ambari consists of a set of RESTful APIs and a browser-based management interface. + +## Sub-projects + +- Ambari Metrics ([GitHub](https://github.com/apache/ambari-metrics), [GitBox](https://gitbox.apache.org/repos/asf?p=ambari-metrics.git)) +- Ambari Log Search ([GitHub](https://github.com/apache/ambari-logsearch), [GitBox](https://gitbox.apache.org/repos/asf?p=ambari-logsearch.git)) +- Ambari Infra ([GitHub](https://github.com/apache/ambari-infra), [GitBox](https://gitbox.apache.org/repos/asf?p=ambari-infra.git)) + +## Getting Started + +https://cwiki.apache.org/confluence/display/AMBARI/Quick+Start+Guide + +## Built With + +https://cwiki.apache.org/confluence/display/AMBARI/Technology+Stack + +## Contributing + +https://cwiki.apache.org/confluence/display/AMBARI/How+to+Contribute + +## License + +http://ambari.apache.org/license.html
[ambari] branch trunk updated: AMBARI-24672. Regenrating keytabs for services using all of their identities instead of service/component filtering (#2359)
This is an automated email from the ASF dual-hosted git repository. smolnar pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new 91f1902 AMBARI-24672. Regenrating keytabs for services using all of their identities instead of service/component filtering (#2359) 91f1902 is described below commit 91f19026d1dd999e03cd5f09d13fbd8cb5aad43d Author: Sandor Molnar AuthorDate: Thu Sep 27 14:28:24 2018 +0200 AMBARI-24672. Regenrating keytabs for services using all of their identities instead of service/component filtering (#2359) --- .../ambari/server/controller/AmbariServer.java | 2 + .../events/publishers/AgentCommandsPublisher.java | 5 ++- .../server/orm/dao/KerberosKeytabPrincipalDAO.java | 10 - .../kerberos/KerberosServerAction.java | 25 .../stageutils/KerberosKeytabController.java | 44 -- .../ambari/server/agent/TestHeartbeatHandler.java | 5 ++- .../kerberos/KerberosServerActionTest.java | 4 +- 7 files changed, 68 insertions(+), 27 deletions(-) diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java index 07bf2b7..6f5f4e6 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariServer.java @@ -110,6 +110,7 @@ import org.apache.ambari.server.security.authorization.Users; import org.apache.ambari.server.security.unsecured.rest.CertificateDownload; import org.apache.ambari.server.security.unsecured.rest.CertificateSign; import org.apache.ambari.server.security.unsecured.rest.ConnectionInfo; +import org.apache.ambari.server.serveraction.kerberos.stageutils.KerberosKeytabController; import org.apache.ambari.server.stack.UpdateActiveRepoVersionOnStartup; import org.apache.ambari.server.state.Clusters; import org.apache.ambari.server.topology.AmbariContext; @@ -942,6 +943,7 @@ public class AmbariServer { ClusterPrivilegeResourceProvider.init(injector.getInstance(ClusterDAO.class)); AmbariPrivilegeResourceProvider.init(injector.getInstance(ClusterDAO.class)); ActionManager.setTopologyManager(injector.getInstance(TopologyManager.class)); + KerberosKeytabController.setKerberosHelper(injector.getInstance(KerberosHelper.class)); StackAdvisorBlueprintProcessor.init(injector.getInstance(StackAdvisorHelper.class)); ThreadPoolEnabledPropertyProvider.init(injector.getInstance(Configuration.class)); diff --git a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java index 0043f09..231f92c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/events/publishers/AgentCommandsPublisher.java @@ -50,6 +50,7 @@ import org.apache.ambari.server.serveraction.kerberos.stageutils.KerberosKeytabC import org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosKeytab; import org.apache.ambari.server.serveraction.kerberos.stageutils.ResolvedKerberosPrincipal; import org.apache.ambari.server.state.Clusters; +import org.apache.ambari.server.state.kerberos.KerberosIdentityDescriptor; import org.apache.ambari.server.utils.StageUtils; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; @@ -245,8 +246,8 @@ public class AgentCommandsPublisher { try { Map> serviceComponentFilter = getServiceComponentFilter(kerberosCommandParameters.getServiceComponentFilter()); - -Set keytabsToInject = kerberosKeytabController.getFilteredKeytabs(serviceComponentFilter, kerberosCommandParameters.getHostFilter(), kerberosCommandParameters.getIdentityFilter()); +final Collection serviceIdentities = serviceComponentFilter == null ? null : kerberosKeytabController.getServiceIdentities(executionCommand.getClusterName(), serviceComponentFilter.keySet()); +final Set keytabsToInject = kerberosKeytabController.getFilteredKeytabs(serviceIdentities, kerberosCommandParameters.getHostFilter(), kerberosCommandParameters.getIdentityFilter()); for (ResolvedKerberosKeytab resolvedKeytab : keytabsToInject) { for (ResolvedKerberosPrincipal resolvedPrincipal : resolvedKeytab.getPrincipals()) { String hostName = resolvedPrincipal.getHostName(); diff --git a/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java b/ambari-server/src/main/java/org/apache/ambari/server/orm/dao/KerberosKeytabPrincipalDAO.java index 7b1aa45..7a44f2c 100644 ---
[ambari-logsearch] branch master updated: AMBARI-24692. Update docs and fix metrics dependency.
This is an automated email from the ASF dual-hosted git repository. oleewere pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/ambari-logsearch.git The following commit(s) were added to refs/heads/master by this push: new fb9db4b AMBARI-24692. Update docs and fix metrics dependency. fb9db4b is described below commit fb9db4bd047159df0f545a0726392c5adcd13670 Author: Oliver Szabo AuthorDate: Thu Sep 27 13:55:31 2018 +0200 AMBARI-24692. Update docs and fix metrics dependency. --- README.md | 7 +-- ambari-logsearch-logfeeder/pom.xml | 2 +- pom.xml| 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 992f49f..a0d2dc7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,12 @@ # Log Search +[![Build Status](https://builds.apache.org/buildStatus/icon?job=Ambari-LogSearch-master-Commit)](https://builds.apache.org/view/A/view/Ambari/job/Ambari-LogSearch-master-Commit/) +![license](http://img.shields.io/badge/license-Apache%20v2-blue.svg) Log aggregation, analysis, and visualization for Ambari managed (and any other) services. ## Development -Requires JDK 11 +Requires JDK 8 (JDK 11 is recommended) ### Prerequisites @@ -42,15 +44,16 @@ In case if you started the containers separately and if you would like to access ## Package build process - 1. Check out the code from GIT repository 2. On the logsearch root folder (ambari/ambari-logsearch), please execute the following Maven command to build RPM/DPKG: ```bash +# for building with jdk 8, use -Djdk.version=1.8 mvn -Dbuild-rpm clean package ``` or ```bash +# for building with jdk 8, use -Djdk.version=1.8 mvn -Dbuild-deb clean package ``` 3. Generated RPM/DPKG files will be found in ambari-logsearch-assembly/target folder diff --git a/ambari-logsearch-logfeeder/pom.xml b/ambari-logsearch-logfeeder/pom.xml index 0e6fff4..2582bb8 100644 --- a/ambari-logsearch-logfeeder/pom.xml +++ b/ambari-logsearch-logfeeder/pom.xml @@ -142,7 +142,7 @@ org.apache.ambari ambari-metrics-common - ${project.version} + ${ambari-metrics.version} io.minio diff --git a/pom.xml b/pom.xml index 502b16c..0fa9252 100644 --- a/pom.xml +++ b/pom.xml @@ -91,6 +91,7 @@ -Xmx1024m -Xms512m false 3.8.0 +2.7.0.0.0
[ambari] branch trunk updated: [AMBARI-24632] APT/DPKG existence check doesn't work for system packages (dgrinenko) (#2366)
This is an automated email from the ASF dual-hosted git repository. hapylestat pushed a commit to branch trunk in repository https://gitbox.apache.org/repos/asf/ambari.git The following commit(s) were added to refs/heads/trunk by this push: new f277631 [AMBARI-24632] APT/DPKG existence check doesn't work for system packages (dgrinenko) (#2366) f277631 is described below commit f277631dec36a442999327026a030e463e4c67e1 Author: Dmytro Grinenko AuthorDate: Thu Sep 27 12:00:07 2018 +0300 [AMBARI-24632] APT/DPKG existence check doesn't work for system packages (dgrinenko) (#2366) --- .../ambari_commons/repo_manager/apt_manager.py | 16 -- .../ambari_commons/repo_manager/apt_parser.py | 2 +- .../ambari_commons/repo_manager/yum_manager.py | 4 +- .../ambari_commons/repo_manager/zypper_manager.py | 2 +- .../src/main/python/ambari_commons/shell.py| 12 +++- .../custom_actions/scripts/install_packages.py | 5 +- .../python/custom_actions/TestInstallPackages.py | 64 +- 7 files changed, 79 insertions(+), 26 deletions(-) diff --git a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py index 0310af9..5882253 100644 --- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py +++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_manager.py @@ -67,8 +67,6 @@ class AptManagerProperties(GenericManagerProperties): install_cmd_env = {'DEBIAN_FRONTEND': 'noninteractive'} - check_cmd = pkg_manager_bin + " --get-selections | grep -v deinstall | awk '{print $1}' | grep ^%s$" - repo_url_exclude = "ubuntu.com" configuration_dump_cmd = [AMBARI_SUDO_BINARY, "apt-config", "dump"] @@ -237,7 +235,7 @@ class AptManager(GenericManager): if not name: raise ValueError("Installation command was executed with no package name") -elif context.is_upgrade or context.use_repos or not self._check_existence(name): +elif not self._check_existence(name) or context.action_force: cmd = self.properties.install_cmd[context.log_output] copied_sources_files = [] is_tmp_dir_created = False @@ -251,7 +249,7 @@ class AptManager(GenericManager): if use_repos: is_tmp_dir_created = True apt_sources_list_tmp_dir = tempfile.mkdtemp(suffix="-ambari-apt-sources-d") - Logger.info("Temporary sources directory was created: %s" % apt_sources_list_tmp_dir) + Logger.info("Temporary sources directory was created: {}".format(apt_sources_list_tmp_dir)) for repo in use_repos: new_sources_file = os.path.join(apt_sources_list_tmp_dir, repo + '.list') @@ -327,6 +325,12 @@ class AptManager(GenericManager): apt-get in inconsistant state (locked, used, having invalid repo). Once packages are installed we should not rely on that. """ +# this method is more optimised than #installed_packages, as here we do not call available packages(as we do not +# interested in repository, from where package come) +cmd = self.properties.installed_packages_cmd + [name] + +with shell.process_executor(cmd, strategy=shell.ReaderStrategy.BufferedChunks, silent=True) as output: + for package, version in AptParser.packages_installed_reader(output): +return package == name -r = shell.subprocess_executor(self.properties.check_cmd % name) -return not bool(r.code) +return False diff --git a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_parser.py b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_parser.py index 03afb86..29f1a65 100644 --- a/ambari-common/src/main/python/ambari_commons/repo_manager/apt_parser.py +++ b/ambari-common/src/main/python/ambari_commons/repo_manager/apt_parser.py @@ -137,7 +137,7 @@ class AptParser(GenericParser): line = line[2:].lstrip() data = line.partition(" ") - pkg_name = data[0] + pkg_name = data[0].partition(":")[0] # for system packages in format "libuuid1:amd64" version = data[2].strip().partition(" ")[0] if pkg_name and version: diff --git a/ambari-common/src/main/python/ambari_commons/repo_manager/yum_manager.py b/ambari-common/src/main/python/ambari_commons/repo_manager/yum_manager.py index e3df80e..8e2931e 100644 --- a/ambari-common/src/main/python/ambari_commons/repo_manager/yum_manager.py +++ b/ambari-common/src/main/python/ambari_commons/repo_manager/yum_manager.py @@ -208,7 +208,7 @@ class YumManager(GenericManager): if not name: raise ValueError("Installation command was executed with no package name") -elif context.is_upgrade or context.use_repos or not self._check_existence(name): +elif not self._check_existence(name) or context.action_force: cmd = self.properties.install_cmd[context.log_output] if context.use_repos: enable_repo_option =