Deploy the Web Service
The SafeRupi web service may be deployed using one of Axis2's many deployment mechanisms. The web service to deploy is the saferupi.aar archive provided.
Setting up Required Database Tables
SafeRupi requires two database tables to be present: the Properties table, and a usage record table for storing OGF usage records.
The Properties Table
This is a standard Grid-SAFE table. If another Grid-SAFE module is deployed, SafeRupi may share the Properties table with it. The Properties table holds configuration properties that define how the service operates. Its schema should look like this:
CREATE TABLE `Properties` ( `PropertyID` int(11) auto_increment NOT NULL, `Name` varchar(255) NOT NULL, `Value` varchar(255) NOT NULL, PRIMARY KEY (`PropertyID`), UNIQUE KEY `Name` (`Name`) );
The Usage Record Table
This is the table that will be used to store OGF usage records when they are uploaded. Below is a schema that will store the values of any OGF usage record uploaded to the service without any modifications made to SafeRupi's usage record parser.
CREATE TABLE `OGFURecord` ( `OGFURecordId` int(11) NOT NULL auto_increment, `Charge` double default NULL, `ConsumableResource` float default NULL, `CpuDuration` bigint(20) default NULL, `Disk` int(11) default NULL, `EndTime` bigint(20) default NULL, `GlobalJobId` varchar(32) default NULL, `GlobalUsername` varchar(32) default NULL, `Host` varchar(64) default NULL, `JobName` varchar(64) default NULL, `LocalJobId` varchar(64) default NULL, `LocalUserId` varchar(32) default NULL, `MachineName` varchar(32) default NULL, `Memory` int(11) default NULL, `Network` int(11) default NULL, `Nodecount` int(11) default NULL, `PhaseResource` float default NULL, `ProcessId` varchar(32) default NULL, `Processors` int(11) default NULL, `ProjectName` varchar(32) default NULL, `Queue` varchar(32) default NULL, `RecordIdentity` varchar(256) default NULL, `createTime` bigint(20) default NULL, `recordId` varchar(64) default NULL, `Resource` varchar(64) default NULL, `ServiceLevel` varchar(20) default NULL, `StartTime` bigint(20) default NULL, `Status` varchar(20) default NULL, `SubmitHost` varchar(32) default NULL, `Swap` int(11) default NULL, `TimeDuration` bigint(20) default NULL, `TimeInstant` bigint(20) default NULL, `VolumeResource` float default NULL, `WallDuration` bigint(20) default NULL, `Text` varchar(512) default NULL, PRIMARY KEY (`OGFURecordId`), KEY `duplicate_key` (`recordId`), KEY `end_time_key` (`EndTime`), KEY `start_time_key` (`StartTime`) );
The only column required by SafeRupi is OGFURecordId. The column fulfills Grid-SAFE's requirement that each table have a unique primary integer key. The Text column at the end will hold the entire text of the un-parsed usage record. All other columns will hold the values found in the usage record (if they are present). This table may have any name, the default name being OGFURecord. If this name is used, no further configuration is required. If another name is used, the appropriate configuration property must be set, specifying the name of the table to use.
Uploading OGF Usage Records
Any client tool that can transmit messages that adhere to the restrictions applied in the RUPI specification can be used to upload usage records to the service once it has been deployed and started in Axis2.