RStudio Launcher Plugin SDK
1.1.3
A software development kit for creating plugins that work the the RStudio Launcher.
|
24 #ifndef LAUNCHER_PLUGINS_I_JOB_SOURCE_HPP
25 #define LAUNCHER_PLUGINS_I_JOB_SOURCE_HPP
30 #include <api/Job.hpp>
31 #include <api/ResponseTypes.hpp>
32 #include <api/stream/AbstractOutputStream.hpp>
33 #include <api/stream/AbstractResourceStream.hpp>
34 #include <jobs/AbstractJobRepository.hpp>
35 #include <jobs/JobStatusNotifier.hpp>
38 namespace launcher_plugins {
48 namespace launcher_plugins {
128 virtual bool cancelJob(JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage) = 0;
172 virtual bool killJob(JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage) = 0;
187 virtual bool resumeJob(JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage) = 0;
202 virtual bool stopJob(JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage) = 0;
218 virtual bool suspendJob(JobPtr in_job,
bool& out_isComplete, std::string& out_statusMessage) = 0;
231 virtual Error submitJob(JobPtr io_job,
bool& out_wasInvalidRequest)
const = 0;
246 OutputType in_outputType,
248 AbstractOutputStream::OnOutput in_onOutput,
250 AbstractOutputStream::OnError in_onError,
251 OutputStreamPtr& out_outputStream) = 0;
264 comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator,
265 AbstractResourceStreamPtr& out_resourceStream) = 0;
275 IJobSource(jobs::JobRepositoryPtr in_jobRepository, jobs::JobStatusNotifierPtr in_jobStatusNotifier) :
Represents the network information for a job.
Definition: ResponseTypes.hpp:129
virtual Error initialize()=0
Initializes the Job Source.
virtual Error submitJob(JobPtr io_job, bool &out_wasInvalidRequest) const =0
Submits a job to the Job Scheduling System.
ResourceLimitList ResourceLimits
Definition: IJobSource.hpp:95
virtual bool cancelJob(JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0
Cancels a pending job.
std::string DefaultImage
Definition: IJobSource.hpp:70
std::set< std::string > Queues
Definition: IJobSource.hpp:89
virtual Error getConfiguration(const system::User &in_user, JobSourceConfiguration &out_configuration) const =0
Gets the configuration and capabilities of this Job Source for the specified user.
Class which represents a system user.
Definition: User.hpp:55
Describes the container configuration of the Job Source.
Definition: IJobSource.hpp:52
virtual Error createOutputStream(OutputType in_outputType, JobPtr in_job, AbstractOutputStream::OnOutput in_onOutput, AbstractOutputStream::OnComplete in_onComplete, AbstractOutputStream::OnError in_onError, OutputStreamPtr &out_outputStream)=0
Creates an output stream for the specified job.
virtual Error createResourceStream(ConstJobPtr in_job, comms::AbstractLauncherCommunicatorPtr in_launcherCommunicator, AbstractResourceStreamPtr &out_resourceStream)=0
Creates a resource utilization metric stream for the specified job.
std::function< void(uint64_t)> OnComplete
Definition: AbstractOutputStream.hpp:66
jobs::JobStatusNotifierPtr m_jobStatusNotifier
Definition: IJobSource.hpp:285
bool AllowUnknownImages
Definition: IJobSource.hpp:64
virtual ~IJobSource()=default
Virtual Destructor.
virtual bool suspendJob(JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0
Suspends a running job.
bool SupportsContainers
Definition: IJobSource.hpp:73
ContainerConfiguration()
Default constructor.
Definition: IJobSource.hpp:57
virtual bool resumeJob(JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0
Resumes a suspended job.
PlacementConstraintList PlacementConstraints
Definition: IJobSource.hpp:86
Class which represents an error.
Definition: Error.hpp:174
Describes the capabilities and configuration of this Job Source.
Definition: IJobSource.hpp:77
ContainerConfiguration ContainerConfig
Definition: IJobSource.hpp:80
jobs::JobRepositoryPtr m_jobRepository
Definition: IJobSource.hpp:282
Generic interface for communicating with a Job Source. Implementation is plugin specific.
Definition: IJobSource.hpp:99
virtual bool stopJob(JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0
Stops a running job.
IJobSource(jobs::JobRepositoryPtr in_jobRepository, jobs::JobStatusNotifierPtr in_jobStatusNotifier)
Constructor.
Definition: IJobSource.hpp:275
std::set< std::string > ContainerImages
Definition: IJobSource.hpp:67
virtual bool killJob(JobPtr in_job, bool &out_isComplete, std::string &out_statusMessage)=0
Forcibly kills a running job.
virtual Error getNetworkInfo(JobPtr in_job, NetworkInfo &out_networkInfo) const =0
Gets the network information for the specified job.
JobConfigList CustomConfig
Definition: IJobSource.hpp:83