radanalyticsio / radanalyticsio.github.io

a developer oriented site for the radanalytics organization
https://radanalytics.io
10 stars 27 forks source link

Fabric8 Maven Plugin Example #206

Open YegorMaksymchuk opened 6 years ago

YegorMaksymchuk commented 6 years ago

Hello !

I've found an error in Fabric8 maven plugin example application

Preconditions:

  1. Install maven
  2. Install openshift
  3. Execute oc cluster up or use remote server with openshift
  4. Login to Openshift and select empty project in terminal (oc login and oc new-project <project_name>)

Steps to reproduce:

  1. Execute oc create -f https://radanalytics.io/resources.yaml
  2. Clone repositories Kafka , WebUI, Spark
  3. Go to folder with Kafka and run mvn clean fabric8:deploy
  4. Go to folder with WebUI and run mvn clean fabric8:deploy
  5. Go to folder with Spark and run mvn clean fabric8:deploy

Actual result: With Spark versions 2.1.0 and 2.2.0 I got the same result. All parts of the application were deployed but an integration between Sprak and WebUI is broken. With errors in Spark-pod-log: `+ [[ /usr/local/s2i/run == \/\u\s\r\/\l\o\c\a\l\/\s\2\i ]]

In case if I change spark version in Spark/pom.xm form 2.1.0 (2.2.0) to 2.3.0, maven can't build project:

[ymaks@ymaks test]$ cd voxxed-bigdata-spark/ [ymaks@ymaks voxxed-bigdata-spark]$ mvn clean fabric8:deploy [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for com.voxxed.bigdata:voxxed-bigdata-spark:jar:1.0-SNAPSHOT [WARNING] The expression ${build.finalName} is deprecated. Please use ${project.build.finalName} instead. [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] --------------< com.voxxed.bigdata:voxxed-bigdata-spark >--------------- [INFO] Building voxxed-bigdata-spark 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/commons-codec/commons-codec/maven-metadata.xml Downloading from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/maven-metadata.xml Downloading from apache.snapshots: https://repository.apache.org/snapshots/commons-codec/commons-codec/maven-metadata.xml Downloaded from central: https://repo.maven.apache.org/maven2/commons-codec/commons-codec/maven-metadata.xml (642 B at 1.0 kB/s) Downloaded from apache.snapshots: https://repository.apache.org/snapshots/commons-codec/commons-codec/maven-metadata.xml (339 B at 236 B/s) Downloading from apache.snapshots: https://repository.apache.org/snapshots/commons-codec/commons-codec/2.0-SNAPSHOT/maven-metadata.xml Downloading from sonatype-nexus-snapshots: https://oss.sonatype.org/content/repositories/snapshots/commons-codec/commons-codec/2.0-SNAPSHOT/maven-metadata.xml Downloaded from apache.snapshots: https://repository.apache.org/snapshots/commons-codec/commons-codec/2.0-SNAPSHOT/maven-metadata.xml (2.5 kB at 2.0 kB/s) [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ voxxed-bigdata-spark --- [INFO] [INFO] >>> fabric8-maven-plugin:3.2.28:deploy (default-cli) > install @ voxxed-bigdata-spark >>> [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ voxxed-bigdata-spark --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/resources [INFO] [INFO] --- fabric8-maven-plugin:3.2.28:resource (default) @ voxxed-bigdata-spark --- [INFO] F8: Running in OpenShift mode [INFO] F8: Using docker image name of namespace: fabric8-maven-plugin [INFO] F8: Running generator java-exec [INFO] F8: java-exec: Using Docker image radanalyticsio/radanalytics-java-spark as base / builder [INFO] F8: Using resource templates from /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/fabric8 [INFO] F8: fmp-service: Adding a default Service with ports [8080] [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ voxxed-bigdata-spark --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- scala-maven-plugin:3.2.1:compile (default) @ voxxed-bigdata-spark --- [INFO] artifact commons-codec:commons-codec: checking for updates from central [INFO] artifact commons-codec:commons-codec: checking for updates from spy [WARNING] Expected all dependencies to require Scala version: 2.11.8 [WARNING] com.twitter:chill_2.11:0.8.4 requires scala version: 2.11.8 [WARNING] org.apache.spark:spark-core_2.11:2.3.0 requires scala version: 2.11.8 [WARNING] org.json4s:json4s-jackson_2.11:3.2.11 requires scala version: 2.11.0 [WARNING] Multiple versions of scala libraries detected! [INFO] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala:-1: info: compiling [INFO] Compiling 5 source files to /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/target/classes at 1529924157678 [ERROR] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala/com/voxxed/bigdata/spark/KafkaSupport.scala:3: error: object admin is not a member of package kafka [ERROR] import kafka.admin.AdminUtils [ERROR] ^ [ERROR] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala/com/voxxed/bigdata/spark/KafkaSupport.scala:4: error: object utils is not a member of package kafka [ERROR] import kafka.utils.ZkUtils [ERROR] ^ [ERROR] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala/com/voxxed/bigdata/spark/KafkaSupport.scala:39: error: not found: value ZkUtils [ERROR] val zkUtils = ZkUtils("zookeeper:2181", 10000, 10000, isZkSecurityEnabled = false) [ERROR] ^ [ERROR] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala/com/voxxed/bigdata/spark/KafkaSupport.scala:39: error: not found: value isZkSecurityEnabled [ERROR] val zkUtils = ZkUtils("zookeeper:2181", 10000, 10000, isZkSecurityEnabled = false) [ERROR] ^ [ERROR] /home/ymaks/sources/IdeaProjects/test/voxxed-bigdata-spark/src/main/scala/com/voxxed/bigdata/spark/KafkaSupport.scala:41: error: not found: value AdminUtils [ERROR] AdminUtils.createTopic(zkUtils, name, 1, 1) [ERROR] ^ [ERROR] 5 errors found [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 27.473 s [INFO] Finished at: 2018-06-25T13:56:02+03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal net.alchim31.maven:scala-maven-plugin:3.2.1:compile (default) on project voxxed-bigdata-spark: wrap: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] [ERROR]

Expected result: Application should work in the same scenario like in description of Example

elmiko commented 6 years ago

hi @YegorMaksymchuk , thanks for the report!

i will take a look at the tutorial to see if i can reproduce your results.

YegorMaksymchuk commented 6 years ago

Hi! @elmiko so for run all spark pods with version 2.1.0 need specify tag:v.0.2.7 in resources.yaml and in Spark\pom.xml in plugin section set:

             <generator>
                   <config>
                       <java-exec>
                           <!-- The radanalytics java-spark image -->
                           <from>radanalyticsio/radanalytics-java-spark:v0.2.7</from>
                       </java-exec>
                   </config>
               </generator>

after that each spark pod will be with version 2.1.0. But application not work properly you can't get recommendation: Kafka log : https://pastebin.com/j1MhK4RN Spark log: https://pastebin.com/ge5eEayq WebUI: Part1: https://pastebin.com/3kHx9LtN Part2: https://pastebin.com/jGcu08Vh Part3: https://pastebin.com/LRA7M7bV

elmiko commented 6 years ago

After reviewing the source code for this tutorial, i think we should hold off on automated testing for it. i would like to propose that we refactor this code into a new tutorial that just focuses on using the maven fabric8 plugin to deploy spark clusters with oshinko.

elmiko commented 6 years ago

@tmckayus @willb i would love to hear your thoughts on this