work_queue_process.h

00001 #ifndef WORK_QUEUE_PROCESS_H
00002 #define WORK_QUEUE_PROCESS_H
00003 
00004 #include "work_queue.h"
00005 #include "timestamp.h"
00006 #include "path_disk_size_info.h"
00007 
00008 #include <unistd.h>
00009 #include <sys/types.h>
00010 #include <sys/resource.h>
00011 
00012 #define NONE 0
00013 #define DOCKER 1
00014 #define DOCKER_PRESERVE 2
00015 #define UMBRELLA 3
00016 
00017 #define MAX_BUFFER_SIZE 4096
00018 
00019 /*
00020 work_queue_process is a running instance of a work_queue_task.
00021 This object is private to the work_queue_worker.
00022 */
00023 
00024 struct work_queue_process {
00025         pid_t pid;
00026         int task_status;                // Any of WORK_QUEUE_RESULT_*
00027         int exit_status;                // Exit code, or signal number to task process.
00028 
00029         struct rusage rusage;
00030         timestamp_t execution_start;
00031         timestamp_t execution_end;
00032 
00033         char *sandbox;
00034 
00035         char *output_file_name;
00036         int output_fd;
00037 
00038         struct work_queue_task *task;
00039 
00040         /* disk size and number of files found in the process sandbox. */
00041         int64_t sandbox_size;
00042         int64_t sandbox_file_count;
00043 
00044         /* state between complete disk measurements. */
00045         struct path_disk_size_info *disk_measurement_state;
00046 
00047         char container_id[MAX_BUFFER_SIZE];
00048 };
00049 
00050 struct work_queue_process * work_queue_process_create( int taskid );
00051 pid_t work_queue_process_execute( struct work_queue_process *p, int container_mode, ... );
00052 // lunching process with container, arg_3 can be either img_name or container_name, depending on container_mode
00053 void  work_queue_process_kill( struct work_queue_process *p );
00054 void  work_queue_process_delete( struct work_queue_process *p);
00055 
00056 int work_queue_process_measure_disk(struct work_queue_process *p, int max_time_on_measurement);
00057 
00058 #endif

Generated on 7 Oct 2015 for cctools by  doxygen 1.6.1