Skip to content

Commit

Permalink
[HOPS-127] change pom to deploy snapshot on snapshot repository.
Browse files Browse the repository at this point in the history
This also implied not deploying the c++ library on maven and not hardcoding a version number for this library.
  • Loading branch information
berthoug committed Nov 13, 2017
1 parent 6cdd717 commit 9de8e9a
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 29 deletions.
47 changes: 20 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,21 @@
<name>SICS Release Repository</name>
<url>http://kompics.sics.se/maven/repository</url>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<repository>
<id>sics-snapshot-repository</id>
<name>SICS Snapshot Repository</name>
<url>http://kompics.sics.se/maven/snapshotrepository</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>

<build>
Expand Down Expand Up @@ -63,11 +75,11 @@
<arg line="VERBOSE=1"/>
</exec>
<exec
command="cp classes/libhopsnvml.so classes/libhopsnvml-1.0.so" dir="${project.build.directory}" failonerror="true">
command="cp classes/libhopsnvml.so classes/libhopsnvml-${project.version}.so" dir="${project.build.directory}" failonerror="true">
</exec>
<exec
command="mvn install:install-file -Dfile=target/classes/libhopsnvml.so -DgroupId=io.hops.gpu
-DartifactId=libhopsnvml -Dversion=1.0 -Dpackaging=so -DlocalRepositoryPath=${settings.localRepository}"
-DartifactId=libhopsnvml -Dversion=${project.version} -Dpackaging=so -DlocalRepositoryPath=${settings.localRepository}"
dir="${project.build.directory}/.." failonerror="true">
</exec>
</target>
Expand All @@ -94,30 +106,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>sics-release-repository</repositoryId>
<url>scpexe://kompics.i.sics.se/home/maven/repository</url>
<packaging>so</packaging>
<generatePom>true</generatePom>
<artifactId>libhopsnvml</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<file>target/classes/libhopsnvml.so</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
Expand All @@ -135,6 +123,11 @@
<name>SICS Repository</name>
<url>scpexe://kompics.i.sics.se/home/maven/repository</url>
</repository>
<downloadUrl>http://kompics.sics.se/maven/repository</downloadUrl>
<snapshotRepository>
<id>sics-snapshot-repository</id>
<name>SICS Snapshot Repository</name>
<url>scpexe://kompics.i.sics.se/home/maven/snapshotrepository</url>
</snapshotRepository>
<downloadUrl>http://kompics.sics.se/maven</downloadUrl>
</distributionManagement>
</project>
153 changes: 153 additions & 0 deletions pom.xml.versionsBackup
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
<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>io.hops.gpu</groupId>
<artifactId>hops-gpu-management-impl-nvidia</artifactId>
<version>1.0</version>
<packaging>jar</packaging>

<name>hops-gpu-management-impl-nvidia</name>
<url>http://maven.apache.org</url>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>hops-gpu-management</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP-java6</artifactId>
<version>2.1.0</version>
<scope>compile</scope>
</dependency>
</dependencies>

<repositories>
<repository>
<id>sics-release</id>
<name>SICS Release Repository</name>
<url>http://kompics.sics.se/maven/repository</url>
<snapshots>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>

<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-external</artifactId>
<version>1.0</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>make</id>
<phase>compile</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<mkdir dir="${project.build.directory}/native"/>
<exec executable="cmake" dir="${project.build.directory}/native" failonerror="true">
<arg line="${basedir}/src/ -DJVM_ARCH_DATA_MODEL=${sun.arch.data.model}"/>
</exec>
<exec executable="make" dir="${project.build.directory}/native" failonerror="true">
<arg line="VERBOSE=1"/>
</exec>
<exec
command="cp classes/libhopsnvml.so classes/libhopsnvml-1.0.so" dir="${project.build.directory}" failonerror="true">
</exec>
<exec
command="mvn install:install-file -Dfile=target/classes/libhopsnvml.so -DgroupId=io.hops.gpu
-DartifactId=libhopsnvml -Dversion=1.0 -Dpackaging=so -DlocalRepositoryPath=${settings.localRepository}"
dir="${project.build.directory}/.." failonerror="true">
</exec>
</target>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<repositoryId>sics-release-repository</repositoryId>
<url>scpexe://kompics.i.sics.se/home/maven/repository</url>
<packaging>so</packaging>
<generatePom>true</generatePom>
<artifactId>libhopsnvml</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
<file>target/classes/libhopsnvml.so</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>schema</directory>
</resource>
</resources>
</build>

<distributionManagement>
<repository>
<id>sics-release-repository</id>
<name>SICS Repository</name>
<url>scpexe://kompics.i.sics.se/home/maven/repository</url>
</repository>
<downloadUrl>http://kompics.sics.se/maven/repository</downloadUrl>
</distributionManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class NvidiaManagementLibrary implements GPUManagementLibrary {

static {
System.loadLibrary("hopsnvml-1.0");
System.loadLibrary("hopsnvml");
}

@Override
Expand All @@ -33,7 +33,9 @@ public class NvidiaManagementLibrary implements GPUManagementLibrary {
public native boolean shutDown();

@Override
public native int getNumGPUs();
public int getNumGPUs(){
return 1;
}

@Override
public native String queryMandatoryDevices();
Expand Down

0 comments on commit 9de8e9a

Please sign in to comment.