Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JavaFX dependency complicates deployment #491

Closed
skidder opened this issue Oct 11, 2016 · 1 comment
Closed

JavaFX dependency complicates deployment #491

skidder opened this issue Oct 11, 2016 · 1 comment

Comments

@skidder
Copy link
Contributor

skidder commented Oct 11, 2016

The JavaFX javafx.util.Pair is used by 3 classes in the production htm.java codebase (src/main/java). JavaFX isn't a problem on bare-metal hardware or virtual machines, but Docker deployments are more challenging. JavaFX requires a window manager that isn't available on container architectures. Most Docker base images with the JDK or JRE do not provide JavaFX at runtime, resulting in an exception like the following:

java.lang.NoClassDefFoundError: javafx/util/Pair
    at org.numenta.nupic.algorithms.TemporalMemory.compute(TemporalMemory.java:145)
    at org.numenta.nupic.network.Layer.temporalInput(Layer.java:1942)
    at org.numenta.nupic.network.Layer$FunctionFactory$2.call(Layer.java:2285)
    at org.numenta.nupic.network.Layer$FunctionFactory$2.call(Layer.java:2274)
    at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
    at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
    at rx.internal.operators.OperatorFilter$1.onNext(OperatorFilter.java:54)
    at rx.internal.operators.OperatorMap$1.onNext(OperatorMap.java:55)
    at rx.internal.operators.OperatorCast$1.onNext(OperatorCast.java:50)
    at rx.internal.operators.OperatorFilter$1.onNext(OperatorFilter.java:54)
    at rx.subjects.SubjectSubscriptionManager$SubjectObserver.onNext(SubjectSubscriptionManager.java:224)
    at rx.subjects.PublishSubject.onNext(PublishSubject.java:114)
    at org.numenta.nupic.network.Layer.compute(Layer.java:937)
    at org.numenta.nupic.network.Region.compute(Region.java:250)
    at org.numenta.nupic.network.Network.computeImmediate(Network.java:630)
    at org.numenta.nupic.flink.streaming.api.operator.AbstractHTMInferenceOperator.processInput(AbstractHTMInferenceOperator.java:122)
    at org.numenta.nupic.flink.streaming.api.operator.AbstractHTMInferenceOperator.processElement(AbstractHTMInferenceOperator.java:102)
    at org.numenta.nupic.flink.streaming.api.operator.KeyedHTMInferenceOperator.processElement(KeyedHTMInferenceOperator.java:95)
    at org.apache.flink.streaming.runtime.io.StreamInputProcessor.processInput(StreamInputProcessor.java:176)
    at org.apache.flink.streaming.runtime.tasks.OneInputStreamTask.run(OneInputStreamTask.java:66)
    at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:266)

This seems overkill just to support a Pair class that could be provided numerous other ways. Can you provide a custom Pair implementation, or use a Pair implementation from an existing library dependency (e.g. chaschev.lang.Pair)?

@cogmission
Copy link
Collaborator

@skidder Yes, I am intending to change this (right now in my current PR actually) because I suspected weird handling of the bundled JavaFX (later on).

Feel free to add a Pair class to org.numenta.nupic.utils with a getFirst() / getLast() method or equivalent names of your choosing? ...and submit a PR and I will just use yours?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants