Return-Path: X-Original-To: apmail-ambari-dev-archive@www.apache.org Delivered-To: apmail-ambari-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CDBFD1179C for ; Thu, 18 Sep 2014 19:42:29 +0000 (UTC) Received: (qmail 26499 invoked by uid 500); 18 Sep 2014 19:42:29 -0000 Delivered-To: apmail-ambari-dev-archive@ambari.apache.org Received: (qmail 26468 invoked by uid 500); 18 Sep 2014 19:42:29 -0000 Mailing-List: contact dev-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list dev@ambari.apache.org Received: (qmail 26446 invoked by uid 99); 18 Sep 2014 19:42:29 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2014 19:42:29 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 5541E1DD84C; Thu, 18 Sep 2014 19:42:27 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============3060131756615547016==" MIME-Version: 1.0 Subject: Re: Review Request 25572: Associating repository latest url for deploying cluster using blueprint. From: "Cabir Zounaidou" To: "Mahadev Konar" , "Srimanth Gunturi" , "Robert Nettleton" , "John Speidel" , "Erik Bergenholtz" , "Nate Cole" Cc: "Ambari" , "Cabir Zounaidou" Date: Thu, 18 Sep 2014 19:42:27 -0000 Message-ID: <20140918194227.7803.75694@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org Auto-Submitted: auto-generated Sender: "Cabir Zounaidou" X-ReviewGroup: Ambari X-ReviewRequest-URL: https://reviews.apache.org/r/25572/ X-Sender: "Cabir Zounaidou" References: <20140918184336.7803.6341@reviews.apache.org> In-Reply-To: <20140918184336.7803.6341@reviews.apache.org> Reply-To: "Cabir Zounaidou" X-ReviewRequest-Repository: ambari --===============3060131756615547016== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit > On Sept. 18, 2014, 6:43 p.m., Nate Cole wrote: > > I think it would be better to move the logic to StackInfo.getRepositories() because it is been called by AmbariMetaInfo.getRepository(...) and AmbariMetaInfo.getRepositories(...) overloaded methods. Any suggestions? > On Sept. 18, 2014, 6:43 p.m., Nate Cole wrote: > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java, lines 886-905 > > > > > > Could this be handled on server startup when we load all the repos? Doesn't seem like it should take a Custom Command execution to make this decision. > > Cabir Zounaidou wrote: > Sure, that can be done too. I will make the changes and will update the patch. > > Mahadev Konar wrote: > Good point - Nate can you suggest where in the code we can add it? > > Nate Cole wrote: > In AmbariMetaInfo is where all the repo data is pulled out of XML and put into "proper" objects. Look for List getRepository(...). Basically, move the above logic inside AmbariMetaInfo.getRepository() right? Correct me if i am wrong. - Cabir ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/25572/#review53845 ----------------------------------------------------------- On Sept. 18, 2014, 2:36 a.m., Cabir Zounaidou wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/25572/ > ----------------------------------------------------------- > > (Updated Sept. 18, 2014, 2:36 a.m.) > > > Review request for Ambari, Erik Bergenholtz, John Speidel, Mahadev Konar, Nate Cole, Robert Nettleton, and Srimanth Gunturi. > > > Bugs: AMBARI-7286 > https://issues.apache.org/jira/browse/AMBARI-7286 > > > Repository: ambari > > > Description > ------- > > Steps: > 1. Create a blueprint > {"configurations": [], "host_groups": [ > {"name": "host1", > "cardinality": "1", > "components": [ > {"name": "DATANODE" }, > {"name": "SECONDARY_NAMENODE" }, > {"name": "NAMENODE" }, > {"name": "ZOOKEEPER_SERVER" }, > {"name": "ZOOKEEPER_CLIENT" }, > {"name": "HDFS_CLIENT" } > ] > } > ], "Blueprints": { > "blueprint_name": "hdfszk", > "stack_name": "HDP", > "stack_version": "2.1" > }} > > 2. Create a cluster template to deploy using blueprint > { > "configurations": [ > { > > "cluster-env":{ > "tag":"version1", > "properties":{"security_enabled":"false","kerberos_domain": "EXAMPLE.COM","ignore_groupsusers_create": "false", "smokeuser": "ambari-qa", "user_group": "hadoop"} > } > } > > ], > "blueprint": "hdfszk", > "host_groups": [ > { > "name": "host1", > "hosts": [ > { "fqdn": "c6401.ambari.apache.org" } > ] > } > ] > } > > 3. Deploy an instance of cluster using the above cluster template > > 4. Verify the URL's in the Admin/repositories page of UI. It was not be using the latest url specified in the repoinfo.xml of the given stack and version before this fix. > > > Diffs > ----- > > ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelper.java 156427d > ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariCustomCommandExecutionHelperTest.java 898efbf > > Diff: https://reviews.apache.org/r/25572/diff/ > > > Testing > ------- > > 1. Ran the unit tests. The ClusterResourceProviderTest.java has unit for deploying cluster using blueprint. > 2. Manually tested deploying a cluster from the UI > 3. Ran the REST-API's to test deploying cluster using blueprint and verified the repository urls. > 3.1 Create a blueprint using the API > curl -i --user admin:adminhttp://c6401.ambari.apache.org:8080/api/v1/blueprints/blueprint1 -X POST -d @/tmp/myblueprint_template_json -H "X-Requested-By: ambari" > 3.2 Create a cluster from the template which was using the blueprint > curl -i --user admin:admin -H "X-Requested-By: ambari" -X POST -d @/tmp/cluster_blueprint_instance.json http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1 > 3.3 Checked the status of the task until it is completed. > 3.4 Verified in the UI that Admin/repositories page shows up the latest repo url (specified in repoinfo.xml) for the stack selected. > 3.5 Also verified the generated command file (/var/lib/ambari-agent/data/command-x.json) for the latest url. It sets the baseUrl="http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.5.0\", which is same as the latestBaseUrl. > : > : > "hostLevelParams": { > "jdk_location": "http://c6401.ambari.apache.org:8080/resources/", > "ambari_db_rca_password": "mapred", > "java_home": "/usr/jdk64/jdk1.7.0_45", > "ambari_db_rca_url": "jdbc:postgresql://c6401.ambari.apache.org/ambarirca", > "jce_name": "UnlimitedJCEPolicyJDK7.zip", > "oracle_jdbc_url": "http://c6401.ambari.apache.org:8080/resources//ojdbc6.jar", > "repo_info": "[{\"baseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.5.0\",\"osType\":\"redhat6\",\"repoId\":\"HDP-2.1\",\"repoName\":\"HDP\",\"defaultBaseUrl\":\"http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos6/2.x/updates/2.1.5.0/\",\"latestBaseUrl\":\"http://public-repo-1.hortonworks.com/HDP/centos6/2.x/updates/2.1.5.0\"},{\"baseUrl\":\"http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.19/repos/centos6\",\"osType\":\"redhat6\",\"repoId\":\"HDP-UTILS-1.1.0.19\",\"repoName\":\"HDP-UTILS\",\"defaultBaseUrl\":\"http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.19/repos/centos6\",\"latestBaseUrl\":\"http://s3.amazonaws.com/dev.hortonworks.com/HDP-UTILS-1.1.0.19/repos/centos6\"}]", > "group_list": "[\"hadoop\",\"users\"]", > > : > > > Thanks, > > Cabir Zounaidou > > --===============3060131756615547016==--