JURA Accounting Technical Details¶
General accounting configuration and operations flows are described in Accounting with JURA. This section contains more technical details about implementation of each component of accounting subsystem.
Records processing and publishing¶
AREX Accounting Records (AAR job log files)¶
The A-REX Accounting Records (AAR) are job log files generated by A-REX.
AAR is the only source of accounting information for JURA.
AARs are written by A-REX based on job data available, including
.diag files that backend scripts creates based on batch system data and/or GNU
time utility measurements.
These job log files reside under the
The name of the AAR job log files consist of the ID of the job and a random string
to avoid collision of multiple job log files for the same job:
The AAR job log file consists of
name=value lines, where
value is either a
job-related resource consumption data or a static info like name, ID or proxy certificate.
A-REX generates at least two job log files for each job: one at the time of job submission, another one
after the job finishes, and possibly others at various job events.
Please note JURA makes use only one of the AREX generated files belonging to the same job:
the one that corresponds to the FINISHED job event (such state is indicated by the
JURA initial AAR processing¶
A-REX periodically runs
jura that loop over available A-REX job log records in the
JURA opens all the files and processes only those that corresponds to a FINISHED job state.
JURA converts AARs to per-job per-destnation extended AARs that contains the target information
arc.conf as well. One extended AAR is generated per accounting target.
The extended AAR job log files named
<jobid>.<random>_<random2> where first
<random> is taken from
The original AAR
<jobid>.<random> file is deleted once per-destination extended AAR logs are created by JURA.
JURA as part of the initial processing deletes all files corresponding to non-finished job states.
JURA Publihsing loop¶
JURA publishing subsystem loop over extended AAR logs in the A-REX
JURA generates records in the Usage Record (UR) format proposed by the Open Grid Forum (OGF) for SGAS or
Compute Accounting Record (CAR) XML for APEL.
The extended AAR job log file is deleted once record is successfully submitted, thus preventing multiple insertion of same usage records. If submission to destination fails, the extended AAR log files are kept, so another attempt is made upon a subsequent run of JURA. This mechanism will be repeated until the expiration time passes at which point the next execution of JURA removes the file without processing.
Please note that the JURA publishing loop is backward compatible with ARC 5 implementation.
Reporting to SGAS¶
SGAS has a simple custom web service interface loosely based on WS-ResourceProperties. JURA uses the insertion method of this interface to report URs directly using ARC HTTP client implementation. The corresponding processed extended AAR job log files are deleted after receiving a non-fault response from the service.
To increase communication efficiency JURA sends URs in batches. SGAS accepts a
batch of URs in a single request. The batch is an XML element called
UsageRecords, containing elements representing URs.
The process of handling batches is the following: JURA does not send all usage records immediately after generation, but instead collects them in a batch until reaching the maximal number of records or until running out of job log files. The maximal number of URs in a batch can be set as a urbatchsize configuration parameter of SGAS target.
Reporting to APEL¶
APEL uses the SSM framework for communication.
JURA send records to APEL by means of invoking helper
ssmsend process that uses SSM python librarires developed by APEL.
ARC ships minimal set of SSM libraries along with A-REX binary packages to allow SSM usage. If SSM binary packages from APEL are availble for your OS (e.g. EL6), you can install this packages and they will be used instead of those shipped with ARC automatically.
JURA prepares the messages to be sent by
ssmsend and puts them info SSM Outgoing directory
located in the
Generated messages are XML based CAR records with file name format
Reporting to APEL also works with sending records in batches. The default urbatchsize value is set to 1000 according to APEL recommendatations.
TODO: Describe republishing workflow in bit more details
The JURA executable runs with the same user privileges as the A-REX. The owner of a job log file is the local user mapped for the submitter entity of the corresponding job. Since these files contain confidential data, A-REX restricts access to them allowing only read access for the job owner, thus when JURA is executed by A-REX it is allowed to read and delete job log files.
All usage records are submitted using the X.509 credentials specified by
the value of
x509_ set of confiurartion options of
No proxies are used for communcation with accouting services.
The only access restriction made by a SGAS service is matching the Distinguished Name of the client (in this context JURA) with a set of trusted DNs. When access is granted, policies are then applied by SGAS, allowing either publishing and/or querying rights. Clients with publishing right can insert any UR, regardless of content. By default, querying right only allows retrieving URs pertaining to jobs submitted by the querying entity.
Implementation and API¶
JURA as part of the ARC software stack is written in C++, and utilizes the functionality provided by the ARC libraries, including secure HTTPS communication provided by the ARC plugable TLS and HTTP modules.
The modular design is also present in the usage reporting part of the
JURA code, making it possible to extend JURAs support of accounting
services. To create a JURA module one should simply write a C++ class
which inherits from the abstract
Arc::Destination class, and it must
extend the two methods:
static Arc::Destination* Arc::Destination::createDestination(Arc::JobLogFile&)
createDestination method should initialize a object of
the specialized class, using the configuration options specified in the
Arc::LogFile object, and the memory allocated by the method
should be freed by the caller. Then the
report method should carry
out the transfer of the UR, represented by the
JobLogfile object, to
the accounting service.
JURA archive manager is written in Python and share the classes for managing ARC components with ARC Control Tool.
In the following list some issues which limits the functionality of JURA is described:
- The current implementation of JURA and A-REX supports only one expiration time for all the reporting destinations. Even though the configuration enables the specification of different expiration values per reporting destination, it is not taken into account by the system, the last value is used as the common expiration time value.
- It is not possible to use different credentials per destinations.
- If you are updating from ARC5 with an old jura accounting archive already containing records, the conversion process to index the archive structure will be initiated and will cause serious system load until finished. To avoid old archive conversion, you can move records before update.
- Some optional UR properties are not supported.
- Memory can be reported incorrectly with buggy GNU “time” results.
Definition of the A-REX Accounting Record including JURA attribute mappings to SGAS and APEL¶
|A-REX Accounting Record (AAR)||SGAS OGF-UR||APEL CAR||Content description|
||The global unique jobid assigned by AREX.|
||The global unique jobid assigned by AREX. For gridftp inteface it contains full URL.|
||LRMS job ID|
||User specified job name|
||The A-REX job submission endpoint URL used for this job|
||The LRMS behind A-REX|
||The name of the LRMS queue of the job|
||WN name(s) as given by LRMS separated by :|
||not used||Client connection socket from the client to A-REX|
||The global user identity, at the moment it is the SN from the certificate|
||The mapped local userid|
||contains the full proxy cert chain|
||User-defined name of the project the job belongs to|
||The terminal state of an A-REX job: aborted, failed, completed|
||The exit code of the payload in the LRMS|
||The timestamp of job acceptance at A-REX|
||The timestamp when the job reached the terminal state in A-REX|
||Number of allocated worker nodes|
||not used||Details of downloaded inputfile: url, size, transfer start, transfer end, downloaded from cache|
||not used||Details of uploaded outputtfile: url, size, transfer start, transfer end|
||Maximum virtual memory used by the job|
||Maximum resident memory used by the job|
||To be dropped from the AAR schema|
||The measured clocktime ellapsed during the execution of the job in the LRMS. No matter on how many cores, processors, nodes the user job ran on.|
||The total CPU time consumed by the job. If the job ran on many cores/processors/nodes, all separate consumptions shall be aggregated in this value.|
||The user part of the usedcputime|
||The kernel part of the usedcputime|
|A-REX Accounting Record (AAR)||SGAS OGF-UR||APEL CAR||Content description|
||The number of cores allocated to the job|
|systemsoftware||The type and version of the system software (i.e. opsys, glibc, compiler, or the entire container wrapping the system software)|
||Coarse-grain characterization tag for the WorkerNode, e.g. BigMemory or t2.micro (aka Amazon instance type)|
|RTEs||List of used RTEs, including default ones as well.|
||The total volume of downloaded job input data in GBs|
|data-stagein-time||The time spent by the DTR sysem to download input data for the job|
||The total volume of uploaded job output data in GBs|
|data-stageout-time||The time spent by the DTR sysem to upload output data of the job|
|lrms-submissiont-time||The timestamp when the job was handed over to the LRMS system|
|lrmstarttime||The timestamp when the payload starts in the LRMS|
|lrmsendtime||The timestamp when the payload completed in the LRMS|
||to be implemented to store e.g. VO atributes and simillar capabilities|
|submissioninterface||to be implemented, at the same time clean up globalid that depends on submissioninterface type|
||The type and the corresponding benchmark value of the assigned WN|
||The used size of scratch dir at the end of the job termination in the LRMS.|
|SGAS OGF-UR||APEL CAR|