h2oai/mojoland

Name: mojoland

Owner: H2O.ai

Description: Testing ground to ensure mojos backward compatibility

Created: 2016-11-05 16:14:33.0

Updated: 2016-11-22 02:19:41.0

Pushed: 2017-03-29 18:57:40.0

Homepage: null

Size: 13230

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Mojo-land

This is the testing ground to ensure mojos backward compatibility. The goal of this project is to collect pre-trained mojo models (for different mojo versions and various datasets) and their expected scoring results. Then we will routinely test that for each new version of the genmodel runtime all saved mojo models still produce the same results as originally. This will enable us to have full backward compatibility of mojos: old models are guaranteed to be invariant with respect to the updates of the runtime.

Contract

When speaking about backward compatibility, it is essential to understand which things are, and which are not expected to be stable over time.

Mojo versioning

Each mojo file carries an internal version, which is a decimal number for example 1.00 or 2.03. Mojos for different algorithms can have different versions. The minor version (after the decimal dot) should be a 2-digit number, to ensure proper sorting both numerically and lexicographically. The major version must coincide with the version of the MojoModel being created.

Thus, mojo's major version is bumped whenever the MojoModels interface needs to be changed, and the minor version is increased when any internal mojo change occurs.

To summarize:

Runtime hierarchy

At the top level of the runtime's hierarchy is the MojoModel class, which has only minimal amount of functionality (few static functions). This class is extended by MojoModel1, MojoModel2, etc – each class providing bare-bones functionality for their descendants. Each MojoModel{N} class should have only protected or private methods. These classes can then be extended by {Algo}BaseModel{N} classes carrying algo-specific functionality shared by the apis of different versions. Again, these classes must not expose any public methods. Finally, at the last level of the hierarchy live classes {Algo}MojoModel{N}. These are the concrete classes that get instantiated when a mojo is loaded, and they define the API of each mojo: a mojo's API is the set of declared public methods of the corresponding {Algo}MojoModel{N} class.

Separate from this, there is a collection of (versioned) interfaces, each covering some part of the functionality of each {Algo}MojoModel{N}. These interfaces are expected to be more stable over time than the concrete classes, and they can extend each other (for example an interface of version n may extend an interface of version n - 1). The interfaces don't have any predefined naming pattern.

If a mojo model class uses an externally visible class or enum, it should be properly versioned too. For example, consider the “GlrmLoss” enum. “Proper versioning” requires that the enum was called GlrmLoss1, anticipating that there will be future versions GlrmLoss2, GlrmLoss3, etc. Each specific algo then specifies which version of the enum it expects.

Project building

To build the project, please use the provided gradlew command:

./gradlew build
Initializing an editor

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.