def test(): from pandaharvester.harvestercore.work_spec import WorkSpec wspec = WorkSpec() jobid = "gsiftp://pcoslo5.cern.ch:2811/jobs/XkNNDmultdtn1ZPzno6AuCjpABFKDmABFKDmwqyLDmABFKDm8dOcOn" wspec.batchID = jobid workAttributes = {"arcjob": {}} workAttributes["arcjob"]["JobID"] = wspec.batchID workAttributes["arcjob"][ "JobStatusURL"] = "ldap://{0}:2135/mds-vo-name=local,o=grid??sub?(nordugrid-job-globalid={1})".format( urlparse(jobid).netloc, jobid) workAttributes["arcjob"]["JobStatusInterfaceName"] = "org.nordugrid.ldapng" jobmanagementurl = arc.URL(wspec.batchID) jobmanagementurl.ChangePath("/jobs") workAttributes["arcjob"]["JobManagementURL"] = jobmanagementurl.str() workAttributes["arcjob"][ "JobManagementInterfaceName"] = "org.nordugrid.gridftpjob" workAttributes["proxyrole"] = 'production' wspec.workAttributes = workAttributes wspec.accessPoint = '/tmp' wspec.mapType = WorkSpec.MT_OneToOne wspec.pandaid_list = [1234] print wspec.workAttributes messenger = ARCMessenger() print messenger.events_requested(wspec) print messenger.feed_events(wspec, {'event': 1234}) print messenger.events_to_update(wspec) messenger.acknowledge_events_files(wspec)
def test(): from pandaharvester.harvestercore.work_spec import WorkSpec wspec = WorkSpec() jobid = "gsiftp://pcoslo5.cern.ch:2811/jobs/XkNNDmultdtn1ZPzno6AuCjpABFKDmABFKDmwqyLDmABFKDm8dOcOn" wspec.batchID = jobid workAttributes = {"arcjob": {}} workAttributes["arcjob"]["JobID"] = wspec.batchID workAttributes["arcjob"]["JobStatusURL"] = "ldap://{0}:2135/mds-vo-name=local,o=grid??sub?(nordugrid-job-globalid={1})".format(urlparse(jobid).netloc, jobid) workAttributes["arcjob"]["JobStatusInterfaceName"] = "org.nordugrid.ldapng" jobmanagementurl = arc.URL(wspec.batchID) jobmanagementurl.ChangePath("/jobs") workAttributes["arcjob"]["JobManagementURL"] = jobmanagementurl.str() workAttributes["arcjob"]["JobManagementInterfaceName"] = "org.nordugrid.gridftpjob" workAttributes["proxyrole"] = 'production' wspec.workAttributes = workAttributes wspec.accessPoint = '/tmp' wspec.mapType = WorkSpec.MT_OneToOne wspec.pandaid_list = [1234] print wspec.workAttributes messenger = ARCMessenger() print messenger.events_requested(wspec) print messenger.feed_events(wspec, {'event': 1234}) print messenger.events_to_update(wspec) messenger.acknowledge_events_files(wspec)
def test(jobid): '''Kill a job''' from pandaharvester.harvestercore.work_spec import WorkSpec import json wspec = WorkSpec() wspec.batchID = jobid workAttributes = {"arcjob": {}} workAttributes["arcjob"]["JobID"] = wspec.batchID workAttributes["arcjob"]["JobStatusURL"] = "ldap://{0}:2135/mds-vo-name=local,o=grid??sub?(nordugrid-job-globalid={1})".format(urlparse.urlparse(jobid).netloc, wspec.batchID) workAttributes["arcjob"]["JobStatusInterfaceName"] = "org.nordugrid.ldapng" jobmanagementurl = arc.URL(wspec.batchID) jobmanagementurl.ChangePath("/jobs") workAttributes["arcjob"]["JobManagementURL"] = jobmanagementurl.str() workAttributes["arcjob"]["JobManagementInterfaceName"] = "org.nordugrid.gridftpjob" wspec.workAttributes = workAttributes print wspec.workAttributes sweeper = ARCSweeper() print sweeper.kill_worker(wspec)
def test(jobid): '''Test checking status''' from pandaharvester.harvestercore.work_spec import WorkSpec wspec = WorkSpec() wspec.batchID = jobid #"gsiftp://pikolit.ijs.si:2811/jobs/HtgKDmtCe7qn4J8tmqCBXHLnABFKDmABFKDmBcGKDmABFKDm4NCTCn" workAttributes = {"arcjob": {}} workAttributes["arcjob"]["JobID"] = wspec.batchID workAttributes["arcjob"][ "JobStatusURL"] = "ldap://{0}:2135/mds-vo-name=local,o=grid??sub?(nordugrid-job-globalid={1})".format( urlparse.urlparse(jobid).netloc, jobid) workAttributes["arcjob"]["JobStatusInterfaceName"] = "org.nordugrid.ldapng" jobmanagementurl = arc.URL(wspec.batchID) jobmanagementurl.ChangePath("/jobs") workAttributes["arcjob"]["JobManagementURL"] = jobmanagementurl.str() workAttributes["arcjob"][ "JobManagementInterfaceName"] = "org.nordugrid.gridftpjob" wspec.workAttributes = workAttributes print wspec.workAttributes monitor = ARCMonitor() print monitor.check_workers([wspec])
def test(jobid): '''Kill a job''' from pandaharvester.harvestercore.work_spec import WorkSpec import json wspec = WorkSpec() wspec.batchID = jobid workAttributes = {"arcjob": {}} workAttributes["arcjob"]["JobID"] = wspec.batchID workAttributes["arcjob"][ "JobStatusURL"] = "ldap://{0}:2135/mds-vo-name=local,o=grid??sub?(nordugrid-job-globalid={1})".format( urlparse.urlparse(jobid).netloc, wspec.batchID) workAttributes["arcjob"]["JobStatusInterfaceName"] = "org.nordugrid.ldapng" jobmanagementurl = arc.URL(wspec.batchID) jobmanagementurl.ChangePath("/jobs") workAttributes["arcjob"]["JobManagementURL"] = jobmanagementurl.str() workAttributes["arcjob"][ "JobManagementInterfaceName"] = "org.nordugrid.gridftpjob" wspec.workAttributes = workAttributes print wspec.workAttributes sweeper = ARCSweeper() print sweeper.kill_worker(wspec)
tmp_log.error('Excepted with: {0}'.format(traceback.format_exc())) if __name__ == "__main__": """ Quick tests """ from pandaharvester.harvestercore.queue_config_mapper import QueueConfigMapper queue_config_mapper = QueueConfigMapper() apfmon = Apfmon(queue_config_mapper) apfmon.create_factory() apfmon.create_labels() worker_a = WorkSpec() worker_a.batchID = 1 worker_a.computingSite = 'CERN-PROD-DEV_UCORE' worker_a.computingElement = 'bla1' worker_a.workAttributes = { "batchLog": "https://aipanda024.cern.ch/condor_logs/18-07-19_09/grid.9659.0.log", "stdErr": "https://aipanda024.cern.ch/condor_logs/18-07-19_09/grid.9659.0.err", "stdOut": "https://aipanda024.cern.ch/condor_logs/18-07-19_09/grid.9659.0.out" } worker_a.pandaid_list = [1234, 5678] worker_b = WorkSpec() worker_b.batchID = 2 worker_b.computingSite = 'CERN-PROD-DEV_UCORE'