rendertracker module

This program provides an RPC interface to track the status of different renders. Different concurrent renders are divided into projects that each have one or more frames. A project is identified by a unique name (e.g. the path to the hip file on the shared file server). Re-rendering a project clears all previous knowledge about it.

This render tracker program runs on the same machine as the HQueue server. The scripts invoked by the HQueue Render ROPs communicate with this tracker to log the status of frames as they render. The local render monitor also retrieves information from this tracker to display the state of the render.

class rendertracker.Frame(project, number, job_id)

Bases: object

A frame in a render project.

A Frame represents the current state and log of notable events for one frame in a render.

setDownloadFraction(fraction)

Record how complete the download is.

The fraction is a float from 0.0 to 1.0.

setErrorMessage(error_message)

Mark this frame as having generated an error.

setRenderFraction(fraction)

Record how complete the render is.

The fraction is a float from 0.0 to 1.0.

setStatus(status)

Change the status, logging an appropriate event.

class rendertracker.Project(rpc_service, name, frame_numbers, generate_ifds, job_id)

Bases: object

A render project.

A Project contains one or more frames and is identified by a unique name.

getChangedFrames(since_event_id)
incrementAndGetLastEventId()
isDone()
class rendertracker.RPCService

Bases: object

doesProjectGenerateIFDs(project_name)

Return True if the project generates IFDs before rendering.

Return False if the given project name is not registered with the render tracker.

endedGeneratingFrameIFD(project_name, frame_number)

Record that an IFD is finished being generated for a frame.

getAllFramesInfo(project_name)

Return a list of 3-tuples containing the frame number, status, and fraction complete.

Note that we use a more compact representation for the frame states by returning the index of the enumeration value. You can index into the enumeration to get the enumerated value back.

getAllProjects()

Return a sorted list of all project names.

Note that some of these projects may have completed.

getChangedFrames(project_name, since_event_id)

Return information about the frames that have changed since a particular event id.

Return a dictionary containing the changes and a new event id to pass in to the next call to this function.

The caller can pass in 0 for ‘since_event_id’ to get all the frames.

getEstimatedRenderSecondsLeft(project_name)
getFrameJobID(project_name, frame_number)

Return the HQueue job id for a frame.

Note that we update this job id as frame-specific jobs are started.

getFrameLog(project_name, frame_number)

Return the message log for a particular frame.

getImagePath(project_name, frame_number)

Return the path to the output image, or None if it is not set.

incrementAndGetLastEventId()
isProjectDone(project_name)

Return whether all frames in the project are done. The name must be for a project that exists.

isProjectRunning(project_name)

Return whether the project name is valid and it is still running.

isRunning()

Return whether or not the RPC server is running.

The caller can check if this server is running by creating an RPC connection to it, calling a function, and catching a socket.error exception. This is the recommended function to call.

Note that the dummy connection returned from hqlib.getRenderTrackerRPC implements this function and returns False, so you can use this function to differentiate between a real render tracker and a dummy one.

removeProject(project_name)
setFrameDownloadFraction(project_name, frame_number, fraction)

Set the fraction completed for a frame being downloaded.

setFrameError(project_name, frame_number, error_message)

Set an error message for a frame.

setFrameRenderFraction(project_name, frame_number, fraction)

Set the fraction completed for a frame being rendered.

setProjectError(project_name, error_message)

Set an error message for all frames in the project.

startedFrameRender(project_name, frame_number, job_id, image_path)

Record a frame is starting to be rendered.

job_id – for the HQueue job rendering the frame image_path – the full path on the server to the output image

startedGeneratingFrameIFD(project_name, frame_number)

Record that an IFD is being generated for a frame.

startedRenderProject(project_name, frame_numbers, generate_ifds, job_id)

Record that a project to render frames has started.

It is up to the caller to make sure any previous project with this name has completed. We blow away the old project and create a new one.

job_id – either for the job generating ifds or for the job that will
submit the jobs to render directly from the hip files
suggestInactiveProjectName(requested_project_name)

Return a name for a project that isn’t being rendered.

If the requested name is available, it is returned.

rendertracker.applyProjectNameFormula(user, local_hip_path)

Apply the formula to generate a project name.

Note that this formula does not guarantee that the project name is unique. To get a unique name, call suggestInactiveProjectName on the active render tracker.

rendertracker.getConnection(machine_name, port=None)

Return a connection to the render tracker’s RPC server.

This function is called by users of this module, not by the render tracker process.

Return None if the render tracker is not running. May return a cached cached connection from the previous successful call.

rendertracker.start(debug, verbose)
rendertracker.startWithSysArgs()