You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ dcos job run job-1RUN: CAkCDQIBCw8AAAADB
$ dcos job run listRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Deploying 1m ago
Run a job defintion with parameters
$ vi options.yamlcores: 4w!
$ dcos job run job-1 --parameters options.yamlRUN: CAwgLBgUKDgsOAgBBA
$ dcos job run listRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 10m ago CAwgLBgUKDgsOAgBBA job-1 Running 2m ago
Run an ad-hoc job
$ vi rm-logs.yamlname: rm-logsjob: hello: count: 1 tasks: foo: cmd: find . -type f -name .log -delete cpu: 1 mem: 128w!
$ dcos job ad-hoc run rm-logs.yamlRUN: gQKDwUBDgDOgBDwUBD
# Notice the ad-hoc job is not show in the job definition list
$ dcos job definition listNAME REVISION NEXT-RUN LAST-RUN LAST-RUN-STATUSjob-1 7 1d 5m ago Running
# Note the ad-hoc job run is shown is the list
$ dcos job run listRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 10m ago CAwgLBgUKDgsOAgBBA job-1 Running 5m agogQKDwUBDgDOgBDwUBD rm-logs Queued 1m ago 1
Show details for a run
$ dcos job run show CAkCDQIBCw8AAAADBANAME REVISION STATUS ACCEPTED STARTED ENDED ATTEMPTSjob-1 7 Succeeded 10m ago 10m ago 8m ago 2/10
Show parameters for a job run
$ dcos job run show CAkCDQIBCw8AAAADBA --parametersPARAMETER VALUEcores 2
List run attempts
$ dcos job run attempt list CAkCDQIBCw8AAAADBATTEMPT STATUS STARTED ENDED 1 Failed 10m ago 9m ago2 Succeeded 9m ago 8m ago
$ dcos task log CAoDBQsOBAcHCQIHBA2018-03-04 07:27:53 Activity 0x22310 4267 0 syncdefaultsd: (libsystem_info.dylib) Retrieve User by ID2018-03-04 07:27:53 Activity 0x22311 4267 0 syncdefaultsd: (CoreFoundation) Loading Preferences From User CFPrefsD2018-03-04 07:27:53 Activity 0x22312 4267 0 syncdefaultsd: (libsystem_info.dylib) Membership API: translate identifier2018-03-04 07:27:53 Activity 0x22313 4267 0 syncdefaultsd: (CoreFoundation) Loading Preferences From System CFPrefsD
Cancel a job run
$ dcos job run cancel CAkCDQIBCw8AAAADBA
$ dcos job run listRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 10m ago - CAwgLBgUKDgsOAgBBA job-1 Running 5m ago -gQKDwUBDgDOgBDwUBD rm-logs Cancelled 5s ago -
Submit three adhoc job runs quickly
$ foriin`seq 1 3`;
> do
> dcos job adhoc run rm-logs.yaml
> doneRUN: AQoEDAYMDwwICwgABARUN: BgYICwYEBAgLAQEOBARUN: AgMNAgINDw4OBAUPBA
$ dcos job run listRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 10m ago - CAwgLBgUKDgsOAgBBA job-1 Running 5m ago -gQKDwUBDgDOgBDwUBD rm-logs Cancelled 5s ago -AQoEDAYMDwwICwgABA rm-logs Deploying 1s ago -BgYICwYEBAgLAQEOBA rm-logs Queued 1s ago 1AgMNAgINDw4OBAUPBA rm-logs Queued 1s ago 2
List job runs with filtering by status
$ dcos job run list --status succeededRUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 15m ago - CAwgLBgUKDgsOAgBBA job-1 Succeeded 5m ago -
List job runs with filtering by name
$ dcos job run list --name job-1RUN NAME STATUS STATUS-DETAIL POSITIONCAkCDQIBCw8AAAADBA job-1 Succeeded 15m ago - CAwgLBgUKDgsOAgBBA job-1 Succeeded 5m ago -
List job runs with filtering by start time and end time
$ dcos job run list --start-time 2018-04-10T12:00:00 --end-time 2018-04-10T12:00:10RUN NAME STATUS STATUS-DETAIL POSITIONgQKDwUBDgDOgBDwUBD rm-logs Cancelled 5m ago -AQoEDAYMDwwICwgABA rm-logs Deploying 1m ago -BgYICwYEBAgLAQEOBA rm-logs Queued 1m ago 1AgMNAgINDw4OBAUPBA rm-logs Queued 1m ago 2
List runs with multiple filters
$ dcos job run list --status queued --start-time 2018-04-10T12:00:00 --end-time 2018-04-10T12:00:10RUN NAME STATUS STATUS-DETAIL POSITIONBgYICwYEBAgLAQEOBA rm-logs Queued 1m ago 1AgMNAgINDw4OBAUPBA rm-logs Queued 1m ago 2
$ dcos config set job queue https://dcos-1.us-west-2.elb.amazonaws.com/eng/dev/queue-service
$ dcos job --helpDescription: Define, schedule, and run jobs.Usage: dcos job definition add <definition-file> dcos job definition list dcos job definition show <definition> [--revision] dcos job definition update <definition> dcos job definition delete <definition> [--cancel-runs] dcos job run <definition> [--parameters <parameters-file>] dcos job run list [--name --status --start-time --end-time --time-format --max-results] dcos job run show <run> dcos job run cancel <run> dcos job run attempt list <run> dcos job run attempt show <run> <attempt> dcos job run attempt cancel <run> <attempt> dcos job adhoc run <definition> [--parameters <parameters-file>]Commmands: dcos job --help dcos job --info dcos job --version dcos job definition add <definition-file> [--parameters <parameters-file>] Add a job definition to the job definition store. dcos job definition list List job definitions in the job definition store. dcos job definition show <definition> [--revision] Show details of a stored job definition. dcos job definition update <definition-file> Update a job definition in the job defintion store. dcos job definition delete <definition> [--cancel-runs] Delete a job definition from the job definition store. dcos job run <definition> [--parameters <option-file>] Run a job definition. dcos job run list [--name --status --start-time --end-time --time-format --max-results] List job runs. dcos job run show <run> Show details of a job run. dcos job run cancel <run> Cancel a job run. dcos job run attempt list <run> List attempts for a job run. dcos job run attempt show <run> <attempt> Show details of a job run attempt. dcos job run attempt cancel <run> <attempt> Cancel a job run attempt. The next attempt if start if the attempt limit has not been reached. dcos job adhoc run <definition-file> [--parameters <parameters-file>] Submit an adhoc job run. The job definition do not show up is the list of job definitions.Options: -h, --help Print usage. --version Print version information. --info Print a short description of this subcommand. --json Print JSON-formatted list instead of a table. --yaml Print YAML-formatted list instead of a table. --cancel-runs Indicates all runs should be cancelled. --parameters A YAML formatted parameters for a job run (for example, --parameters job-credentials.yaml). --revision Show a specific revision of a job (for example, --revision 2). --attempt The attempt ID of a job run attempt (for example, --attempt 2). --name The name of the job run to filter by. --status One of more comma seperated statuses (for example, --status SUCCEEDED,FAILED) where valid values are: * WAITING: The job run is waiting for job dependencies to complete successfully. * QUEUED: The job run is eledgible to run and assigned a position. * DEPLOYING: The job run is staging to the cluster. * RUNNING: The job run is executing in the cluster. * SUCCEEDED: The job run was completed successfully (exit code was 0). * FAILED: The job run was completed but all attempts failed (exit code was non-zero). * CANCELLED: The job run was cancelled by user. --start-time The time that determines the first result to return. Acceptable time formats include: * Date (for example, --start-time 2018-12-31). * Date and time in local time (for example, --start-time 2018-12-31T23:59:59). * Date and time in UTC time (for example, --start-time 2018-12-31T23:59:59Z). * Date and time in UTC time with offset (for example, --start-time 2018-12-31T23:59:59Z-08:00). * Unix time in seconds (for example, --start-time 1517471999). --end-time The time that determines the last result to return. Acceptable time formats include: * Date (for example, --end-time 2018-12-31). * Date and time in local time (for example, --end-time 2018-12-31T23:59:59). * Date and time in UTC time (for example, --end-time 2018-12-31T23:59:59Z). * Date and time in UTC time with offset (for example, --end-time 2018-12-31T23:59:59Z-08:00). * Unix time in seconds (for example, --end-time 1517471999). --time-format Indicates the format to display date and time. Default is simple. Acceptable values are: * simple - Summary of the remaining time or elapsed time (for example, 10m ago). s: Seconds m: Minutes h: Hours d: Days W: Weeks M: Months D: Years * timestamps - Unix timestamp in seconds since epoch (for example, 1517471999). * datatime - ISO 8601 compatible data and time (for example, 2018-12-31T23:59:59-8000). --max-result The maximum number of results to return (for example, --max-results 100). Default is 25.Positional Arguments: <definition> The job ID (for example, backup-job). <run> The run ID of a job run (for example, 5999fc27-6415-4f42-91e8-29df545bbf8b). <definition-file> A YAML formatted definition of the job (for example, rm-logs.yaml).
$ dcos job --helpDescription: Deploy and manage jobs in DC/OS. Usage: dcos job --config-schema dcos job --help dcos job --info dcos job --version dcos job add <job-file> dcos job remove <job-id> [--stop-current-job-runs] dcos job show <job-id> dcos job update <job-file> dcos job kill <job-id> [<run-id>][--all] dcos job run <job-id> [--json] dcos job list [--json|--quiet] dcos job schedule add <job-id> <schedule-file> dcos job schedule show <job-id> [--json] dcos job schedule remove <job-id> <schedule-id> dcos job schedule update <job-id> <schedule-file> dcos job show runs <job-id> [--run-id <run-id>][--json|--quiet] dcos job history <job-id> [--json|--quiet] [--failures --last]Commands: job add Add a job. job remove Remove a job. job show Show the job. job update Update the job. job kill Kill the job. job run Run a job now. job list Show all job definitions. job schedule add Adds a schedule to a job. job schedule show Shows the schedules of a job. job schedule remove Removes a schedule from a job. job schedule update Updates a schedule on a job. job show runs Shows the successful and failure runs of a job. job history Provides a job run history.Options: -h, --help Print usage. --version Print version information. --config-schema Show the configuration schema for the Metronome subcommand. --info Print a short description of this subcommand. --stop-current-job-runs Indicates on a job removal that all current running jobs should be killed. --all Instead of specifying a run_id to kill, indicates all runs should be killed. --json Print JSON-formatted list instead of a table. -q, --quiet Indicates a quiet mode which results in just an array of run ids. -f, --failures Indicates to show the failure table and statistics for history. -l, --last Shows the last ID for history job.Positional Arguments: <job-id> The job ID. <job-file> A JSON formatted file of a job. <run-id> The run ID of a job run. <schedule-file> A JSON formatted file of a job schedule. <schedule-id> The schedule ID.