Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make process scheduling parameters be passed to PD via haagent

  • Loading branch information...
commit 853e91a16a8f5f4e926877d52014b9cc4f9fd789 1 parent 9d4f064
Patrick Armstrong oldpatricka authored
Showing with 26 additions and 1 deletion.
  1. +26 −1 ion/agents/cei/high_availability_agent.py
27 ion/agents/cei/high_availability_agent.py
View
@@ -3,8 +3,10 @@
from pyon.agent.simple_agent import SimpleResourceAgent
from pyon.event.event import EventPublisher
from pyon.public import log, get_sys_name
+from pyon.core.exception import BadRequest
-from interface.objects import AgentCommand, ProcessDefinition, ProcessSchedule, ProcessStateEnum
+from interface.objects import AgentCommand, ProcessDefinition, ProcessSchedule,\
+ ProcessStateEnum, ProcessQueueingMode, ProcessTarget, ProcessRestartMode
from interface.services.cei.iprocess_dispatcher_service import ProcessDispatcherServiceClient
from ion.agents.cei.util import looping_call
from ion.services.cei.process_dispatcher_service import _core_process_definition_from_ion, \
@@ -237,6 +239,29 @@ def schedule_process(self, upid, definition_id, configuration=None,
pid = self.real_client.create_process(definition_id)
process_schedule = ProcessSchedule()
+ if queueing_mode is not None:
+ try:
+ process_schedule.queueing_mode = ProcessQueueingMode._value_map[queueing_mode]
+ except KeyError:
+ msg = "%s is not a known ProcessQueueingMode" % (queueing_mode)
+ raise BadRequest(msg)
+
+ if restart_mode is not None:
+ try:
+ process_schedule.restart_mode = ProcessRestartMode._value_map[restart_mode]
+ except KeyError:
+ msg = "%s is not a known ProcessRestartMode" % (restart_mode)
+ raise BadRequest(msg)
+
+ target = ProcessTarget()
+ if execution_engine_id is not None:
+ target.execution_engine_id = execution_engine_id
+ if node_exclusive is not None:
+ target.node_exclusive = node_exclusive
+ if constraints is not None:
+ target.constraints = constraints
+
+ process_schedule.target = target
sched_pid = self.real_client.schedule_process(definition_id,
process_schedule, configuration=configuration, process_id=upid)
Please sign in to comment.
Something went wrong with that request. Please try again.