Interface JobSetupService


public interface JobSetupService
Service that sets up a directory for a job to execute in. The setup is broken into 3 stages so that they can be interleaved with other actions. 1. Create the empty folder structure 2. Download dependencies and other files in place 3. Evaluate setup scripts and create the job environment. This service also performs cleanup of said job directory.
Since:
4.0.0
  • Method Details

    • createJobDirectory

      File createJobDirectory(JobSpecification jobSpecification) throws SetUpJobException
      Creates a directory for the given job. Also creates the sub-directories structure common to all jobs.
      Parameters:
      jobSpecification - the job specification
      Returns:
      the job folder just created
      Throws:
      SetUpJobException - if the folder (or sub-folders) could not be created or already existed
    • downloadJobResources

      Set<File> downloadJobResources(JobSpecification jobSpecification, File jobDirectory) throws SetUpJobException
      Downloads and stages all the job files (dependencies, configurations, ...) into the job directory.
      Parameters:
      jobSpecification - the job specification
      jobDirectory - the job folder
      Returns:
      the list of setup files staged
      Throws:
      SetUpJobException - TODO
    • createJobScript

      File createJobScript(JobSpecification jobSpecification, File jobDirectory) throws SetUpJobException
      Creates the executable script that executes setup and runs the job (a.k.a. run file).
      Parameters:
      jobSpecification - the job specification
      jobDirectory - the job directory
      Returns:
      the generated executable script file
      Throws:
      SetUpJobException - if the file cannot be created
    • cleanupJobDirectory

      void cleanupJobDirectory(Path jobDirectory, CleanupStrategy cleanupStrategy) throws IOException
      Performs post-execution cleanup of the job directory.
      Parameters:
      jobDirectory - the job directory path
      cleanupStrategy - the cleanup strategy
      Throws:
      IOException - TODO