--cpu 1 --cpu-method fft --timeout 1m --times
11. Scroll to the bottom and click Submit.
In this step, you will submit a job using the AWS CLI.
cat > job.json << EOF
{
"jobName": "stress-ng-1",
"jobQueue": "stress-ng-queue",
"jobDefinition": "stress-ng-job-definition:1",
"containerOverrides": {
"environment": [
{
"name": "STRESS_ARGS",
"value": "--cpu 1 --cpu-method fft --timeout 1m --times"
}
]
}
}
EOF
aws batch submit-job --cli-input-json file://job.json
Note that you are creating a structured JSON file to supply the required parameters of jobName, jobQueue, and jobDefinition as well as defining and passing the environment variable STRESS_ARGS used by your container’s docker-entrypoint.sh script to form the full stress-ng command-line.
If the job does not run, double-check that the job queue name, job definition name and version are correct.
Take note of the jobId returned when you sumbitted the job. You can use this to check the status of the job using the following command (replacing YOUR_JOB_ID with the jobId value returned previously):
aws batch describe-jobs --jobs YOUR-JOB-ID
The returned JSON output displays and describes the status of your job.
It’s sometimes useful to capture of the job information at the time of submission for later use.
Use “jq” utility to allow extraction of relevant fields from the JSON output.
Execute the following commands:
export JOB_INFO=$(aws batch submit-job --cli-input-json file://job.json)
export JOB_ID=$(echo ${JOB_INFO} | jq -r '.jobId')
aws batch describe-jobs --jobs ${JOB_ID}
These commands: