JSONRPC Calls

Functions to communicate with the server using JSONRPC

iceprod.core.exe_json.send_through_pilot(func)[source]

Decorator to route communication through the pilot

class iceprod.core.exe_json.ServerComms(url, passkey, config, **kwargs)[source]

Setup JSONRPC communications with the IceProd server.

Parameters:
  • url (str) – address to connect to
  • passkey (str) – passkey for authorization/authentication
  • config (iceprod.server.exe.Config) – Config object
  • **kwargs – passed to JSONRPC
download_task(gridspec, resources={})[source]

Download new task(s) from the server.

Parameters:
  • gridspec (str) – gridspec the pilot was submitted from
  • resources (dict) – resources available in the pilot
Returns:

list of task configs

Return type:

list

processing(task_id)[source]

Tell the server that we are processing this task.

Only used for single task config, not for pilots.

Parameters:task_id (str) – task_id to mark as processing
finish_task(*args, **kwargs)[source]

Finish a task.

still_running(*args, **kwargs)[source]

Check if the task should still be running according to the DB

task_error(*args, **kwargs)[source]

Tell the server about the error experienced

Parameters:
  • stats (dict) – task statistics
  • start_time (float) – task start time in unix seconds
  • reason (str) – one-line summary of error
  • resources (dict) – task resource usage
task_kill(task_id, resources=None, reason=None, message=None)[source]

Tell the server that we killed a task

Parameters:
  • task_id (str) – the task_id
  • resources (dict) – used resources
  • reason (str) – short summary for kill
  • message (str) – long message to replace log upload
uploadLog()[source]

Upload log file

uploadErr()[source]

Upload stderr file

uploadOut()[source]

Upload stdout file

update_pilot(pilot_id, **kwargs)[source]

Update the pilot table

Parameters:
  • pilot_id (str) – pilot id
  • **kwargs – passed through to rpc function