Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Page Navigation:

Table of Contents


(blue star) 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)

Table of Contents

toc

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

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


  2. Build Docker Hello World image from docker_matlab/

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


  3. Run hello_world:latest in a Docker container

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


  4. Execute the hello_world script inside the container

    Code Block
    /home/ops/verdi/ops/hello_world/hello_world 


    The output should look like the following:

    Code Block
    $ /home/ops/verdi/ops/hello_world/hello_world
    Hello World!


Running Hello World (HySDS)

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

    Code Block
    sds status

    If it is not running, run:

    Code Block
    sds start all


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

    Code Block
    sds ci add_job -b master https://github.com/aria-jpl/docker_matlab.git s3


  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).

    Image Removed


    Image Added



  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:




(lightbulb) Have Questions? Ask a HySDS Developer:

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

(blue star)

JPLers can also ask HySDS questions atStack Overflow Enterprise

(blue star)

Live Search
placeholderSearch HySDS Wiki