Class AbstractExecScript

java.lang.Object
io.kestra.core.models.tasks.Task
io.kestra.plugin.scripts.exec.AbstractExecScript
All Implemented Interfaces:
io.kestra.core.models.Plugin, io.kestra.core.models.tasks.InputFilesInterface, io.kestra.core.models.tasks.NamespaceFilesInterface, io.kestra.core.models.tasks.OutputFilesInterface, io.kestra.core.models.tasks.RunnableTask<ScriptOutput>, io.kestra.core.models.tasks.TaskInterface, io.kestra.core.models.WorkerJobLifecycle

public abstract class AbstractExecScript extends io.kestra.core.models.tasks.Task implements io.kestra.core.models.tasks.RunnableTask<ScriptOutput>, io.kestra.core.models.tasks.NamespaceFilesInterface, io.kestra.core.models.tasks.InputFilesInterface, io.kestra.core.models.tasks.OutputFilesInterface
  • Nested Class Summary

    Nested classes/interfaces inherited from class io.kestra.core.models.tasks.Task

    io.kestra.core.models.tasks.Task.TaskBuilder<C extends io.kestra.core.models.tasks.Task,B extends io.kestra.core.models.tasks.Task.TaskBuilder<C,B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<String>
     
    protected Map<String,String>
     
    protected Boolean
     
    protected @NotNull @NotEmpty List<String>
     
    protected @NotNull RunnerType
     
    io.kestra.core.models.tasks.runners.TargetOS
     
    protected @Valid io.kestra.core.models.tasks.runners.TaskRunner
     
    protected @NotNull Boolean
     

    Fields inherited from class io.kestra.core.models.tasks.Task

    disabled, id, retry, timeout, type
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected CommandsWrapper
    commands(io.kestra.core.runners.RunContext runContext)
     
    protected List<String>
     
    abstract String
     
    abstract DockerOptions
     
    protected List<String>
    Gets the list of additional commands to be used for defining interpreter errors handling.
    protected DockerOptions
    injectDefaults(@NotNull DockerOptions original)
    Allow setting Docker options defaults values.
    void
    protected List<String>
     

    Methods inherited from class io.kestra.core.models.tasks.Task

    findById, findById, getDescription, getDisabled, getId, getLogLevel, getRetry, getTimeout, getType, getWorkerGroup, isAllowFailure, isFlowable, isSendToWorkerTask

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.kestra.core.models.tasks.InputFilesInterface

    getInputFiles

    Methods inherited from interface io.kestra.core.models.tasks.NamespaceFilesInterface

    getNamespaceFiles

    Methods inherited from interface io.kestra.core.models.tasks.OutputFilesInterface

    getOutputFiles

    Methods inherited from interface io.kestra.core.models.tasks.RunnableTask

    run

    Methods inherited from interface io.kestra.core.models.WorkerJobLifecycle

    stop
  • Field Details

    • runner

      @PluginProperty @NotNull protected @NotNull RunnerType runner
    • taskRunner

      @PluginProperty @Beta @Valid protected @Valid io.kestra.core.models.tasks.runners.TaskRunner taskRunner
    • beforeCommands

      @PluginProperty(dynamic=true) protected List<String> beforeCommands
    • env

      @PluginProperty(additionalProperties=java.lang.String.class, dynamic=true) protected Map<String,String> env
    • warningOnStdErr

      @PluginProperty @NotNull protected @NotNull Boolean warningOnStdErr
    • interpreter

      @PluginProperty @NotNull @NotEmpty protected @NotNull @NotEmpty List<String> interpreter
    • failFast

      @PluginProperty protected Boolean failFast
    • targetOS

      public io.kestra.core.models.tasks.runners.TargetOS targetOS
  • Constructor Details

    • AbstractExecScript

      public AbstractExecScript()
  • Method Details

    • getDocker

      public abstract DockerOptions getDocker()
    • getContainerImage

      @PluginProperty(dynamic=true) public abstract String getContainerImage()
    • injectDefaults

      protected DockerOptions injectDefaults(@NotNull @NotNull DockerOptions original)
      Allow setting Docker options defaults values. To make it work, it is advised to set the 'docker' field like:
      
           @Schema(
               title = "Docker options when using the `DOCKER` runner",
               defaultValue = "{image=python, pullPolicy=ALWAYS}"
           )
           @PluginProperty
           @Builder.Default
           protected DockerOptions docker = DockerOptions.builder().build();
       
    • commands

      protected CommandsWrapper commands(io.kestra.core.runners.RunContext runContext) throws io.kestra.core.exceptions.IllegalVariableEvaluationException
      Throws:
      io.kestra.core.exceptions.IllegalVariableEvaluationException
    • getBeforeCommandsWithOptions

      protected List<String> getBeforeCommandsWithOptions()
    • mayAddExitOnErrorCommands

      protected List<String> mayAddExitOnErrorCommands(List<String> commands)
    • getExitOnErrorCommands

      protected List<String> getExitOnErrorCommands()
      Gets the list of additional commands to be used for defining interpreter errors handling.
      Returns:
      list of commands;
    • kill

      public void kill()
      Specified by:
      kill in interface io.kestra.core.models.WorkerJobLifecycle