Skip to content

Commit

Permalink
assembly building working
Browse files Browse the repository at this point in the history
  • Loading branch information
John Canny committed Aug 20, 2016
1 parent fcdfa3d commit c0efa68
Show file tree
Hide file tree
Showing 5 changed files with 327 additions and 15 deletions.
16 changes: 16 additions & 0 deletions excludes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>assembly</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<excludes>
<exclude>org.scala-lang:scala-reflect</exclude>
</excludes>
<unpack>true</unpack>
</dependencySet>
</dependencySets>
</assembly>
141 changes: 141 additions & 0 deletions pom-assembly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BIDMach</groupId>
<artifactId>BIDMachSpark</artifactId>
<packaging>jar</packaging>
<version>1.1.0-cuda7.5</version>
<name>BIDMachSpark</name>
<description>BIDMach is an optimized machine learning library in Scala</description>
<properties>
<scala.version>2.11.7</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<jline.version>${scala.binary.version}</jline.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>bintray-biddata-BIDData</id>
<name>bintray</name>
<url>http://dl.bintray.com/biddata/BIDData</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>BIDMach</groupId>
<artifactId>BIDMach</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmArgs>
<jvmArg>-Xmx8g</jvmArg>
</jvmArgs>
<args>
<arg>-feature</arg>
<arg>-deprecation</arg>
<arg>-target:jvm-1.7</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptors>
<descriptor>excludes.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<targetPath>lib/</targetPath>
<directory>src/main/resources/lib/</directory>
<excludes>
<exclude>**/*.jar</exclude>
</excludes>
</resource>
</resources>
</build>
<distributionManagement>
<repository>
<id>bintray-biddata-BIDData</id>
<name>biddata-BIDData</name>
<url>https://api.bintray.com/maven/biddata/BIDData/BIDMach/;publish=1;override=1</url>
</repository>
</distributionManagement>
</project>





145 changes: 145 additions & 0 deletions pom-standalone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>BIDMach</groupId>
<artifactId>BIDMachSpark</artifactId>
<packaging>jar</packaging>
<version>1.1.0-cuda7.5</version>
<name>BIDMachSpark</name>
<description>BIDMach is an optimized machine learning library in Scala</description>
<properties>
<scala.version>2.11.8</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<jline.version>${scala.binary.version}</jline.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>central</id>
<name>Maven Repository Switchboard</name>
<layout>default</layout>
<url>http://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>bintray-biddata-BIDData</id>
<name>bintray</name>
<url>http://dl.bintray.com/biddata/BIDData</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
</dependency>
<dependencies>
<dependency>
<groupId>BIDMach</groupId>
<artifactId>BIDMach</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.1</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<jvmArgs>
<jvmArg>-Xmx8g</jvmArg>
</jvmArgs>
<args>
<arg>-feature</arg>
<arg>-deprecation</arg>
<arg>-target:jvm-1.7</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<targetPath>lib/</targetPath>
<directory>src/main/resources/lib/</directory>
<excludes>
<exclude>**/*.jar</exclude>
</excludes>
</resource>
</resources>
</build>
<distributionManagement>
<repository>
<id>bintray-biddata-BIDData</id>
<name>biddata-BIDData</name>
<url>https://api.bintray.com/maven/biddata/BIDData/BIDMach/;publish=1;override=1</url>
</repository>
</distributionManagement>
</project>





21 changes: 10 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<name>BIDMachSpark</name>
<description>BIDMach is an optimized machine learning library in Scala</description>
<properties>
<scalaVersion>2.11.4</scalaVersion>
<scala.version>2.11.7</scala.version>
<scala.binary.version>2.11</scala.binary.version>
<jline.version>${scala.binary.version}</jline.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
Expand All @@ -36,22 +38,19 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scalaVersion}</version>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scalaVersion}</version>
</dependency>
<dependency>z
<groupId>BIDMach</groupId>
<artifactId>BIDMach</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>1.6.2</version>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
Expand Down Expand Up @@ -102,9 +101,9 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<descriptors>
<descriptor>excludes.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
Expand Down
19 changes: 15 additions & 4 deletions spark-shell
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@
# export JAVA_HOME="" # Set here if not set in environment
# export CUDA_PATH="" # Set here if not set in environment
# export SPARK_HOME="" # Set here if not set in environment
BIDMACH_HOME=/opt/BIDMach # Set here if not set in environment
BIDMACH_ROOT="${BASH_SOURCE[0]}"
if [ ! `uname` = "Darwin" ]; then
BIDMACH_ROOT=`readlink -f "${BIDMACH_ROOT}"`
else
while [ -L "${BIDMACH_ROOT}" ]; do
BIDMACH_ROOT=`readlink "${BIDMACH_ROOT}"`
done
fi
BIDMACH_ROOT=`dirname "$BIDMACH_ROOT"`
pushd "${BIDMACH_ROOT}" > /dev/null
BIDMACH_ROOT=`pwd`
BIDMACH_ROOT="$( echo ${BIDMACH_ROOT} | sed s+/cygdrive/c+c:+ )"

JCUDA_VERSION="0.7.0a" # Fix if needed
BIDMACH_JARS=`echo target/BIDMachSpark-*-assembly.jar`

BIDMACH_JARS=$(find ${BIDMACH_HOME}| grep '\.jar' | grep -vE 'IScala.jar|jline.*\.jar' | tr '\n' ',')
#${SPARK_HOME}/bin/spark-shell --master spark://${HOSTNAME}:7077 --jars ${BIDMACH_JARS} --executor-memory 10G --driver-memory 8G

${SPARK_HOME}/bin/spark-shell --master spark://${HOSTNAME}:7077 --jars ${BIDMACH_JARS} --executor-memory 10G --driver-memory 8G
${SPARK_HOME}/bin/spark-shell --master local --jars ${BIDMACH_JARS}

0 comments on commit c0efa68

Please sign in to comment.