.. role:: gray
.. raw:: html

   <style> .gray {color:gray} </style>

.. _dbconfig:

DB Config
=========

.. _dbtables:

Tables
------

**site**

* site_id : str
* name : str
* institution : str
* queues : Text  :gray:`# json of {gridspec:{type,description,resources:{k:[total,empty]}}}`
* auth_key : str
* website_url : str
* version : str
* last_update : str  :gray:`# datetime`
* admin_name : str
* admin_email : str

**node**

* node_id : str
* hostname : str
* domain : str
* last_update : str  :gray:`# datetime`
* stats : Text  :gray:`# json of {name:value}`

**dataset**

* dataset_id : str
* name : str
* description : str
* gridspec : Text  :gray:`# json of {task:[gridspec]}`
* status : str  :gray:`# possible statuses: processing, truncated, complete, suspended, errors`
* username : str
* institution : str
* submit_host : str
* priority : int
* jobs_submitted : int
* tasks_submitted : int
* start_date : str  :gray:`# datetime`
* end_date : str  :gray:`# datetime`
* temporary_storage : Text
* global_storage : Text
* groups_id : str  :gray:`# group this dataset is assigned to`
* stat_keys : Text  :gray:`# json of [key1,key2]`
* categoryvalue_ids : Text  :gray:`# csv list of categoryvalues`
* debug : bool

**dataset_notes**

* dataset_nodes_id : str
* dataset_id : str
* username : str
* date : str  :gray:`# datetime`
* comment : MediumText

**dataset_stat**

* dataset_stat_id : str
* dataset_id : str
* stat : MediumText  :gray:`# json of {name:value}`

**job**

* job_id : str
* dataset_id : str
* status : str  :gray:`# possible statuses: processing, complete, suspended, errors`
* job_index : int  :gray:`# index of the job within the dataset`
* status_changed : str  :gray:`# datetime`

**job_stat**

* job_stat_id : str
* job_id : str
* stat : MediumText  :gray:`# json of {name:value}`

**task_rel**

* task_rel_id : str
* dataset_id : str
* task_index : int  :gray:`# index of the task within the config`
* name : str  :gray:`# name of the task`
* depends : Text  :gray:`# csv list of task_rel_ids`
* requirements : Text  :gray:`# json of {name:value}`

**task**

* task_id : str
* status : str  :gray:`# possible statuses: idle, waiting, queued, processing, complete, suspended, failed, resume, reset`
* prev_status : str
* status_changed : str  :gray:`# datetime`
* submit_dir : Text
* grid_queue_id : str
* failures : int
* evictions : int
* walltime : float  :gray:`# good walltime used by this task`
* walltime_err : float  :gray:`# bad walltime used by this task`
* walltime_err_n : int  :gray:`# number of additions to bad walltime`
* depends : Text  :gray:`# csv list of task_ids`
* requirements : Text  :gray:`# json of {name:value}. overrides task_rel requirements`
* task_rel_id : str

**task_stat**

* task_stat_id : str
* task_id : str
* stat : MediumText  :gray:`# json of {name:value}`

**task_log**

* task_log_id : str
* task_id : str
* name : str  :gray:`# logfile name`
* data : MediumText  :gray:`# logfile text`

**task_lookup**

* task_id : str
* queue : str
* insert_time : float  :gray:`# time.time() value`
* req_cpu : int
* req_gpu : int
* req_memory : float
* req_disk : float
* req_time : float
* req_os : str

**search**

* task_id : str
* job_id : str
* dataset_id : str
* gridspec : str
* name : str  :gray:`# identifies the task in job by name or number`
* task_status : str  :gray:`# a replica of task:status`

**config**

* dataset_id : str
* config_data : MediumText  :gray:`# serialized config`
* difplus_data : MediumText  :gray:`# serialized config`

**data**

* data_id : str
* task_id : str
* url : Text
* compression : str
* type : str

**resource**

* resource_id : str
* url : Text
* compression : str
* arch : str

**categorydef**

* categorydef_id : str
* name : str
* description : str

**categoryvalue**

* categoryvalue_id : str
* categorydef_id : str
* name : str
* description : Text

**history**

* history_id : str
* username : str
* cmd : Text
* timestamp : str  :gray:`# datetime`

**passkey**

* passkey_id : str
* auth_key : str
* expire : str  :gray:`# datetime`
* user_id : str

**pilot**

* pilot_id : str
* grid_queue_id : str
* submit_time : str  :gray:`# datetime`
* submit_dir : Text
* tasks : Text  :gray:`# csv list of processing task_ids`
* requirements : Text  :gray:`# json of {name:value}`
* avail_cpu : int
* avail_gpu : int
* avail_memory : float
* avail_disk : float
* avail_time : float
* claim_cpu : int
* claim_gpu : int
* claim_memory : float
* claim_disk : float
* claim_time : float

**user**

* user_id : str
* username : str
* name : str
* salt : str
* hash : str
* email : str
* admin : bool
* roles : Text  :gray:`# csv list of role_ids`
* last_login_time : str  :gray:`# datetime`

**groups**

* groups_id : str
* name : str
* description : Text
* priority : float  :gray:`# value between 0 and 1`

**roles**

* roles_id : str
* role_name : str
* groups_prefix : str

**session**

* session_id : str
* session_key : str
* pass_key : str
* last_time : str  :gray:`# datetime`

**webstat**

* webstat_id : str
* name : str
* value : MediumText  :gray:`# json data`
* last_update_time : str  :gray:`# datetime`

**webnote**

* webnote_id : str
* page : str
* username : str
* timestamp : str  :gray:`# datetime`
* note : Text

**graph**

* graph_id : str
* name : str
* value : Text  :gray:`# json data`
* timestamp : str  :gray:`# datetime`

**master_update_history**

* master_update_history_id : str
* table_name : str
* update_index : str
* timestamp : str

**setting**

* setting_id : str
* node_offset : str  :gray:`# these tables have the site+offset id type`
* dataset_offset : str
* dataset_notes_offset : str
* dataset_stat_offset : str
* job_offset : str
* job_stat_offset : str
* task_rel_offset : str
* task_offset : str
* task_stat_offset : str
* task_log_offset : str
* data_offset : str
* resource_offset : str
* categorydef_offset : str
* categoryvalue_offset : str
* history_offset : str
* passkey_last : str
* pilot_last : str
* user_offset : str
* groups_offset : str
* roles_offset : str
* session_last : str
* webstat_last : str
* webnote_last : str
* graph_last : str
* master_update_history_last : str

Archive Tables
--------------
* site
* node
* dataset
* dataset_notes
* dataset_stat
* job
* job_stat
* task
* task_stat
* task_log
* config
* resource
* data

Key
---
* str : A short string up to 256 characters
* Text : A string up to 2^16 characters
* MediumText : A string up to 2^24 characters
* bool : A boolean (true/false)
* int : An integer
* float : A floating point number

