Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8929

Add an idea module for solr/server to enable launching start.jar

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.4.1
    • Fix Version/s: 6.1, 7.0
    • Component/s: scripts and tools
    • Labels:
      None
    • Flags:
      Patch

      Description

      Currently in IntelliJ, it's difficult to create a launch config to run Solr in the same way that the bin/solr script would, because there aren't any modules that reference the jetty start.jar that it uses.

      I want to create a simple solr/server IJ module that can be referenced from a launch config. I've created it manually in the past, but then I always lose it when I have to regenerate idea on branch switch.

      1. SOLR-8929.patch
        4 kB
        Scott Blum
      2. SOLR-8929.patch
        2 kB
        Scott Blum
      3. SOLR-8929-bin-solr-run-configuration.patch
        2 kB
        Steve Rowe

        Activity

        Hide
        steve_rowe Steve Rowe added a comment -

        I understand why you want to introduce this new module, but I'm reluctant to do so, given that it's only to support run configurations (vs. source code).

        it's difficult to create a launch config to run Solr in the same way that the bin/solr script would

        The attached patch creates a run configuration that launches bin/solr in foreground cloud mode. Would this be an acceptable alternative? If so, we could also add one for *nix standalone mode, as well as Windows versions.

        Show
        steve_rowe Steve Rowe added a comment - I understand why you want to introduce this new module, but I'm reluctant to do so, given that it's only to support run configurations (vs. source code). it's difficult to create a launch config to run Solr in the same way that the bin/solr script would The attached patch creates a run configuration that launches bin/solr in foreground cloud mode. Would this be an acceptable alternative? If so, we could also add one for *nix standalone mode, as well as Windows versions.
        Hide
        dragonsinth Scott Blum added a comment -

        Thanks for looking at this. I don't think calling the bin/solr script is as good of a workflow, however. If you have the right classpath setup in IntelliJ, the edit/debug cycle is really fast; you can make code changes, restart the debugger, and you're good to go. The bin/solr script requires jars to be rebuilt or you won't be up to date with the latest code.

        The whole point of using an IDE and having an IntelliJ project is for maximum productivity, and having a module setup that enables really running solr as a debug config is maximally productive.

        Show
        dragonsinth Scott Blum added a comment - Thanks for looking at this. I don't think calling the bin/solr script is as good of a workflow, however. If you have the right classpath setup in IntelliJ, the edit/debug cycle is really fast; you can make code changes, restart the debugger, and you're good to go. The bin/solr script requires jars to be rebuilt or you won't be up to date with the latest code. The whole point of using an IDE and having an IntelliJ project is for maximum productivity, and having a module setup that enables really running solr as a debug config is maximally productive.
        Hide
        steve_rowe Steve Rowe added a comment -

        Okay, I'll buy it.

        All other modules have a pre-defined run configuration to run all tests in the module. Do you think it makes sense to include a pre-defined run configuration for this new module? If so, can you provide one? They're in dev-tools/idea/.idea/workspace.xml.

        Show
        steve_rowe Steve Rowe added a comment - Okay, I'll buy it. All other modules have a pre-defined run configuration to run all tests in the module. Do you think it makes sense to include a pre-defined run configuration for this new module? If so, can you provide one? They're in dev-tools/idea/.idea/workspace.xml .
        Hide
        dragonsinth Scott Blum added a comment -

        Will do! Is there a canonical "launch a local solr" I can copy? Like, I need to know what I should use for solr home, etc.

        Show
        dragonsinth Scott Blum added a comment - Will do! Is there a canonical "launch a local solr" I can copy? Like, I need to know what I should use for solr home, etc.
        Hide
        steve_rowe Steve Rowe added a comment -

        Sorry, I don't have anything canonical - maybe others who see this will?

        I was hoping that since you've done this in the past, you could just recreate it and then it would be the canonical thing . We can always iterate, progress not perfection and all that.

        Show
        steve_rowe Steve Rowe added a comment - Sorry, I don't have anything canonical - maybe others who see this will? I was hoping that since you've done this in the past, you could just recreate it and then it would be the canonical thing . We can always iterate, progress not perfection and all that.
        Hide
        dragonsinth Scott Blum added a comment -

        Ok, I have a working config that actually runs a solr in cloud mode w/ embedded zk, using solr/server/solr as the solr home. This works fine, except I'm not sure how to create collections... I think I need to get the configset examples into ZK somehow?

        Show
        dragonsinth Scott Blum added a comment - Ok, I have a working config that actually runs a solr in cloud mode w/ embedded zk, using solr/server/solr as the solr home. This works fine, except I'm not sure how to create collections... I think I need to get the configset examples into ZK somehow?
        Hide
        dragonsinth Scott Blum added a comment -

        Updated patch with a real run configuration.

        Show
        dragonsinth Scott Blum added a comment - Updated patch with a real run configuration.
        Hide
        steve_rowe Steve Rowe added a comment -

        If you have the right classpath setup in IntelliJ

        Looks like the included run configuration only includes the new server module's classpath, which doesn't have any dependencies other than start.jar?

        When I run the solrcloud run configuration, I get java.io.FileNotFoundException: /Users/sarowe/git/lucene-solr/solr/server/solr-webapp/webapp - so I'm not sure what the benefit of this over bin/solr is? That is, you still have to use the ant build to populate server/solr-webapp/webapp.

        Are you planning to flesh this out more? I think it's possible, with the right module dependencies, and maybe also making the build/run location under idea-build/solr/server/, to get a setup that will use IntelliJ's build artifacts.

        I'm not sure how to create collections... I think I need to get the configset examples into ZK somehow?

        Maybe a bootstrapping task to run SolrCLI's ZK upconfig?

        Show
        steve_rowe Steve Rowe added a comment - If you have the right classpath setup in IntelliJ Looks like the included run configuration only includes the new server module's classpath, which doesn't have any dependencies other than start.jar ? When I run the solrcloud run configuration, I get java.io.FileNotFoundException: /Users/sarowe/git/lucene-solr/solr/server/solr-webapp/webapp - so I'm not sure what the benefit of this over bin/solr is? That is, you still have to use the ant build to populate server/solr-webapp/webapp . Are you planning to flesh this out more? I think it's possible, with the right module dependencies, and maybe also making the build/run location under idea-build/solr/server/ , to get a setup that will use IntelliJ's build artifacts. I'm not sure how to create collections... I think I need to get the configset examples into ZK somehow? Maybe a bootstrapping task to run SolrCLI's ZK upconfig?
        Hide
        dragonsinth Scott Blum added a comment -

        You're correct, it pulls the binaries from WEB-INF/lib. In this formulation the only real advantage is being able to run the debugger very easily. I'd needed the ant build, as you mentioned, to get `server/solr-webapp/webapp` to exist at all.

        What would you think if we committed this in basically it's current state, but added a JIRA to improve it? I would like to circle back on making this better, but I have a bunch of other stuff on my plate and I'm a little concerned that getting Jetty to run exactly the right way without WEB-INF/lib, and otherwise setting up an IntelliJ specific webapp directory will be a bit of a time sink.

        Show
        dragonsinth Scott Blum added a comment - You're correct, it pulls the binaries from WEB-INF/lib. In this formulation the only real advantage is being able to run the debugger very easily. I'd needed the ant build, as you mentioned, to get `server/solr-webapp/webapp` to exist at all. What would you think if we committed this in basically it's current state, but added a JIRA to improve it? I would like to circle back on making this better, but I have a bunch of other stuff on my plate and I'm a little concerned that getting Jetty to run exactly the right way without WEB-INF/lib, and otherwise setting up an IntelliJ specific webapp directory will be a bit of a time sink.
        Hide
        steve_rowe Steve Rowe added a comment -

        +1 to commit as-is and make a follow-on JIRA to improve.

        Show
        steve_rowe Steve Rowe added a comment - +1 to commit as-is and make a follow-on JIRA to improve.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit af92294b0c914d25322308fe81c38500212dfa11 in lucene-solr's branch refs/heads/master from Scott Blum
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=af92294 ]

        SOLR-8929: Add an idea module for solr/server to enable launching start.jar

        Show
        jira-bot ASF subversion and git services added a comment - Commit af92294b0c914d25322308fe81c38500212dfa11 in lucene-solr's branch refs/heads/master from Scott Blum [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=af92294 ] SOLR-8929 : Add an idea module for solr/server to enable launching start.jar
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit cdf1f5ab88ad48b3fe7ffa9bc83526f69ccc0cdb in lucene-solr's branch refs/heads/branch_6x from Scott Blum
        [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cdf1f5a ]

        SOLR-8929: Add an idea module for solr/server to enable launching start.jar

        Show
        jira-bot ASF subversion and git services added a comment - Commit cdf1f5ab88ad48b3fe7ffa9bc83526f69ccc0cdb in lucene-solr's branch refs/heads/branch_6x from Scott Blum [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=cdf1f5a ] SOLR-8929 : Add an idea module for solr/server to enable launching start.jar
        Hide
        dragonsinth Scott Blum added a comment -

        Follow up issue: SOLR-9023

        Show
        dragonsinth Scott Blum added a comment - Follow up issue: SOLR-9023
        Hide
        hossman Hoss Man added a comment -

        Manually correcting fixVersion per Step #S5 of LUCENE-7271

        Show
        hossman Hoss Man added a comment - Manually correcting fixVersion per Step #S5 of LUCENE-7271

          People

          • Assignee:
            dragonsinth Scott Blum
            Reporter:
            dragonsinth Scott Blum
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

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

                Development