CLI commands
What is the CLI?
The CLI is the Dexen Command Line Interface. Using the CLI, the user can type in commmand to be executed by Dexen. For users that are used to graphical interfaces, the CLI may at first look rather menacing, but in reality it is not difficult to use. A useful command to get started is the help command (just type help or h and hit return.)
For instructions on how to start the CLI, see Starting Dexen.
The CLI can be used to issue various commands for managing jobs and for downloading data.
All commands are listed below. For each command there is a long form and a short form.
Managing jobs
Managing jobs involves starting, stopping, and deleting jobs. You will also need to be able to see which jobs are currently on the server. The following commands allow you to perform these commands:
- start_new_job JOB_NAME JOB_DIR_PATH
- snj JOB_NAME JOB_DIR_PATH
- Start a new job on the server. The JOB_NAME is a unique job name, and JOB_DIR_PATH is the location of the JobDef folder. If the JobbDef folder contains a file called settings.xml, then Python code will be generated using the JobDef generator specified in the xml file. The Python code will be generated in the same folder as the settings file, and any existing Python files in that folder will be deleted. For more information, see Generating JobDefs.
- stop_job JOB_ID
- sj JOB_ID
- Stop a job running on the server. JOB_ID is a numeric ID of the job. To get a list of IDs, use the list_jobs command. This will not delete any data on the server. It will only stop the process of running the job by killing the master process. The job will not be able to be restarted once it has been stopped.
- del_job JOB_ID
- dj JOB_ID
- Delete a job on the server. JOB_ID is a numeric ID of the job. To get a list of IDs, use the list_jobs command. This will delete all the data associated with this job on the server. This cannnoot be undone!
- list_jobs
- lj
- List all the jobs on the server. This will list the job ID, the job name, and the job status (e.g. running, stopped, etc).
Job data
For each job, there is data stored on the server. The CLI can download this job data onto the local machine, and then generate various types of files from this data: log files, output files, pareto files, snapshot files.
- Log files are csv files that contain detailed information about the execution of tasks. This will allow you to trace exactly what has been happening during the processing of the job. For more information, see Log Files.
- Output files are txt files that conatin any output messages from the task (std-out and std-error). For examples, any error messages generated by the task while running on the slaves can be found in this file. For more information, see Output Files.
- Pareto file are csv files that contains performance related data for individuals in the population. For each individual, the file contains a set of performance scores and a pareto ranking. For more information, see Pareto Files.
- Snapshot files are csv files that contain a snapshot of the live population at certain time intervals. The snapshot consists of the minimum, average, and maximum scores for all performance criteria. For more information, see Snapshot Files.
The commands to create these files are as follows:
- get_job_log_file JOB_ID FILE_PATH
- gjlf JOB_ID FILE_PATH
- Download job data from the server and then create a log file. The JOB_ID is a numeric ID of the job, and the FILE_PATH is the location where to save the file.
- get_job_output_file JOB_ID FILE_PATH
- gjof JOB_ID FILE_PATH
- Download job data from the server and then create an output file. The output file contains any output (i.e. print statements and error messages) from the tasks. The JOB_ID is a numeric ID of the job, and the FILE_PATH is the location where to save the file.
- get_job_pareto_file JOB_ID FILE_PATH
- gjpf JOB_ID FILE_PATH
- Download job data from the server and then create a pareto file. The JOB_ID is a numeric ID of the job, and the FILE_PATH is the location where to save the file. Warning: The pareto ranking algorithm can be quite slow if you have a very large population.
- get_job_snapshot_file JOB_ID FILE_PATH STEP
- gjsf JOB_ID FILE_PATH STEP
- Download job data from the server and then create a snapshot file. The JOB_ID is a numeric ID of the job, and the FILE_PATH is the location where to save the file. The step parameter indicates the size of the step, and is measured in terms of the number of actions performed by the job. (For example, you might decide to take a snapshot every 100 actions.)
- archive_server_addr
- asa
- Get the IP address and port number of the archive server. You can enter the address into a browser, and then browse the files on the server. (When the entering the address in the browser, the format will be something like this: http://127.0.0.0:8000)
An example
For example, the following sequence of commands might be used:
DEXEN> start_new_job test_1 C:\Python27\Lib\site-packages\examples\sample
Job has been started.
DEXEN> list_jobs
|Job ID | Job Name | Start Time | Status |
-------------------------------------------------------
| 1 | test_1 | 11:52:55 | RUNNING |
DEXEN> get_job_log_file 1 C:\temp\log.csv
Log file has been created.
DEXEN> get_job_pareto_file 1 C:\temp\pareto.csv
Pareto file has been created.
DEXEN> stop_job 1
Job has been stopped.
The same commands in short form would look like this:
DEXEN> snj test_1 C:\Python27\Lib\site-packages\examples\sample
Job has been started.
DEXEN> lj
|Job ID | Job Name | Start Time | Status |
-------------------------------------------------------
| 1 | test_1 | 11:52:55 | RUNNING |
DEXEN> gjlf 1 C:\temp\log.csv
Log file has been created.
DEXEN> gjpf 1 C:\temp\pareto.csv
Pareto file has been created.
DEXEN> sj 1
Job has been stopped.
Note: The examples provided in the examples folder can be used to get a better understanding of how to run a job on dexen.