How to run a Matlab-based PGE Job
Page Navigation: |
---|
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 HC-95: create Matlab-based hello world PGEClosed)
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)
Git pull the docker_matlab repo into work directory
git pull https://github.com/aria-jpl/docker_matlab.git .
Build Docker Hello World image from docker_matlab/
docker build . -f docker/Dockerfile.hello_world -t hello_world:latest
Run hello_world:latest in a Docker container
docker run --name "hello_world" -ti hello_world:latest /bin/bash
Execute the hello_world script inside the container
The output should look like the following:
Running Hello World (HySDS)
Ensure that your HySDS cluster is up and running by logging into the MOZART instance and running:
If it is not running, run:
Configure the docker_matlab repo as a new job type for continuous integration and deployment
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).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.
Navigate to your
grq
instance (e.g. http://<your-grq-instance>/search) and click on the "On-Demand" button.From the On-Demand screen, fill in the highlighted parameters as shown in the figure below and click "Process Now":
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.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:
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
|