Search in sources :

Example 6 with SubmissionClosedException

use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.

the class SchedulerFrontendState method jobSubmitted.

synchronized void jobSubmitted(InternalJob job, UserIdentificationImpl ident) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException {
    // put the job inside the frontend management list
    jobs.put(job.getId(), new IdentifiedJob(job.getId(), ident, job.getGenericInformation()));
    // increase number of submit for this user
    ident.addSubmit();
    // send update user event
    usersUpdated(new NotificationData<UserIdentification>(SchedulerEvent.USERS_UPDATE, ident));
    jlogger.info(job.getId(), "submitted: name '" + job.getName() + "', tasks '" + job.getTotalNumberOfTasks() + "', owner '" + job.getOwner() + "'");
    try {
        jlogger.info(job.getId(), job.display());
    } catch (Exception e) {
        jlogger.error(job.getId(), "Error while displaying the job :", e);
    }
}
Also used : IdentifiedJob(org.ow2.proactive.scheduler.job.IdentifiedJob) UserIdentification(org.ow2.proactive.scheduler.common.job.UserIdentification) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) AlreadyConnectedException(org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) IOException(java.io.IOException) SchedulerException(org.ow2.proactive.scheduler.common.exception.SchedulerException)

Example 7 with SubmissionClosedException

use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.

the class SchedulerClient method submit.

@Override
public JobId submit(Job job) throws NotConnectedException, PermissionException, SubmissionClosedException, JobCreationException {
    JobIdData jobIdData = null;
    try {
        InputStream is = (new Job2XMLTransformer()).jobToxml((TaskFlowJob) job);
        jobIdData = restApiClient().submitXml(sid, is);
    } catch (Exception e) {
        throwNCEOrPEOrSCEOrJCE(e);
    }
    return jobId(jobIdData);
}
Also used : JobIdData(org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData) Job2XMLTransformer(org.ow2.proactive.scheduler.common.job.factories.Job2XMLTransformer) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) KeyException(java.security.KeyException) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) SchedulerRestException(org.ow2.proactive_grid_cloud_portal.scheduler.exception.SchedulerRestException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) IOException(java.io.IOException) NotConnectedRestException(org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException) PermissionRestException(org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException) TimeoutException(java.util.concurrent.TimeoutException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) UnknownJobRestException(org.ow2.proactive_grid_cloud_portal.scheduler.exception.UnknownJobRestException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException)

Example 8 with SubmissionClosedException

use of org.ow2.proactive.scheduler.common.exception.SubmissionClosedException in project scheduling by ow2-proactive.

the class AbstractSmartProxy method submit.

/**
 * Submits a job to the scheduler and handle data transfer via the SmartProxy
 *
 * @param job                   job to submit
 * @param localInputFolderPath  path to the local directory containing input files
 * @param pushUrl               url of the dataspace server used to push input files to
 * @param localOutputFolderPath path to the local directory which will contain output files
 * @param pullUrl               url of the dataspace server used to pull output files from
 * @param isolateTaskOutputs    if set to true, output files from each tasks will be isolated from each other in the dataspace server (to prevent overlapping)
 * @param automaticTransfer     if set to true, output files will be automatically transferred from the dataspace server to the local machine as soon as the task is finished.
 *                              If set to false, the files will not be automatically transferred and a call to pullData must be done to transfer files
 * @return the new job id
 * @throws Exception
 * @throws SubmissionClosedException
 * @throws JobCreationException
 */
public JobId submit(TaskFlowJob job, String localInputFolderPath, String pushUrl, String localOutputFolderPath, String pullUrl, boolean isolateTaskOutputs, boolean automaticTransfer) throws Exception, SubmissionClosedException, JobCreationException {
    checkInitialized();
    if (isNullOrEmpty(pushUrl)) {
        pushUrl = getLocalUserSpace();
    }
    if (isNullOrEmpty(pullUrl)) {
        pullUrl = getLocalUserSpace();
    }
    String newFolderName = createNewFolderName();
    String pushUrlUpdate = prepareJobInput(job, localInputFolderPath, pushUrl, newFolderName);
    String pullUrlUpdate = prepareJobOutput(job, localOutputFolderPath, pullUrl, newFolderName, isolateTaskOutputs);
    uploadInputfiles(job, localInputFolderPath);
    JobId id = null;
    try {
        id = submit(job);
    } catch (Exception e) {
        log.error("Error while submitting job", e);
        try {
            removeJobIO(job, pushUrl, pullUrl, newFolderName);
        } catch (Exception e2) {
            log.error("Error while removing job IO", e2);
        }
        propagateIfInstanceOf(e, NotConnectedException.class);
        propagateIfInstanceOf(e, PermissionException.class);
        propagateIfInstanceOf(e, SubmissionClosedException.class);
        propagateIfInstanceOf(e, JobCreationException.class);
        propagateIfInstanceOf(e, RuntimeException.class);
        propagate(e);
    }
    HashMap<String, AwaitedTask> awaitedTaskMap = new HashMap<>();
    for (Task t : job.getTasks()) {
        awaitedTaskMap.put(t.getName(), new AwaitedTask(t.getName(), t.getOutputFilesList()));
    }
    AwaitedJob awaitedJob = new AwaitedJob(id.toString(), localInputFolderPath, job.getInputSpace(), pushUrlUpdate, localOutputFolderPath, job.getOutputSpace(), pullUrlUpdate, isolateTaskOutputs, automaticTransfer, awaitedTaskMap);
    jobTracker.putAwaitedJob(id.toString(), awaitedJob);
    return id;
}
Also used : PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) Task(org.ow2.proactive.scheduler.common.task.Task) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) HashMap(java.util.HashMap) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) LoginException(javax.security.auth.login.LoginException) KeyException(java.security.KeyException) UnknownJobException(org.ow2.proactive.scheduler.common.exception.UnknownJobException) JobAlreadyFinishedException(org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) JobCreationException(org.ow2.proactive.scheduler.common.exception.JobCreationException) PermissionException(org.ow2.proactive.scheduler.common.exception.PermissionException) NotConnectedException(org.ow2.proactive.scheduler.common.exception.NotConnectedException) UnknownTaskException(org.ow2.proactive.scheduler.common.exception.UnknownTaskException) SchedulerException(org.ow2.proactive.scheduler.common.exception.SchedulerException) SubmissionClosedException(org.ow2.proactive.scheduler.common.exception.SubmissionClosedException) JobId(org.ow2.proactive.scheduler.common.job.JobId)

Aggregations

JobCreationException (org.ow2.proactive.scheduler.common.exception.JobCreationException)8 PermissionException (org.ow2.proactive.scheduler.common.exception.PermissionException)8 NotConnectedException (org.ow2.proactive.scheduler.common.exception.NotConnectedException)7 SubmissionClosedException (org.ow2.proactive.scheduler.common.exception.SubmissionClosedException)7 JobAlreadyFinishedException (org.ow2.proactive.scheduler.common.exception.JobAlreadyFinishedException)6 UnknownJobException (org.ow2.proactive.scheduler.common.exception.UnknownJobException)6 UnknownTaskException (org.ow2.proactive.scheduler.common.exception.UnknownTaskException)6 IOException (java.io.IOException)5 KeyException (java.security.KeyException)5 NotConnectedRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.NotConnectedRestException)4 PermissionRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.PermissionRestException)4 TimeoutException (java.util.concurrent.TimeoutException)3 JobIdData (org.ow2.proactive_grid_cloud_portal.scheduler.dto.JobIdData)3 SchedulerRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.SchedulerRestException)3 UnknownJobRestException (org.ow2.proactive_grid_cloud_portal.scheduler.exception.UnknownJobRestException)3 FileInputStream (java.io.FileInputStream)2 InputStream (java.io.InputStream)2 AlreadyConnectedException (org.ow2.proactive.scheduler.common.exception.AlreadyConnectedException)2 SchedulerException (org.ow2.proactive.scheduler.common.exception.SchedulerException)2 InternalJob (org.ow2.proactive.scheduler.job.InternalJob)2