Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 4.61 KB

windows-instructions.md

File metadata and controls

112 lines (72 loc) · 4.61 KB

Building Mobius

Prerequisites

JDK should be downloaded manually, and the following environment variables should be set properly in the Developer Command Prompt for Visual Studio:

  • JAVA_HOME

Instructions

  • In the Developer Command Prompt for Visual Studio where JAVA_HOME is set properly, navigate to Mobius\build directory:

     Build.cmd  
    
  • Optional:

    • Under Mobius\scala directory, run the following command to clean spark-clr*.jar built above:

       mvn clean
      
    • Under Mobius\csharp directory, run the following command to clean the .NET binaries built above:

       Clean.cmd  
      

Build.cmd downloads necessary build tools; after the build is done, it prepares the folowing directories under Mobius\build\runtime:

  • lib ( spark-clr*.jar )
  • bin ( Microsoft.Spark.CSharp.Adapter.dll, CSharpWorker.exe)
  • samples ( The contents of Mobius\csharp\Samples\Microsoft.Spark.CSharp\bin\Release\*, including Microsoft.Spark.CSharp.Adapter.dll, CSharpWorker.exe, SparkCLRSamples.exe, SparkCLRSamples.exe.Config etc. )
  • scripts ( sparkclr-submit.cmd )
  • data ( Mobius\csharp\Samples\Microsoft.Spark.CSharp\data\* )

Running Samples

Prerequisites

JDK should be downloaded manually, and the following environment variables should be set properly in the Developer Command Prompt for Visual Studio:

  • JAVA_HOME

Running in Local mode

In the Developer Command Prompt for Visual Studio where JAVA_HOME is set properly, navigate to Mobius\build directory:

RunSamples.cmd  

It is required to run Build.cmd prior to running RunSamples.cmd.

RunSamples.cmd downloads Apache Spark 1.6.0, sets up SPARK_HOME environment variable, points SPARKCLR_HOME to Mobius\build\runtime directory created by Build.cmd, and invokes sparkclr-submit.cmd, with spark.local.dir set to Mobius\build\runtime\Temp.

A few more RunSamples.cmd examples:

  • To display all options supported by RunSamples.cmd:

    RunSamples.cmd  --help
    
  • To run PiSample only:

    RunSamples.cmd  --torun pi*
    
  • To run PiSample in verbose mode, with all logs displayed at console:

    RunSamples.cmd  --torun pi* --verbose
    

Running in Standalone mode

sparkclr-submit.cmd --verbose --master spark://host:port --exe SparkCLRSamples.exe  %SPARKCLR_HOME%\samples sparkclr.sampledata.loc hdfs://path/to/mobius/sampledata
  • When option --deploy-mode is specified with cluster, option --remote-sparkclr-jar is required and needs to be specified with a valid file path of spark-clr*.jar on HDFS.

Running in YARN mode

sparkclr-submit.cmd --verbose --master yarn-cluster --exe SparkCLRSamples.exe %SPARKCLR_HOME%\samples sparkclr.sampledata.loc hdfs://path/to/mobius/sampledata

Running Unit Tests

  • In Visual Studio: Install NUnit3 Test Adapter. Run the tests through "Test" -> "Run" -> "All Tests"

  • Install NUnit Runner 3.0 or above using NuGet (see https://www.nuget.org/packages/NUnit.Runners/). In Developer Command Prompt for VS, set NUNITCONSOLE to the path to nunit console, and navigate to Mobius\csharp and run the following command:

    Test.cmd
    

Debugging Tips

CSharpBackend and C# driver are separately launched for debugging Mobius Adapter or driver.

For example, to debug Mobius samples:

  • Launch CSharpBackend.exe using sparkclr-submit.cmd debug and get the port number displayed in the console.
  • Navigate to csharp/Samples/Microsoft.Spark.CSharp and edit App.Config to use the port number from the previous step for CSharpBackendPortNumber config and also set CSharpWorkerPath config values.
  • Run SparkCLRSamples.exe in Visual Studio.