| ApacheConUS 2008 Conference | New Orleans, LA | Stormin ...
Upcoming SlideShare
Loading in...5
×
 

| ApacheConUS 2008 Conference | New Orleans, LA | Stormin ...

on

  • 472 views

 

Statistics

Views

Total Views
472
Views on SlideShare
472
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

| ApacheConUS 2008 Conference | New Orleans, LA | Stormin ... | ApacheConUS 2008 Conference | New Orleans, LA | Stormin ... Presentation Transcript

  • Tim Ellison Apache Harmony Project http://harmony.apache.org Stormin' the coffee cup with Apache Harmony
  • Join me during the next 45 mins to…
      • Learn about the motivations, current status, and future plans of the Apache Harmony project.
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
    • Primary goals
      • Protect IP rights of the Java ecosystem.
      • Independent implementation of virtual machines , related class libraries , and other software commonly associated with Java platform implementations.
      • Community-developed , modular architecture allowing sharing and innovation .
    Apache Harmony – a brief history 2005 2006 2007 2008 Harmony established in Apache incubator May 2005 IBM contributes core classes and binary VM license November 2005 Intel contributes VM/JIT/GC/classlib code January 2006… Established legal frame- work around Harmony No code Subset of 1.4 / 5.0 >99% 5.0, >90% 6.0 Java 6 work started March 2006 Open letter to Sun for JCK 5 April 2007 Harmony graduates as top level project October 2006 Day to day development correctness, completeness, performance, … ME code contribution April 2008 1 5 2 3 4
    • Contributors detail their prior access via a project questionnaire.
    • Developers can contribute in functional areas where they have not studied closed-source implementations (exceptions apply).
    • Existing code being contributed to the project must provide acceptable pedigree information.
    Enhanced IP-cleanliness See: http://harmony.apache.org/auth_cont_quest.html This is in addition to the standard Apache contribution processes
  • Bootstrapping the project
    • Establish a common goal
      • compliant and compatible Java SE 5 implementation
    • JVM contributions
      • initial VM implementations, … from Cobbs and Lydick
      • DRLVM, … from Intel
    • Class library code contributions
      • core lang, util, net, IO, beans, … from IBM
      • security, print, sound, awt, swing, … from Intel
      • math, rmi, … from National University of Cordoba, Argentina
    • Production-quality VMs for build and test
      • IBM J9 and BEA JRockit made available to project
          • Used for development
          • Not under open source license, not a contribution
    © javic flickr.com/photos/javic
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
  • Spec-driven development
    • Implementing the Java specifications as found in
        • Java SE platform Javadoc
        • Java Programming Language Specification
        • Java Virtual Machine (JVM) Specification, etc.
    • Ambiguities and omissions...
      • resolved by consulting the Reference Implementation
      • determined by functional API testing
    Producing a compliant implementation Writing Unit Tests Specification Reading Post intentions on the dev list Send patch and discuss problems on dev list Writing implementation iterative progress
  • Test-driven development
    • Functional testing
        • API tests, internal interfaces tests, bug regression tests
        • Component oriented
    • Integration testing
      • Build verification, test with different VMs
      • Component assembly oriented
    • Application / System testing
      • Running popular applications, ad hoc and test suites
      • End-product and compatibility oriented
    • Platform, Performance and Stress testing
      • Multi-platform continuous integration, performance / stress suites
      • Robustness and quality oriented
    Producing a robust, compatible implementation until proven innocent all code is guilty ©B Tal, flickr.com
    • /classlib – the class library code
    • /drlvm – the VM, JIT, GC
    • /jdktools – Java technology development tools (javac, javah, javap, ...)
    • /trunk – federation point (builds everything together)
    Project repository organization Java 5 code base is >1.5 Million non-comment lines of code generated using David A. Wheeler's 'SLOCCount'
  • Federated workspace build
    • Uses svn switch “trick” to assemble source code
    • Downloads project dependencies
    • Running “ant” results in complete HDK, Java Development Kit (JDK) and Java Runtime Environment (JRE)
    • Can work in any directory (svn commit does the Right Thing)
    • ant -Dsvn.revision=X builds any SVN revision
    Bringing it all together /trunk build.xml /working_classlib -> /classlib /working_vm -> /<your favorite vm> /working_jdktools -> /jdktools /current_resources -> /current_resources
  • Heterogeneous build and test farm across community Distributed build-test @ bug tracker committers GIT | Quilt | ? Check out Patches Continuous integration and test by community’s heterogeneous build farm Notify SVN Server contributors Check in/out E-mail Apache infrastructure
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
  • Trace JIT compiler Interpreter Memory manager Thread manager VM XML NIO beans native code Java Native Interface (JNI™) Portability Layer Hardware / Operating System VMI (C) security Java SE class libraries Java SE Platform API Launcher Class library Kernel classes (Java class files) Everything is pluggable Architectural overview lang util net io
  • Harmony DRLVM – the Java Virtual Machine
    • Core interpreter
      • Bytecode verifier, class file loading / unloading, debug interface, JVMTI etc.
    • Just in Time compilers
      • profiling engine selects compiler based on typical code paths, data values, …
      • “ JET” fast compiler
        • ~14K NSLOC, ~10-20K methods/sec, resulting code 10x faster than interpreter
      • “ OPT” optimizing compiler
        • multiple code transformations, resulting code 2x faster than JET
    • Memory managers
      • “ GCv4” stop the world, sequential copying compacting
      • “ GCv5” stop the world, parallel copying compacting generational
      • “ Tick” on the fly, concurrent mark, parallel, mark-sweep-compact generational
  • Virtual Machine modularity
    • Well-defined interfaces, consistent across platforms
    • Interfaces do not compromise runtime performance
    • Modules either build-time or runtime replaceable
    • Multiple implementations already exist for some modules
    Code execution and memory management
  • Harmony’s VMI
    • VM-specific ‘kernel’ classes
      • 23 publicly defined Java SE types that the VM typically knows intimately, plus one helper
    • Access to our C struct from JavaVM / JNIEnv pointers
      • 10 new C functions that augment standard JNI
    • The VMI provides:
      • Access to the operating system abstraction library ( port library )
      • Access to per-VM storage functions ( VMLS ) which allows multiple VMs to exist in a single address space
      • Ability to get/set/iterate system properties
    • The VMI does not :
      • Require any enhanced VM/class library linkage
      • Prescribe object layout, garbage collection, synchronization, and so on
    Virtual Machine Interface to the class libraries class libraries
  • Class library modularization
    • A module…
      • is related functionality scoped by Java packages
      • ‘ exports’ user-API and internal-API, hides private internal implementation
      • defined by dependencies in the Java specification
      • minimizes coupling by explicit internal APIs
      • is delivered as a JAR file, a real OSGi bundle
    Java SE platform implemented in ~30 components
    • Observed benefits
      • easier to manage prior exposure
      • freedom of assembly for module consumers
      • unit of replacement for fixes and updates
      • facilitates contributions
    XML NIO Beans Class Library Native Code VMI (C) JNI API Kernel classes (Java class files) lang util net io Security Java SE Platform 5 API
  • Development time modularity
    • Not a replacement for JDK software
      • HDK  Harmony developers :: JDK software  Java developers
      • Contains all files necessary for Harmony development and testing
    • Enables fast rebuild of individual modules – Java platform and native
    • Removes necessity to check out whole source tree
    • Supports separate or in-place development of HDK trees
    The Harmony Development Kit (“HDK”) $ svn co http://... modules/nio $ cd modules/nio $ ant -DHY.HDK= path/to/hdk -DHY.TARGET= path/to/target
  • Packaging Modularity rt.jar Software assemblies jsse.jar jce.jar … prefs.jar + prefs-src.jar + hyprefs.dll Harmony’s approach Conventional approach Applet AWT Beans LUNI Annotation Instrument Lang-mgmt Math NIO NIO_char Security SQL Text Concurrent Archive Logging Prefs
  • Multi-configuration support
    • Harmony modules can be easily configured:
      • Apache Harmony : builds all modules into Java 5 and Java 6 configurations
      • IBM Java 6 SE : a number of modules sourced from Harmony
      • Android : core libraries adapted to run on Dalvik VM
    “ Right sized” application runtimes     x-net kXML   Xerces xml     text     swing     sql     sound     security     rmi     regex     print     prefs     pack200     nio_char     nio     math     luni     logging     lang-management     jndi     instrument     imageio     crypto     concurrent     beans     awt     auth     archive     applet     annotation     accessibility Android IBM Java 6 Harmony
  • Runtime modularity
    • Single native launcher program
    • Runs command-line Java technology programs, including generic launcher and JDK software tools
    • Select VM provider based on command-line option
    • Select runtime specified modules (e.g. GC algorithm)
    Multi-VM and tools launcher jre/bin/ java.exe default/ drlvm-v1/ drlvm-v2/ ibm-j9/ $ java MyClass $ java –vmdir:ibm-j9 MyClass $ java –vmdir:drlvm-v1 MyClass
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
    • Completeness “heat map” courtesy of JAPI tool
      • compares API compatibility
    • Over 99% 1.5 API complete
    • Missing functionality is now primarily in…
      • providers
          • sound formats encoding / decoding
          • Kerberos authentication
      • command-line tools
          • appletviewer, javaws, jstack, native2ascii, serialver, etc.
    See: http://kaffe.org/~stuart/japi Our original goal - Java SE platform 5 API completeness October 2008
    • Harmony suites:
      • Class library unit tests
      • DRL VM unit and regression tests
      • Functional test suite
      • JDKTools unit tests
      • Reliability test suite
      • Stress test suite
      • VM Validation test suite
    • Application scenarios:
      • Apache Ant scenario
      • Apache Axis2 client-server scenario
      • Apache Struts scenario
      • Apache Tomcat scenario
      • Dacapo benchmark
      • Eclipse hello world application
      • Eclipse Geronimo application
      • JEdit scenario
      • Jetty scenario
      • LDAP scenario
      • Scimark benchmark
    testing, bug fixing, metrics, ... Code quality
    • External test suites:
      • Apache Ant 1.7.0 unit tests
      • Apache Maven unit tests
      • Eclipse unit tests.
      • Eclipse TPTP tests
      • Geronimo unit tests.
      • JUnit tests
      • Mauve test suite
  • Performance Blackburn, S. M., et al The DaCapo Benchmarks: Java Benchmarking Development and Analysis , OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-Oriented Programming, Systems, Languages, and Applications , (Portland, OR, USA, October 22-26, 2006) Source: http://www.dacapobench.org 2008-11-01 dacapo-2006-10-MR2 Tracked by DaCapo performance benchmarks Key: worst result
    • Community builds, tests, and reports results on :
      • x86 Windows 2000, Windows XP
      • x86 Debian, SUSE9, RHEL AS 4, Ubuntu 6
      • x86_64 SUSE 9, RHEL AS 4, Ubuntu 6
    • Known work in progress on :
      • Itanium Linux and Windows
      • PPC 32bit / 64bit Linux and AIX
      • x86 Mac OS X and FreeBSD
      • zSeries 31bit / 64 bit zLinux and zOS
    • Interested in other platforms? Us too!
    Multi-platform support Write once, debug everywhere!
  • DEMO
    • Harmony in action
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
  • Apache’s JCK issue with Sun
    • First request for Java SE JCK v5 - August 2006
      • As per changes to agreement in JSPA, the “Apache Compromise”
    • Sun offer JCK with FoU restrictions – 3Q2006 / 1Q2007
      • Limits how users can use compliant software, ASF reject as not allowing distribution under ALv2.
    • Open Letter from ASF to Sun – April 2007
      • Appeal directly to Schwartz gets no response.
    • ASF position on the JCP – August 2007
      • The ASF will vote “no” on any proposal involving:
        • JCP lead who is not complying with the JSPA
        • JSRs where the TCK-license contains FoU restrictions
    • Java ME & SE/EE Executive Committees
      • Originally raised with EC back in February 2007
      • In August 2007 Apache raised a motion…
    History ©speakuplibrarian Used with permission +
  • What do the JCP ECs think about it?
    • The chair reported the results of an electronic vote on a motion proposed by Apache and seconded by Intel addressing the use of Field Of Use clauses in TCK licenses. The text of the motion was:
    • &quot;TCK licenses must not be used to discriminate against or restrict compatible implementations of Java specifications by including field of use restrictions on the tested implementations or otherwise.  Licenses containing such limitations do not meet the requirements of the JSPA, the agreement under which the JCP operates, and violate the expectations of the Java community that JCP specs can be openly implemented.&quot;
    • The results were:
    • ME EC: 13 in favor, 1 against, 2 ineligible to vote SE/EE EC: 13 in favor, 1 against, 2 ineligible to vote
    • The Chair informed the EC that the PMO will take no further action on this motion.
    http://jcp.org/aboutJava/communityprocess/summaries/2007/September07-summary.html
  • Apache’s JCK issue with Sun
    • Current position
      • Sun have offered new terms for the JCK, that are still unacceptable.
      • Contains FoU limitations on ASF’s usage of the JCK (rather than downstream user restrictions).
          • This would allow us to redistribute under ALv2.
      • However, terms contain the requirement for an ‘official’ notice from Sun regarding IP notice and certification requirements – effectively a de facto augmentation of the Apache License, and therefore unacceptable.
    Apache does not make statements regarding intellectual property other than facts we explicitly know to be true and are thereby disclosed in Notice files and the Apache License. +
  • Agenda
    • Project History
    • Development Model
    • Code and Runtime Modularity
    • How Are We Doing?
    • Demo
    • Harmony and the JCK
    • Wrap-up
  • Summary
    • We invested time up-front getting the IP infrastructure right.
    • Rapidly approaching a full compatible, open-source, implementation of Java SE.
    • The core code has been picked up and used in non-trivial commercial runtimes.
    • Our modularity story has given us flexibility and robustness to progress quickly and maintain stability.
    • Harmony is a fountain of innovation in Java technology.
    The best is yet to come... ©mary_gaston22 flickr.com
  • Active areas of effort
    • Class library providers completion
    • VM performance work
    • Porting to new operating systems
    • Improved test case coverage
    • Real-world application testing
    • Community growth
    What we still need to do … help appreciated Apache Harmony
  • Q&A http://harmony.apache.org Tim Ellison [email_address]