{
char *src = NULL,*job = NULL,*server = NULL,*seq,*jdl = NULL, *seed = NULL;
int lbproxy = 0;
- int done = 0,num_subjobs = 0,reg_subjobs = 0,i, collection = 0, pbs=0, cream=0, type, flags=0;
+ int done = 0,num_subjobs = 0,reg_subjobs = 0,i, collection = 0, pbs=0, cream=0, vm = 0, type, flags=0;
edg_wll_Context ctx;
edg_wlc_JobId jobid,*subjobs;
opterr = 0;
do {
- switch (getopt(argc,argv,"xX:s:j:m:n:SCl:e:PcE")) {
+ switch (getopt(argc,argv,"xX:s:j:m:n:SCl:e:PcvE")) {
case 'x': lbproxy = 1; break;
case 'X': lbproxy = 1;
edg_wll_SetParam(ctx, EDG_WLL_PARAM_LBPROXY_STORE_SOCK, optarg);
case 'C': collection = 1; break;
case 'P': pbs = 1; break;
case 'c': cream = 1; break;
+ case 'v': vm = 1; break;
case 'l': jdl = (char *) strdup(optarg); break;
case 'e': seed = strdup(optarg); break;
case 'E': flags = flags | EDG_WLL_LOGLFLAG_EXCL; break;
type = pbs ? EDG_WLL_REGJOB_PBS
: (cream ? EDG_WLL_REGJOB_CREAM
- : (num_subjobs ?
- (collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG)
- :EDG_WLL_REGJOB_SIMPLE
- )
+ : (vm ? EDG_WLL_REGJOB_VIRTUAL_MACHINE
+ : (num_subjobs ?
+ (collection?EDG_WLL_REGJOB_COLLECTION:EDG_WLL_REGJOB_DAG)
+ :EDG_WLL_REGJOB_SIMPLE
+ )
+ )
);
if (lbproxy) {
{
switch (event) {
@@@{
- %seq = ( CREAM => 'CREAM', 'PBS' => 'PBS', 'gLite' => 'NORMAL', Condor=>'CONDOR', Transfer=>'NORMAL' );
+ %seq = ( CREAM => 'CREAM', 'PBS' => 'PBS', 'gLite' => 'NORMAL', Condor=>'CONDOR', Transfer=>'NORMAL', 'VirtualMachine'=>'NORMAL' );
for my $t (sort { $event->{order}->{$a} <=> $event->{order}->{$b} }
$event->getTypes)
{
int processData_Cream(intJobStat *js, edg_wll_Event *e);
int processEvent_FileTransfer(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring);
int processEvent_FileTransferCollection(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring);
+int processEvent_VirtualMachine(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring);
int add_stringlist(char ***lptr, const char *new_item);
case EDG_WLL_REGJOB_FILE_TRANSFER_COLLECTION:
js->pub.jobtype = EDG_WLL_STAT_FILE_TRANSFER_COLLECTION;
break;
+ case EDG_WLL_REGJOB_VIRTUAL_MACHINE:
+ js->pub.jobtype = EDG_WLL_STAT_VIRTUAL_MACHINE;
+ break;
default:
trio_asprintf(errstring,"unknown job type %d in registration",e->regJob.jobtype);
return RET_FAIL;
return processEvent_FileTransfer(js,e,ev_seq,strict,errstring);
case EDG_WLL_STAT_FILE_TRANSFER_COLLECTION:
return processEvent_FileTransferCollection(js,e,ev_seq,strict,errstring);
+ case EDG_WLL_STAT_VIRTUAL_MACHINE:
+ return processEvent_VirtualMachine(js,e,ev_seq,strict,errstring);
case -1: return RET_UNREG;
default:
trio_asprintf(errstring,"undefined job type %d",js->pub.jobtype);
--- /dev/null
+#ident "$Header:"
+/*
+Copyright (c) Members of the EGEE Collaboration. 2004-2010.
+See http://www.eu-egee.org/partners for details on the copyright holders.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <assert.h>
+#include <syslog.h>
+
+#include "glite/lb/context-int.h"
+
+#include "glite/lbu/trio.h"
+
+#include "intjobstat.h"
+#include "seqcode_aux.h"
+
+/* TBD: share in whole logging or workload */
+#ifdef __GNUC__
+#define UNUSED_VAR __attribute__((unused))
+#else
+#define UNUSED_VAR
+#endif
+
+/*static int compare_timestamps(struct timeval a, struct timeval b)
+{
+ if ( (a.tv_sec > b.tv_sec) ||
+ ((a.tv_sec == b.tv_sec) && (a.tv_usec > b.tv_usec)) ) return 1;
+ if ( (a.tv_sec < b.tv_sec) ||
+ ((a.tv_sec == b.tv_sec) && (a.tv_usec < b.tv_usec)) ) return -1;
+ return 0;
+}*/
+
+
+// XXX move this defines into some common place to be reusable
+#define USABLE(res) ((res) == RET_OK)
+#define USABLE_DATA(res) (1)
+#define rep(a,b) { free(a); a = (b == NULL) ? NULL : strdup(b); }
+#define rep_cond(a,b) { if (b) { free(a); a = strdup(b); } }
+
+
+int processEvent_VirtualMachine(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, char **errstring)
+{
+ edg_wll_JobStatCode old_state = js->pub.state;
+ int res = RET_OK;
+
+
+ switch (e->any.type) {
+ case EDG_WLL_EVENT_REGJOB:
+ if (USABLE(res)) {
+ js->pub.state = EDG_WLL_JOB_SUBMITTED;
+ }
+ /*if (USABLE_DATA(res)) {
+ edg_wlc_JobIdFree(js->pub.parent_job);
+ edg_wlc_JobIdDup(e->regJob.parent, &js->pub.parent_job);
+ }*/
+ break;
+ default:
+ break;
+ }
+
+ if (USABLE(res)) {
+ rep(js->last_seqcode, e->any.seqcode);
+
+ js->pub.lastUpdateTime = e->any.timestamp;
+ if (old_state != js->pub.state) {
+ js->pub.stateEnterTime = js->pub.lastUpdateTime;
+ js->pub.stateEnterTimes[1 + js->pub.state]
+ = (int)js->pub.lastUpdateTime.tv_sec;
+ }
+ }
+ if (! js->pub.location) js->pub.location = strdup("this is FILE TRANSFER");
+
+
+ return RET_OK;
+}
+
jobid parent Grid job id of the parent job registering this new one.
_optional_
- int jobtype Type of the job being registered (SIMPLE, DAG, PARTITIONABLE or PARTITIONED).
+ int jobtype Type of the job being registered (SIMPLE, DAG, PARTITIONABLE etc.).
_code_ SIMPLE The job is simple job.
_code_ DAG The job is dag (containing static set of subjobs).
_code_ PARTITIONABLE The job is partitionable (may become partitioned).
_code_ CREAM CREAM job
_code_ FILE_TRANSFER_COLLECTION File transfer collection
_code_ FILE_TRANSFER File transfer
+ _code_ VIRTUAL_MACHINE Virtual machine
int nsubjobs Number of subjobs this job plans to spawn.
_optional_
string compute_job Jobid of (compute) job the sandbox belongs. Exclusive with transfer_job.
_optional_
+
+@flesh VirtualMachine
+
+@type VMCreate create (register) virtual machine
+ string name machine name
+
+@type VMRunning machine running
_code_ CREAM CREAM job
_code_ FILE_TRANSFER_COLLECTION job containing all file transfers (i.e. sandbox)
_code_ FILE_TRANSFER subjob holding one file transfer
+ _code_ VIRTUAL_MACHINE job representing virtual machine
jobid parent_job parent job of subjob
string seed string used for generation of subjob IDs