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 boolean
canStartPod(T pod)
Returns if the runner is currently able to start thisPod
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.void
createPod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Creates aPod
with givenInstance
detailsvoid
forceUpdatePod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Forcefully update a specificInstance
of aPod
void
garbageCollect()
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.String
getName()
Gets the name of the runner.java.lang.Class<T>
getType()
Returns a class of type T where T is the type ofPod
this runner can runboolean
isPodStarted(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Returns if the runner has started thisInstance
of thisPod
void
killOrphans()
Find orphaned pods that are not tracked in theController
and kill themvoid
preparePod(uk.co.ractf.polaris.api.task.Task task, T pod)
Prepares aPod
that currently cannot be started so it can be started in the future (e.g.void
restartPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Restart a specificInstance
of aPod
void
startPod(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Starts aPod
with givenInstance
detailsvoid
stopPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Stops aPod
with givenInstance
detailsvoid
updatePod(uk.co.ractf.polaris.api.task.Task task, T pod)
Update aPod
if 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 aPod
with givenInstance
details- 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 aPod
with givenInstance
details- Parameters:
task
- the taskpod
- the podinstance
- instance details
-
stopPod
void stopPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Stops aPod
with givenInstance
details- 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 specificInstance
of aPod
- Parameters:
pod
- the podinstance
- the instance to update
-
updatePod
void updatePod(uk.co.ractf.polaris.api.task.Task task, T pod)
Update aPod
if an update is available.- Parameters:
pod
- the pod
-
restartPod
void restartPod(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
Restart a specificInstance
of 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 thisInstance
of 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 aPod
that currently cannot be started so it can be started in the future (e.g.DockerRunner
will 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 theController
and kill them
-
getType
java.lang.Class<T> getType()
Returns a class of type T where T is the type ofPod
this 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
-
-