You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Owen O'Malley (JIRA)" <ji...@apache.org> on 2006/10/02 09:04:19 UTC

[jira] Created: (HADOOP-567) The build script should record the Hadoop version into the build

The build script should record the Hadoop version into the build
----------------------------------------------------------------

                 Key: HADOOP-567
                 URL: http://issues.apache.org/jira/browse/HADOOP-567
             Project: Hadoop
          Issue Type: New Feature
          Components: util
    Affects Versions: 0.6.2
            Reporter: Owen O'Malley
         Assigned To: Owen O'Malley
             Fix For: 0.7.0


It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 

The web/ui would display the version for each of the server home page.

I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-567?page=comments#action_12439291 ] 
            
Owen O'Malley commented on HADOOP-567:
--------------------------------------

I'll change the script name and the field names.

The point of util.VersionStamp is isolating the upstream code from the possiblity that the BuildStamp class wasn't generated. In particular, it makes that system compilable even if the script fails for some reason (or isn't called). A typical case that would be if someone is using eclipse or some other IDE without using the ant build script.

I hadn't really looked at the Java Package stuff, but it seems like serious overkill for this context.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-567?page=comments#action_12439273 ] 
            
Doug Cutting commented on HADOOP-567:
-------------------------------------

This is very cool!  +1

A few naming nits.  The script name should end with '.sh'.  And the field names in the generated class are 'static final' and hence their names should be all caps.  It would also be good to get some javadoc in that class.  And instead of BuildStamp, we might just call this Version or HadoopVersion, no?

Finally, I'm not sure why util.VersionInfo is needed.  Under what situations is this better than simply referencing the constants in the generated class?

Lucene does something related with:

http://lucene.apache.org/java/docs/api/org/apache/lucene/LucenePackage.html

The version is built into the jar manifest in the jar-core target of:

http://svn.apache.org/viewvc/lucene/java/trunk/common-build.xml?view=markup

Then it's accessed with:

http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/LucenePackage.java?view=markup

This does not have the subversion revision, which would be really nice.  Also, in addition to the revision, it would be good to have the repository URL.  Then one could always recreate the sources.

Do you think there'd be much of an advantage to use Java's Package stuff for this?

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-567?page=comments#action_12439549 ] 
            
Owen O'Malley commented on HADOOP-567:
--------------------------------------

Well, phooey on Java. It won't let me add static stuff to the annotation class, so upto any complaints Doug has with naming, I think it is good to go.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version-2.patch, version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-567?page=all ]

Owen O'Malley updated HADOOP-567:
---------------------------------

    Status: Patch Available  (was: Open)

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-567?page=all ]

Owen O'Malley updated HADOOP-567:
---------------------------------

    Attachment: version.patch

This patch:
  1. creates a new script src/makeBuildStamp that creates a java source file in build/src that records the hadoop version, subversion revision of the root directory, the compilation time, and the user doing the compilation.
  2. adds a new class in hadoop.util.VersionInfo that finds the BuildStamp class using reflection to make sure there are never any compilation problems.
  3. adds a call to the makeBuildStamp in the build.xml. By using "sh" as the program, it works under both cygwin and unix.
  4. updates the job tracker, task tracker, and the name node to report version information on their home pages.
  5. add another switch for cli users so that "hadoop version" prints the version in the jar.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-567?page=all ]

Owen O'Malley updated HADOOP-567:
---------------------------------

    Attachment: version-2.patch

This patch uses package annotations instead of static finals, which has the nice property that if you use getPackage().getAnnotation(...) you can get the information.

I also set the hadoop version in the manifest, but since the manifest is only created when a jar is created, I also left the version information in the annotation, which is available regardless of whether it is being run from a jar or the developer's build directory.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version-2.patch, version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HADOOP-567?page=comments#action_12439303 ] 
            
Doug Cutting commented on HADOOP-567:
-------------------------------------

The point about the Package stuff, is that, without much complexity (Ant adds a manifest to the jar), we can use a standard API for this, and some folks might benefit from that.  We could include the same information (author, revision, etc.) but we'd encode it in the available fields, e.g., implementationVersion could be version+revision, vendor could be "Apache Software Foundation, built by <user>", etc.

Someday someone might reasonably suggest that the Hadoop jar should include a manifest containing its version.  (That's what happened with Lucene.)  Should we then have two mechanisms to stamp builds with the version?

It might sound like I feel strongly about this.  I don't.  Your approach has clear advantages over a Package-based solution: the values are more structured & can thus more easily be formatted as we wish.  I just wanted to raise the Package issue for consideration.  It's likely to arise again someday, so if we decide against it we should do so knowingly and have a rationale ready.  (Like Serializeable, RMI, & other wheels we reinvent.)

I'm also in general not very sympathetic to designing things for alternate build environments.  We have a single supported build environment, Ant.  If folks build things in other ways then it might not work.  Doesn't Eclipse use the Ant build?  Do we really need to support folks who've not configured their Eclipse environment to do so?  (Note that storing the version in the jar manifest also mostly avoids this issue.)  I feel slightly stronger about this one.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-567?page=all ]

Owen O'Malley updated HADOOP-567:
---------------------------------

    Status: Open  (was: Patch Available)

I guess it would be nicer to rename the annotation to org.apache.hadoop.HadoopVersion and move the static methods that I have in utils.VersionInfo into HadoopVersion.

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version-2.patch, version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (HADOOP-567) The build script should record the Hadoop version into the build

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HADOOP-567?page=all ]

Doug Cutting resolved HADOOP-567.
---------------------------------

    Resolution: Fixed

I just committed this.  Thanks, Owen!

> The build script should record the Hadoop version into the build
> ----------------------------------------------------------------
>
>                 Key: HADOOP-567
>                 URL: http://issues.apache.org/jira/browse/HADOOP-567
>             Project: Hadoop
>          Issue Type: New Feature
>          Components: util
>    Affects Versions: 0.6.2
>            Reporter: Owen O'Malley
>         Assigned To: Owen O'Malley
>             Fix For: 0.7.0
>
>         Attachments: version-2.patch, version.patch
>
>
> It would be good to compile the Hadoop version, subversion revision, and compilation date into the hadoop.jar file. 
> The web/ui would display the version for each of the server home page.
> I'd also add "bin/hadoop version" to print the version information.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira