Cassandra
  1. Cassandra
  2. CASSANDRA-4140

Build stress classes in a location that allows tools/stress/bin/stress to find them

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Fix Version/s: 1.1.0
    • Component/s: Tools
    • Labels:
      None

      Description

      Right now its hard to run stress from a checkout of trunk. You need to do 'ant artifacts' and then run the stress tool in the generated artifacts.

      A discussion on irc came up with the proposal to just move stress to the main jar, but the stress/stressd bash scripts in bin/, and drop the tools directory altogether. It will be easier for users to find that way and will make running stress from a checkout much easier.

        Activity

        Hide
        Jonathan Ellis added a comment -

        Right now its hard to run stress from a checkout of trunk

        Wow, that's a definition of "hard" I'm unfamiliar with.

        I would rather move more non-core things to tools/ (sstable export/import, sstablekeys, sstableloader), than the other way around.

        Show
        Jonathan Ellis added a comment - Right now its hard to run stress from a checkout of trunk Wow, that's a definition of "hard" I'm unfamiliar with. I would rather move more non-core things to tools/ (sstable export/import, sstablekeys, sstableloader), than the other way around.
        Hide
        Jonathan Ellis added a comment -

        To clarify, stress build is broken post-CASSANDRA-4103, but "let's stuff everything in one big jar" is not my preferred solution.

        Show
        Jonathan Ellis added a comment - To clarify, stress build is broken post- CASSANDRA-4103 , but "let's stuff everything in one big jar" is not my preferred solution.
        Hide
        Nick Bailey added a comment -

        Wow, that's a definition of "hard" I'm unfamiliar with.

        Hmm maybe I should have gone with confusing . Plus I'm lazy. I don't want to wait for artifacts to build the javadoc AND then make build/dist/tools/stress/bin/stress executable so I can run it. C'mon, two whole extra steps!!??

        Really though fixing that ^ was the spirit of this ticket. Moving stress was just a suggestion from irc. I would be fine if 'ant stress-build' put the built files in a place where tools/stress/bin/stress can find them.

        Having said that I do think moving things like you mentioned into tools makes them less 'discoverable'. And moving stress would make it more 'discoverable'.

        Show
        Nick Bailey added a comment - Wow, that's a definition of "hard" I'm unfamiliar with. Hmm maybe I should have gone with confusing . Plus I'm lazy. I don't want to wait for artifacts to build the javadoc AND then make build/dist/tools/stress/bin/stress executable so I can run it. C'mon, two whole extra steps!!?? Really though fixing that ^ was the spirit of this ticket. Moving stress was just a suggestion from irc. I would be fine if 'ant stress-build' put the built files in a place where tools/stress/bin/stress can find them. Having said that I do think moving things like you mentioned into tools makes them less 'discoverable'. And moving stress would make it more 'discoverable'.
        Hide
        Jonathan Ellis added a comment -

        I do think moving things like you mentioned into tools makes them less 'discoverable'

        I'm totally fine with that. In fact I think it's a feature: 99% of people using sstable2json are Doing It Wrong; it's meant to be a debugging tool, end of story.

        Show
        Jonathan Ellis added a comment - I do think moving things like you mentioned into tools makes them less 'discoverable' I'm totally fine with that. In fact I think it's a feature: 99% of people using sstable2json are Doing It Wrong; it's meant to be a debugging tool, end of story.
        Hide
        Nick Bailey added a comment -

        You've convinced me. Updated title to reflect what I really would like this ticket to accomplish.

        Show
        Nick Bailey added a comment - You've convinced me. Updated title to reflect what I really would like this ticket to accomplish.
        Hide
        Vijay added a comment -

        Alright, attached patch will make the following possible...

        Build from Source ->
        #ant stress-build
        #tools/stress/bin/stress

        Installed Binary ->
        #tools/stress/bin/stress

        NOTE: executing from source file only works on Unix like systems i dont have a machine to test stress.bat hence left it untouched.

        Show
        Vijay added a comment - Alright, attached patch will make the following possible... Build from Source -> #ant stress-build #tools/stress/bin/stress Installed Binary -> #tools/stress/bin/stress NOTE: executing from source file only works on Unix like systems i dont have a machine to test stress.bat hence left it untouched.
        Hide
        Nick Bailey added a comment -

        +1 on these changes from me.

        Jonathan, maybe you could port the same changes to stress.bat since you run on windows?

        Show
        Nick Bailey added a comment - +1 on these changes from me. Jonathan, maybe you could port the same changes to stress.bat since you run on windows?
        Hide
        Jonathan Ellis added a comment -

        How about tools/bin/stress?

        Show
        Jonathan Ellis added a comment - How about tools/bin/stress?
        Hide
        Vijay added a comment -

        I can change the build.xml to copy the files to tools/bin/stress... But will work only for the installed binaries but for running it from the source (after stress-build) we still might need to do tools/stress/bin/stress else we might have to move around stuff, like Stress bin to a common tools/bin that might be confusing but i am fine either ways ... Acceptable?

        Show
        Vijay added a comment - I can change the build.xml to copy the files to tools/bin/stress... But will work only for the installed binaries but for running it from the source (after stress-build) we still might need to do tools/stress/bin/stress else we might have to move around stuff, like Stress bin to a common tools/bin that might be confusing but i am fine either ways ... Acceptable?
        Hide
        Jonathan Ellis added a comment -

        Stress bin to a common tools/bin

        That's what I was referring to; I don't care where the .class or .jar files go.

        Show
        Jonathan Ellis added a comment - Stress bin to a common tools/bin That's what I was referring to; I don't care where the .class or .jar files go.
        Hide
        Vijay added a comment - - edited

        Done!

        Show
        Vijay added a comment - - edited Done!
        Hide
        Nick Bailey added a comment -

        My only wish with the new version is that we add the executable flag to the permissions of tools/bin/stress[d]. Besides that looks good for linux, haven't tried out the .bat files.

        Show
        Nick Bailey added a comment - My only wish with the new version is that we add the executable flag to the permissions of tools/bin/stress [d] . Besides that looks good for linux, haven't tried out the .bat files.
        Hide
        Jonathan Ellis added a comment -

        Ship it!

        Show
        Jonathan Ellis added a comment - Ship it!
        Hide
        Vijay added a comment -

        Nick,
        Are you sure this is a issue with this patch?

        patch has

        create mode 100755 tools/bin/stress
         create mode 100644 tools/bin/stress.bat
         create mode 100755 tools/bin/stressd
         delete mode 100755 tools/stress/bin/stress
         delete mode 100644 tools/stress/bin/stress.bat
         delete mode 100755 tools/stress/bin/stressd
        

        and build.xml has

                 <tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755">
                   <include name="bin/*"/>
        +          <include name="tools/bin/*"/>
                   <not>
                         <filename name="bin/*.in.sh" />
                   </not>
        

        file list from the tar, shows the same...

        vparthasarathy$ tar tvfz /Users/vparthasarathy/Documents/workspace/cassandraT11/build/apache-cassandra-1.1.0-rc1-SNAPSHOT-bin.tar.gz |grep -i stress
        rw-rr- 0 0 0 1543 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress
        rw-rr- 0 0 0 1274 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress.bat
        rw-rr- 0 0 0 2194 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stressd
        rw-rr- 0 0 0 15312482 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/lib/stress.jar
        -rwxr-xr-x 0 0 0 1543 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress
        -rwxr-xr-x 0 0 0 1274 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress.bat
        -rwxr-xr-x 0 0 0 2194 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stressd

        Show
        Vijay added a comment - Nick, Are you sure this is a issue with this patch? patch has create mode 100755 tools/bin/stress create mode 100644 tools/bin/stress.bat create mode 100755 tools/bin/stressd delete mode 100755 tools/stress/bin/stress delete mode 100644 tools/stress/bin/stress.bat delete mode 100755 tools/stress/bin/stressd and build.xml has <tarfileset dir= "${dist.dir}" prefix= "${ final .name}" mode= "755" > <include name= "bin/*" /> + <include name= "tools/bin/*" /> <not> <filename name= "bin/*.in.sh" /> </not> file list from the tar, shows the same... vparthasarathy$ tar tvfz /Users/vparthasarathy/Documents/workspace/cassandraT11/build/apache-cassandra-1.1.0-rc1-SNAPSHOT-bin.tar.gz |grep -i stress rw-r r - 0 0 0 1543 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress rw-r r - 0 0 0 1274 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress.bat rw-r r - 0 0 0 2194 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stressd rw-r r - 0 0 0 15312482 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/lib/stress.jar -rwxr-xr-x 0 0 0 1543 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress -rwxr-xr-x 0 0 0 1274 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stress.bat -rwxr-xr-x 0 0 0 2194 Apr 16 15:25 apache-cassandra-1.1.0-rc1-SNAPSHOT/tools/bin/stressd
        Hide
        Nick Bailey added a comment -

        My mistake, looks like 'patch -p1 < <patch_File>' won't keep permissions. 'git apply <patch_file>' works fine though.

        Show
        Nick Bailey added a comment - My mistake, looks like 'patch -p1 < <patch_File>' won't keep permissions. 'git apply <patch_file>' works fine though.
        Hide
        Vijay added a comment -

        Committed, thanks!

        Show
        Vijay added a comment - Committed, thanks!

          People

          • Assignee:
            Vijay
            Reporter:
            Nick Bailey
            Reviewer:
            Nick Bailey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development