Skip to content

Submitting a "Hello World" Job Using the CLI

Use the MMCloud CLI to submit a job.

Procedure

  1. On the computer where you installed the MMCloud CLI, create a file called helloworld.sh and insert the following contents.

    #!/bin/bash
    echo "Congratulations! You have submitted your first job"
    for(( c=1; c<3; c++))
    do
            if [[ $(($c % 3)) == 1 ]]; then
                    echo "Hello World!"
            else
                    echo "Your next job will be more interesting"
            fi
                    sleep 20s
    done
    echo "Job complete"
    
  2. Save and then close the file.

  3. Open a terminal on this computer and go to the directory where you created helloworld.sh.

  4. Log in to the OpCenter by entering:

    float login -a <op_center_ip_address> -u <username> -p <password>
    

    Replace <op_center_ip_address> with the public (if you are outside the VPC) or private (if you are inside the VPC) IP address associated with the OpCenter. Use admin for the <username> if you have not added a user and use the default value (memverge) for the admin <password> if you have not changed it.

  5. Submit a job by entering:

    float submit -i cactus -j helloworld.sh -c 2 -m 4 --dataVolume [size=10]:/data
    
  6. Query the job status by entering:

    float squeue
    

    The entry in the first column (labeled ID) is the identifier for your job.

  7. View the output of your example job by entering:

    float log cat stdout.autosave -j <job_id>
    

    Replace <job_id> with the identifier associated with your job.