Create a jobbergate job-script using jobbergate-cli

This post is part 3 of getting started using Jobbergate CLI. You will need to have the CLI installed and have at least one application registered in Jobbergate.

Create Job Script

Note: the ID parameter is the application ID the Job Script will be linked to. (“38” in this example)

jobbergate-cli create-job-script \
   --name hello_world \
   --param-file jobbergate-hello-world-application/config.json \
   --id 38

Note: job_script_data_as_string allows the user to review any application files or job scripts rendered with values from the parameter file passed (config.json).

-------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id                         76
job_script_name            hello_world
job_script_description     TEST_DESC
job_script_data_as_string  NEW_FILE
                           print('hello world from application.py')

                           print('{} executed successfully'.format("Jobbergate-Hello-World"))
                           NEW_FILE
                           #!/bin/sh
                           echo "Hellow World"

                           echo "parameters passed to config file:"
                           {'default_template': 'job-script-template.sh.j2', 'supporting_files': ['application-file-template.j2'], 'supporting_files_output_name': {'application-file-template.j2': 'application.py'}, 'output_directory': '.', 'jobname': 'Jobbergate-Hello-World'}

                           # execute example application.py file
                           python application.py
job_script_owner           2
application                38
created_at                 2020-08-06T15:25:03.577359Z
updated_at                 2020-08-06T15:25:03.577384Z
-------------------------  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1. (optional):

a. edit the parameter file (config.json) with your own values and re run the create-job-script command above to view the output with new values you added
b. Add a field of your choice to the parameter file (config.json) and edit the job script template ( job-script-template.sh.j2 ) and/or the application file ( application-file-template.j2 ) to use the new field