Is there a way to run a RapidMiner process from the Command Line on a Mac?

pm632
pm632 New Altair Community Member
edited November 5 in Community Q&A

I'm new to RapidMiner and I was just wondering it theere is a way to run a RapidMiner Process from the Command Line on a Mac. 

I've tried "

./script/rapidminer  //PresentingProcess/Processes/AutomatedProcessDecider

"

 

I get the error "

./script/rapidminer: No such file or directory

"

Where the second argument is the path to the process (which I copied straight from RapidMiner so should be the correct path). if this is the correct command to run does anyone know where the command should be run from (which Repository)?
Sorry if anything in this question doesn't make sense I'm still new to all of this.

Thanks.

Answers

  • MartinLiebig
    MartinLiebig
    Altair Employee

    Hi,

     

    From the top of my head: If you want to do this you need to use the .sh file and need to use i think -f on the rmp file.

     

    e.g.

    rapidminer-studio.sh -f /home/user/martin/myprocess.rmp

     

    Best,

    Martin

  • pm632
    pm632 New Altair Community Member

     

    Sorry, I still can't get it working. So I've tried running your suggest command in both the RapidMiner repository and the process I want to run's repository. I still get the same "command not found" error. I have also tried following this guide http://activeintelligence.org/blog/archive/rapidminer-command-line/ but i get the same command not found error.

  • sgenzer
    sgenzer
    Altair Employee

    hello @pm632 - welcome to the community.  That's a good question but not really the way RapidMiner Studio is designed to be used.  Although @mschmitz 's suggestion is a clever one, I would propose creating a webservice on RM Server that runs this process, and then calling the webservice from the command line (using cURL for example).

     

    Scott

     

     

  • David_A
    David_A New Altair Community Member

    Hi,

     

    Martin's answer is mostly correct, but not quite.

     

    The correct command is either

     

    sh ./programs/rapidminer-studio/scripts/rapidminer-batch.sh ​"//$repository_name/$process_name"

    ​  where $repository_name is most often "Local Repository"

     

    or

    sh ./programs/rapidminer-studio/scripts/rapidminer-batch.sh ​ -f "/home/demo.rmp"

    when you want to point to a stored RapidMiner process in your file system. 

    In both cases remember to unescape blanks with "\ " .

     

    You can even set macro values via the command line. Therefore the Macro has to be defined in the Process Context view  and you can set it with the parameter -M$macro_name=$value in this case without blanks.

     

    I agree with @sgenzer that for a more sophisticated set-up RapidMiner Server is the much better choice, for a low level implementation, a command line execution is fine, e.g., when logging in via ssh.

     

    Best,
    David

  • fstarsinic
    fstarsinic New Altair Community Member
    edited April 2020
    I'm very interested in trying this but I do not understand the method to pass in a macro (which I assume is a variable, essentially)?.  Also, I'm not understanding the use of the "$" in   -M$macro_name=$value  ??

    does the macro name have to be preceded by a "$" and the same with the macro value?

    Lastly when I did try it I got an exception:

    Launching RapidMiner Studio BATCH now...<br>RapidMiner Studio version 8.0.001, Copyright (C) 2001-2017 RapidMiner GmbH<br>See End User License Agreement information in the file named EULA.<br>Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.rapidminer.launcher.CommandLineLauncher.parseArguments(CommandLineLauncher.java:110)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; at com.rapidminer.launcher.CommandLineLauncher.main(CommandLineLauncher.java:244)<br>(base) c:\Users\me\blah\blah\blah>

    the command line I used had  -Mtsv_file=ABC.tsv
    I also tried  -M$tsv_file=$ABC.tsv  

    This process works fine if I do not pass in a -M so the -M is definitely causing the problem.

    Extra lastly does the macro need to be defined somehow in the process or can it just be referenced like so in the read csv operator, csv file parameter: 
     csv file > c:\data\%{tsv_file



  • fstarsinic
    fstarsinic New Altair Community Member
    I got the macro passed in via a tricky syntax I discovered in a different thread.
    -"Mtsv_file=my_file.tsv"

    Notice the odd placement of the quotes.
    -"M

    So the quote comes after the dash and before the M





  • sgenzer
    sgenzer
    Altair Employee
    hi @fstarsinic I'm going to cc @Marco_Boeck and @jczogalla to see if either of them has any ideas. That's beyond my comfort zone. :smile:

    Scott

  • fstarsinic
    fstarsinic New Altair Community Member
    I got what I needed. It works.