How to run a Matlab-based PGE Job

 


Confidence Level TBD  This article has not been reviewed for accuracy, timeliness, or completeness. Check that this information is valid before acting on it.

Confidence Level TBD  This article has not been reviewed for accuracy, timeliness, or completeness. Check that this information is valid before acting on it.

 

TODO: @Alexander Torres (see https://hysds-core.atlassian.net/browse/HC-95)

Introduction

This guide will teach you to run a stand alone MATLAB application (i.e. Hello World) locally and in a HySDS cluster. This tutorial uses a compiled Hello_World MATLAB executable which does require a MATLAB license to run. The process used to create the MATLAB executable was followed by the following link: Compiling MATLAB Scripts into Executables to Reduce the Use of Licenses*

*Note that the executable must be compiled on the same OS platform (e.g. Linux, Mac OS, Windows) that it will be executed from 

Requirements

  • Docker

  • MATLAB

  • Configured HySDS Cluster

Running Hello World (Locally)

  1. Git pull the docker_matlab repo into work directory

    git pull https://github.com/aria-jpl/docker_matlab.git .



  2. Build Docker Hello World image from docker_matlab/

    docker build . -f docker/Dockerfile.hello_world -t hello_world:latest



  3. Run hello_world:latest in a Docker container

    docker run --name "hello_world" -ti hello_world:latest /bin/bash



  4. Execute the hello_world script inside the container



    The output should look like the following:



Running Hello World (HySDS)

  1. Ensure that your HySDS cluster is up and running by logging into the MOZART instance and running:

    If it is not running, run:



  2. Configure the docker_matlab repo as a new job type for continuous integration and deployment



  3. Navigate to your ci instance (e.g. http://<your-ci-instance>:8080) to validate that the jenkins job was configured. You should see your jenkins job named as "container-builder_<your repo name>_<branch>" (e.g. container-builder_gmanipon_hello_world_master).





  4. Verify that the jenkins job runs to completion by manually scheduling a build. The jenkins job will build the docker image, publish it to your S3 code bucket, and register the job types into you HySDS cluster. Click on the green arrow and view the console output to validate.


  5. Navigate to your grq instance (e.g. http://<your-grq-instance>/search) and click on the "On-Demand" button.



  6. From the On-Demand screen, fill in the highlighted parameters as shown in the figure below and click "Process Now":



  7. Navigate to your mozart instance (e.g. http://<your-mozart-instance>/figaro)* to view your job. You can facet on it by looking for the "my_hello_world" tag. The job should go through the  "Queued", "Started", and "Completed" states. 


  8. From your completed job, click on the "work directory" link to view the live work directory on factotum. All STDOUT output will go into the _stdout.txt file.



    Here's what _stdout.txt should show:






Related Articles:

Related Articles:

Have Questions? Ask a HySDS Developer:

Anyone can join our public Slack channel to learn more about HySDS. JPL employees can join #HySDS-Community

JPLers can also ask HySDS questions at Stack Overflow Enterprise

Search HySDS Wiki

Page Information:

Page Information:

Was this page useful?

Yes No

Contribution History:

Subject Matter Expert:

@Alexander Torres

@Gerald Manipon

Find an Error?

Is this document outdated or inaccurate? Please contact the assigned Page Maintainer:

@Alexander Torres

 

Note: JPL employees can also get answers to HySDS questions at Stack Overflow Enterprise: