Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
[MXNET-1177]Adding Scala Demo to be run as a part of Nightly CI (#13823)
Browse files Browse the repository at this point in the history
* Adding Scala Demo to be run as a part of Nightly CI

* Addressed PR feedback : making a profile to fetch nightly jars only on CI

* Changed name from scalacidemo to scala_ci_demo

* Synchronized the scala-demo and java-demo for nightly CI runs

* Pruned the maven command to simply maven install

* changed running from ./.sh to bash .sh to be consistent
  • Loading branch information
piyushghai authored and lanking520 committed Jan 14, 2019
1 parent ac25eca commit 22e2ef8
Show file tree
Hide file tree
Showing 8 changed files with 89 additions and 19 deletions.
13 changes: 10 additions & 3 deletions ci/docker/runtime_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1239,11 +1239,18 @@ nightly_tutorial_test_ubuntu_python2_gpu() {
nightly_java_demo_test_cpu() {
set -ex
cd /work/mxnet/scala-package/mxnet-demo/java-demo
make javademo
./bin/java_sample.sh
./bin/run_od.sh
make java_ci_demo
bash bin/java_sample.sh
bash bin/run_od.sh
}

nightly_scala_demo_test_cpu() {
set -ex
cd /work/mxnet/scala-package/mxnet-demo/scala-demo
make scala_ci_demo
bash bin/demo.sh
bash bin/run_im.sh
}

# Deploy

Expand Down
13 changes: 7 additions & 6 deletions scala-package/mxnet-demo/java-demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.

SCALA_VERSION_PROFILE := 2.11
MXNET_VERSION := [1.5.0-SNAPSHOT,\)

ifeq ($(OS),Windows_NT)
UNAME_S := Windows
Expand All @@ -41,11 +40,13 @@ else
endif

javademo:
(mvn install dependency:copy-dependencies package -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dmxnet.version=$(MXNET_VERSION))
(mvn install -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE))

java_ci_demo:
(mvn -Pci-nightly install -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE))

javaclean:
(mvn clean -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dmxnet.version=$(MXNET_VERSION))
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE))
7 changes: 3 additions & 4 deletions scala-package/mxnet-demo/java-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ You can use the following instruction as an alternative to achieve the same resu
User are required to use `mvn package` to build the package,
which are shown below:
```Bash
export SCALA_VERSION_PROFILE=2.11 MXNET_VERSION=1.5.0-SNAPSHOT
export SCALA_VERSION_PROFILE=2.11
export SCALA_PKG_PROFILE=
mvn package -Dmxnet.profile=$SCALA_PKG_PROFILE \
-Dmxnet.scalaprofile=$SCALA_VERSION_PROFILE \
-Dmxnet.version=$MXNET_VERSION
-Dmxnet.scalaprofile=$SCALA_VERSION_PROFILE
```
These environment variable (`SCALA_PKG_PROFILE`, `SCALA_VERSION_PROFILE`, `MXNET_VERSION`)
These environment variable (`SCALA_PKG_PROFILE`, `SCALA_VERSION_PROFILE`)
should be set before executing the line above.
The `SCALA_PKG_PROFILE` should be chosen from `osx-x86_64-cpu`, `linux-x86_64-cpu` or `linux-x86_64-gpu`.

Expand Down
35 changes: 35 additions & 0 deletions scala-package/mxnet-demo/java-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
<version>1.0-SNAPSHOT</version>
<name>MXNet Java Demo</name>

<profiles>
<profile>
<id>ci-nightly</id>
<repositories>
<repository>
<id>Apache Snapshot</id>
<url>https://repository.apache.org/content/groups/snapshots</url>
</repository>
</repositories>
<properties>
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version>
</properties>
</profile>
</profiles>

<repositories>
<repository>
<id>Apache Snapshot</id>
Expand All @@ -18,6 +33,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version>
</properties>

<dependencies>
Expand All @@ -33,4 +49,23 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.9</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
8 changes: 5 additions & 3 deletions scala-package/mxnet-demo/scala-demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

SCALA_VERSION_PROFILE := 2.11
SCALA_VERSION := 2.11.8
MXNET_VERSION := 1.3.0

ifeq ($(OS),Windows_NT)
UNAME_S := Windows
Expand All @@ -44,11 +43,14 @@ endif
scalademo:
(mvn package -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dmxnet.version=$(MXNET_VERSION) \
-Dscala.version=$(SCALA_VERSION))

scala_ci_demo:
(mvn -Pci-nightly package -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dscala.version=$(SCALA_VERSION))

scalaclean:
(mvn clean -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dmxnet.version=$(MXNET_VERSION) \
-Dscala.version=$(SCALA_VERSION))
5 changes: 2 additions & 3 deletions scala-package/mxnet-demo/scala-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ This is an project created to use Maven-published Scala package with two Scala e
User are required to use `mvn package` to build the package,
which are shown below:
```Bash
export SCALA_VERSION_PROFILE=2.11 SCALA_VERSION=2.11.8 MXNET_VERSION=1.3.0
export SCALA_VERSION_PROFILE=2.11 SCALA_VERSION=2.11.8
export SCALA_PKG_PROFILE=
mvn package -Dmxnet.profile=$(SCALA_PKG_PROFILE) \
-Dmxnet.scalaprofile=$(SCALA_VERSION_PROFILE) \
-Dmxnet.version=$(MXNET_VERSION) \
-Dscala.version=$(SCALA_VERSION)
```
These environment variable (`SCALA_PKG_PROFILE`, `SCALA_VERSION_PROFILE`, `MXNET_VERSION`, `SCALA_VERSION`)
These environment variable (`SCALA_PKG_PROFILE`, `SCALA_VERSION_PROFILE`, `SCALA_VERSION`)
should be set before executing the line above.

To obtain the most recent MXNet version, please click [here](https://mvnrepository.com/search?q=org.apache.mxnet)
Expand Down
19 changes: 19 additions & 0 deletions scala-package/mxnet-demo/scala-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@
<name>MXNet Scala Demo</name>
<packaging>pom</packaging>

<profiles>
<profile>
<id>ci-nightly</id>
<repositories>
<repository>
<id>Apache Snapshot</id>
<url>https://repository.apache.org/content/groups/snapshots</url>
</repository>
</repositories>
<properties>
<mxnet.version>[1.5.0-SNAPSHOT, )</mxnet.version>
</properties>
</profile>
</profiles>

<properties>
<mxnet.version>[1.3.1, )</mxnet.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.mxnet</groupId>
Expand Down
8 changes: 8 additions & 0 deletions tests/nightly/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ core_logic: {
}
}
},
'Scala Demo: CPU': {
node(NODE_LINUX_CPU) {
ws('workspace/scala-demo') {
utils.init_git()
utils.docker_run('ubuntu_nightly_cpu', 'nightly_scala_demo_test_cpu', false)
}
}
},
'MXNetJS: CPU': {
node(NODE_LINUX_CPU) {
ws('workspace/nt-mxnetjs') {
Expand Down

0 comments on commit 22e2ef8

Please sign in to comment.