Solr
  1. Solr
  2. SOLR-7847

Implement the logic that runs examples in Java instead of in OS specific scripts (bin/solr and bin/solr.cmd)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.3, 6.0
    • Component/s: scripts and tools
    • Labels:
      None

      Description

      Off-shoot from SOLR-7043 to tackle the specific task of moving the logic that runs the examples (cloud, techproducts, etc) to Java code instead of complex OS-specific scripts.

      This is only one small step along the way to get SOLR-7043 resolved.

      1. SOLR-7847_fixtest.patch
        2 kB
        Timothy Potter
      2. SOLR-7847.patch
        138 kB
        Timothy Potter
      3. SOLR-7847.patch
        134 kB
        Timothy Potter
      4. SOLR-7847-upgrade-commons-cli.patch
        27 kB
        Shawn Heisey

        Issue Links

          Activity

          Hide
          Timothy Potter added a comment -

          Patch the moves the run example logic into SolrCLI and out of bin/solr and bin\solr.cmd. Nightly smoke test passes with these changes.

          I'd like to include this fix into 5.3, so please review ASAP if interested.

          Show
          Timothy Potter added a comment - Patch the moves the run example logic into SolrCLI and out of bin/solr and bin\solr.cmd . Nightly smoke test passes with these changes. I'd like to include this fix into 5.3, so please review ASAP if interested.
          Hide
          Jan Høydahl added a comment -

          Applied the patch to trunk
          Ran techproducts example
          Quick inspection of patch

          Ran cloud example with non-default answers to all prompts
          The cloud example works, but the patch version is much more verbose than the current one, it adds this printout after starting each cloud node:

          Checking status of Solr at http://localhost:9876/solr ...
          
          Solr is running in cloud mode with status:
          {
            "solr_home":"/Users/janhoy/workspace/trunk_6x_A/solr/example/cloud/node1/solr/",
            "version":"6.0.0-SNAPSHOT 1694016M - janhoy - 2015-08-04 11:07:18",
            "startTime":"2015-08-04T09:26:46.716Z",
            "uptime":"0 days, 0 hours, 0 minutes, 10 seconds",
            "memory":"59.8 MB (%12.2) of 490.7 MB",
            "cloud":{
              "ZooKeeper":"localhost:10876",
              "liveNodes":"1",
              "collections":"1"},
            "baseUrl":"http://localhost:9876/solr"}
          

          I don't think that verbose output is helpful for people trying Solr for the first time - it takes up screen space and looks "complex". Suggest you skip it and keep the output as it is today.

          All on OSX

          Show
          Jan Høydahl added a comment - Applied the patch to trunk Ran techproducts example Quick inspection of patch Ran cloud example with non-default answers to all prompts The cloud example works, but the patch version is much more verbose than the current one, it adds this printout after starting each cloud node: Checking status of Solr at http://localhost:9876/solr ... Solr is running in cloud mode with status: { "solr_home":"/Users/janhoy/workspace/trunk_6x_A/solr/example/cloud/node1/solr/", "version":"6.0.0-SNAPSHOT 1694016M - janhoy - 2015-08-04 11:07:18", "startTime":"2015-08-04T09:26:46.716Z", "uptime":"0 days, 0 hours, 0 minutes, 10 seconds", "memory":"59.8 MB (%12.2) of 490.7 MB", "cloud":{ "ZooKeeper":"localhost:10876", "liveNodes":"1", "collections":"1"}, "baseUrl":"http://localhost:9876/solr"} I don't think that verbose output is helpful for people trying Solr for the first time - it takes up screen space and looks "complex". Suggest you skip it and keep the output as it is today. All on OSX
          Hide
          Timothy Potter added a comment -

          Thanks for reviewing Jan Høydahl. I'll clean up the verbose status report and repost a patch shortly.

          Show
          Timothy Potter added a comment - Thanks for reviewing Jan Høydahl . I'll clean up the verbose status report and repost a patch shortly.
          Hide
          Timothy Potter added a comment -

          Updated patch to turn-down the verbosity of status reporting and clean-up a few issues found on Windows testing.

          Show
          Timothy Potter added a comment - Updated patch to turn-down the verbosity of status reporting and clean-up a few issues found on Windows testing.
          Hide
          ASF subversion and git services added a comment -

          Commit 1694083 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1694083 ]

          SOLR-7847: Implement run example logic in Java instead of OS-specific scripts in bin/solr

          Show
          ASF subversion and git services added a comment - Commit 1694083 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1694083 ] SOLR-7847 : Implement run example logic in Java instead of OS-specific scripts in bin/solr
          Hide
          Timothy Potter added a comment -

          I'm going to let this bake on trunk for a few test runs before back-porting to branch5x since I've introduced new JAR dependencies (commons-exec).

          Show
          Timothy Potter added a comment - I'm going to let this bake on trunk for a few test runs before back-porting to branch5x since I've introduced new JAR dependencies (commons-exec).
          Hide
          Timothy Potter added a comment -

          Patch to fix Jenkins test failures on trunk

          Show
          Timothy Potter added a comment - Patch to fix Jenkins test failures on trunk
          Hide
          ASF subversion and git services added a comment -

          Commit 1694104 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1694104 ]

          SOLR-7847: fix test failures due to post.jar missing, work around by invoking SimplePostTool directly vs using post.jar

          Show
          ASF subversion and git services added a comment - Commit 1694104 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1694104 ] SOLR-7847 : fix test failures due to post.jar missing, work around by invoking SimplePostTool directly vs using post.jar
          Hide
          ASF subversion and git services added a comment -

          Commit 1694137 from Timothy Potter in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1694137 ]

          SOLR-7847: Implement run example logic in Java instead of OS-specific scripts in bin/solr

          Show
          ASF subversion and git services added a comment - Commit 1694137 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1694137 ] SOLR-7847 : Implement run example logic in Java instead of OS-specific scripts in bin/solr
          Hide
          Shawn Heisey added a comment -

          I was poking at the changes in SolrCLI in branch_5x to see what was done, and noticed a bunch of warnings. I'm using eclipse, with Java 8, but I'm hoping the source level setting of 1.7 makes everything relevant.

          I started looking at what I could do to eliminate some warnings, and one of the first things I looked at was the argList variable in the main method. I changed this to a List<String> but still had a warning about unchecked cast ... so I went looking for the javadocs on the CommandLine object in commons-cli. That said it returned List<String>, so I was confused until I noticed that Solr is pulling in an older version of commons-cli.

          I updated the ivy config to get the newest version of commons-cli, and that led to the discovery that we were using classes and methods that are deprecated in the newer version.

          I changed all those to use the preferred classes/methods, and managed to eliminate every warning that eclipse showed for SolrCLI. I am seeing test failures, so I will try to fix those before I upload the patch.

          Show
          Shawn Heisey added a comment - I was poking at the changes in SolrCLI in branch_5x to see what was done, and noticed a bunch of warnings. I'm using eclipse, with Java 8, but I'm hoping the source level setting of 1.7 makes everything relevant. I started looking at what I could do to eliminate some warnings, and one of the first things I looked at was the argList variable in the main method. I changed this to a List<String> but still had a warning about unchecked cast ... so I went looking for the javadocs on the CommandLine object in commons-cli. That said it returned List<String>, so I was confused until I noticed that Solr is pulling in an older version of commons-cli. I updated the ivy config to get the newest version of commons-cli, and that led to the discovery that we were using classes and methods that are deprecated in the newer version. I changed all those to use the preferred classes/methods, and managed to eliminate every warning that eclipse showed for SolrCLI. I am seeing test failures, so I will try to fix those before I upload the patch.
          Hide
          ASF subversion and git services added a comment -

          Commit 1694172 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1694172 ]

          SOLR-7847: disable the testTechproductsExample test that is failing on Jenkins

          Show
          ASF subversion and git services added a comment - Commit 1694172 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1694172 ] SOLR-7847 : disable the testTechproductsExample test that is failing on Jenkins
          Hide
          ASF subversion and git services added a comment -

          Commit 1694173 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1694173 ]

          SOLR-7847: rollback accidental commit of VersionInfo

          Show
          ASF subversion and git services added a comment - Commit 1694173 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1694173 ] SOLR-7847 : rollback accidental commit of VersionInfo
          Hide
          ASF subversion and git services added a comment -

          Commit 1694176 from Timothy Potter in branch 'dev/trunk'
          [ https://svn.apache.org/r1694176 ]

          SOLR-7847: disable the testTechproductsExample test that is failing on Jenkins

          Show
          ASF subversion and git services added a comment - Commit 1694176 from Timothy Potter in branch 'dev/trunk' [ https://svn.apache.org/r1694176 ] SOLR-7847 : disable the testTechproductsExample test that is failing on Jenkins
          Hide
          ASF subversion and git services added a comment -

          Commit 1694178 from Timothy Potter in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1694178 ]

          SOLR-7847: disable the testTechproductsExample test that is failing on Jenkins

          Show
          ASF subversion and git services added a comment - Commit 1694178 from Timothy Potter in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1694178 ] SOLR-7847 : disable the testTechproductsExample test that is failing on Jenkins
          Hide
          Shawn Heisey added a comment -

          It's possible that the commons-cli upgrade and the associated changes to SolrCLI need their own issue. Here's the patch against branch_5x. If trunk doesn't like it (which I haven't tested), I can make a new one.

          Eclipse's code formatter doesn't handle the multi-line builder code very well, so I just made my best guess about how the formatting should look.

          Show
          Shawn Heisey added a comment - It's possible that the commons-cli upgrade and the associated changes to SolrCLI need their own issue. Here's the patch against branch_5x. If trunk doesn't like it (which I haven't tested), I can make a new one. Eclipse's code formatter doesn't handle the multi-line builder code very well, so I just made my best guess about how the formatting should look.
          Hide
          Shawn Heisey added a comment -

          Solr tests pass with the patch I just uploaded. I found a problem with precommit (missing svn:eol-style on the new jar checksum), it passed after fixing that. That was on Java 8 ... I need to re-do the precommit with Java 7, hopefully these changes won't have any trouble there.

          Show
          Shawn Heisey added a comment - Solr tests pass with the patch I just uploaded. I found a problem with precommit (missing svn:eol-style on the new jar checksum), it passed after fixing that. That was on Java 8 ... I need to re-do the precommit with Java 7, hopefully these changes won't have any trouble there.
          Hide
          Timothy Potter added a comment -

          Be sure to test the cli changes on Windows manually ... the code I committed for this was tested pretty thoroughly on Windows and while it shouldn't matter because it's just Java, I've seen that it does sometimes with that OS

          Show
          Timothy Potter added a comment - Be sure to test the cli changes on Windows manually ... the code I committed for this was tested pretty thoroughly on Windows and while it shouldn't matter because it's just Java, I've seen that it does sometimes with that OS
          Hide
          Timothy Potter added a comment -

          Also, I recommend handling these changes in a separate issue that can be tracked as Jenkins is now passing with the code as committed. Moreover, ant nightly-smoke test should also be run against trunk and branch_5x before committing as that is affected by this code.

          Show
          Timothy Potter added a comment - Also, I recommend handling these changes in a separate issue that can be tracked as Jenkins is now passing with the code as committed. Moreover, ant nightly-smoke test should also be run against trunk and branch_5x before committing as that is affected by this code.
          Hide
          Shalin Shekhar Mangar added a comment -

          Bulk close for 5.3.0 release

          Show
          Shalin Shekhar Mangar added a comment - Bulk close for 5.3.0 release

            People

            • Assignee:
              Timothy Potter
              Reporter:
              Timothy Potter
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 168h
                168h
                Remaining:
                Remaining Estimate - 168h
                168h
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development