Package uk.co.ractf.polaris.node.runner
Interface Runner<T extends uk.co.ractf.polaris.api.pod.Pod>
- 
- Type Parameters:
 T- The type of pod this runner can run
- All Known Implementing Classes:
 DockerRunner
public interface Runner<T extends uk.co.ractf.polaris.api.pod.Pod>Provides the interface to manage execution of a subclass ofPod 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanStartPod(T pod)Returns if the runner is currently able to start thisPodvoidcreateNetwork(java.util.List<T> pods, uk.co.ractf.polaris.api.task.Task task, uk.co.ractf.polaris.api.instance.Instance instance)Creates a network between a list of pods.voidcreatePod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Creates aPodwith givenInstancedetailsvoidforceUpdatePod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Forcefully update a specificInstanceof aPodvoidgarbageCollect()Clean up after pods that are currently deadjava.util.List<java.lang.String>getImages()Returns the images that can be used by this runner and are stored locally on the node.java.lang.StringgetName()Gets the name of the runner.java.lang.Class<T>getType()Returns a class of type T where T is the type ofPodthis runner can runbooleanisPodStarted(T pod, uk.co.ractf.polaris.api.instance.Instance instance)Returns if the runner has started thisInstanceof thisPodvoidkillOrphans()Find orphaned pods that are not tracked in theControllerand kill themvoidpreparePod(uk.co.ractf.polaris.api.task.Task task, T pod)Prepares aPodthat currently cannot be started so it can be started in the future (e.g.voidrestartPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)Restart a specificInstanceof aPodvoidstartPod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Starts aPodwith givenInstancedetailsvoidstopPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)Stops aPodwith givenInstancedetailsvoidupdatePod(uk.co.ractf.polaris.api.task.Task task, T pod)Update aPodif an update is available. 
 - 
 
- 
- 
Method Detail
- 
createPod
void createPod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Creates aPodwith givenInstancedetails- Parameters:
 task- the taskpod- the podinstance- instance details
 
- 
startPod
void startPod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Starts aPodwith givenInstancedetails- Parameters:
 task- the taskpod- the podinstance- instance details
 
- 
stopPod
void stopPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Stops aPodwith givenInstancedetails- Parameters:
 pod- the podinstance- instance details
 
- 
forceUpdatePod
void forceUpdatePod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)Forcefully update a specificInstanceof aPod- Parameters:
 pod- the podinstance- the instance to update
 
- 
updatePod
void updatePod(uk.co.ractf.polaris.api.task.Task task, T pod)Update aPodif an update is available.- Parameters:
 pod- the pod
 
- 
restartPod
void restartPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Restart a specificInstanceof aPod- Parameters:
 pod- the podinstance- the instance to restart
 
- 
canStartPod
boolean canStartPod(T pod)
Returns if the runner is currently able to start thisPod- Parameters:
 pod- the pod- Returns:
 - can it be started
 
 
- 
isPodStarted
boolean isPodStarted(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Returns if the runner has started thisInstanceof thisPod- Parameters:
 pod- the podinstance- the instance- Returns:
 - if its started
 
 
- 
preparePod
void preparePod(uk.co.ractf.polaris.api.task.Task task, T pod)Prepares aPodthat currently cannot be started so it can be started in the future (e.g.DockerRunnerwill pull the docker image)- Parameters:
 task- the task the pod belongs topod- the pod to prepare
 
- 
garbageCollect
void garbageCollect()
Clean up after pods that are currently dead 
- 
killOrphans
void killOrphans()
Find orphaned pods that are not tracked in theControllerand kill them 
- 
getType
java.lang.Class<T> getType()
Returns a class of type T where T is the type ofPodthis runner can run- Returns:
 - the class of T
 
 
- 
getName
java.lang.String getName()
Gets the name of the runner.- Returns:
 - name
 
 
- 
getImages
java.util.List<java.lang.String> getImages()
Returns the images that can be used by this runner and are stored locally on the node.- Returns:
 - the locally stored images
 
 
- 
createNetwork
void createNetwork(java.util.List<T> pods, uk.co.ractf.polaris.api.task.Task task, uk.co.ractf.polaris.api.instance.Instance instance)
Creates a network between a list of pods.- Parameters:
 pods- the pods to networktask- the task the pods belong to.instance- the instance
 
 - 
 
 -