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 of Pod
    • 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 this Pod
      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 a Pod with given Instance details
      void forceUpdatePod​(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)
      Forcefully update a specific Instance of a Pod
      void garbageCollect()
      Clean up after pods that are currently dead
      java.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 of Pod this runner can run
      boolean isPodStarted​(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
      Returns if the runner has started this Instance of this Pod
      void killOrphans()
      Find orphaned pods that are not tracked in the Controller and kill them
      void preparePod​(uk.co.ractf.polaris.api.task.Task task, T pod)
      Prepares a Pod 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 specific Instance of a Pod
      void startPod​(uk.co.ractf.polaris.api.task.Task task, T pod, uk.co.ractf.polaris.api.instance.Instance instance)
      Starts a Pod with given Instance details
      void stopPod​(T pod, uk.co.ractf.polaris.api.instance.Instance instance)
      Stops a Pod with given Instance details
      void updatePod​(uk.co.ractf.polaris.api.task.Task task, T pod)
      Update a Pod 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 a Pod with given Instance details
        Parameters:
        task - the task
        pod - the pod
        instance - instance details
      • startPod

        void startPod​(uk.co.ractf.polaris.api.task.Task task,
                      T pod,
                      uk.co.ractf.polaris.api.instance.Instance instance)
        Starts a Pod with given Instance details
        Parameters:
        task - the task
        pod - the pod
        instance - instance details
      • stopPod

        void stopPod​(T pod,
                     uk.co.ractf.polaris.api.instance.Instance instance)
        Stops a Pod with given Instance details
        Parameters:
        pod - the pod
        instance - 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 specific Instance of a Pod
        Parameters:
        pod - the pod
        instance - the instance to update
      • updatePod

        void updatePod​(uk.co.ractf.polaris.api.task.Task task,
                       T pod)
        Update a Pod if an update is available.
        Parameters:
        pod - the pod
      • restartPod

        void restartPod​(T pod,
                        uk.co.ractf.polaris.api.instance.Instance instance)
        Restart a specific Instance of a Pod
        Parameters:
        pod - the pod
        instance - the instance to restart
      • canStartPod

        boolean canStartPod​(T pod)
        Returns if the runner is currently able to start this Pod
        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 this Instance of this Pod
        Parameters:
        pod - the pod
        instance - the instance
        Returns:
        if its started
      • preparePod

        void preparePod​(uk.co.ractf.polaris.api.task.Task task,
                        T pod)
        Prepares a Pod 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 to
        pod - 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 the Controller and kill them
      • getType

        java.lang.Class<T> getType()
        Returns a class of type T where T is the type of Pod 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 network
        task - the task the pods belong to.
        instance - the instance