private AzureBatchDotNetClient( IInjector injector, IResourceArchiveFileGenerator resourceArchiveFileGenerator, DriverFolderPreparationHelper driverFolderPreparationHelper, AzureStorageClient azureStorageClient, REEFFileNames fileNames, AzureBatchFileNames azbatchFileNames, JobRequestBuilderFactory jobRequestBuilderFactory, AzureBatchService batchService, JobJarMaker jobJarMaker, //// Those parameters are used in AzureBatchJobSubmissionResult, but could not be injected there. //// It introduces circular injection issues, as all classes constructor inherited from JobSubmissionResult has reference to IREEFClient. //// TODO: [REEF-2020] Refactor IJobSubmissionResult Interface and JobSubmissionResult implementation [Parameter(typeof(DriverHTTPConnectionRetryInterval))] int retryInterval, [Parameter(typeof(DriverHTTPConnectionAttempts))] int numberOfRetries) { _injector = injector; _fileNames = fileNames; _azbatchFileNames = azbatchFileNames; _driverFolderPreparationHelper = driverFolderPreparationHelper; _azureStorageClient = azureStorageClient; _jobRequestBuilderFactory = jobRequestBuilderFactory; _batchService = batchService; _jobJarMaker = jobJarMaker; _retryInterval = retryInterval; _numberOfRetries = numberOfRetries; }
public void CreateJob(string jobId, Uri resourceFile, string commandLine, string storageContainerSAS) { CloudJob unboundJob = Client.JobOperations.CreateJob(); unboundJob.Id = jobId; unboundJob.PoolInformation = new PoolInformation() { PoolId = PoolId }; unboundJob.JobPreparationTask = CreateJobPreparationTask(); unboundJob.JobManagerTask = new JobManagerTask() { Id = jobId, CommandLine = commandLine, RunExclusive = false, ResourceFiles = resourceFile != null ? new List <ResourceFile>() { new ResourceFile(resourceFile.AbsoluteUri, AzureBatchFileNames.GetTaskJarFileName()) } : new List <ResourceFile>(), EnvironmentSettings = new List <EnvironmentSetting> { new EnvironmentSetting(AzureStorageContainerSasToken, storageContainerSAS) }, // This setting will signal Batch to generate an access token and pass it // to the Job Manager Task (aka the Driver) as an environment variable. // For more info, see // https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.batch.cloudtask.authenticationtokensettings AuthenticationTokenSettings = new AuthenticationTokenSettings() { Access = AccessScope.Job }, ContainerSettings = CreateTaskContainerSettings(jobId), }; if (AreContainersEnabled) { unboundJob.JobManagerTask.UserIdentity = new UserIdentity(autoUserSpecification: new AutoUserSpecification(elevationLevel: ElevationLevel.Admin)); } unboundJob.Commit(); LOGGER.Log(Level.Info, "Submitted job {0}, commandLine {1} ", jobId, commandLine); }
private AzureBatchDotNetClient( IInjector injector, IResourceArchiveFileGenerator resourceArchiveFileGenerator, DriverFolderPreparationHelper driverFolderPreparationHelper, AzureStorageClient azureStorageClient, REEFFileNames fileNames, AzureBatchFileNames azbatchFileNames, JobRequestBuilderFactory jobRequestBuilderFactory, AzureBatchService batchService, JobJarMaker jobJarMaker) { _injector = injector; _fileNames = fileNames; _azbatchFileNames = azbatchFileNames; _driverFolderPreparationHelper = driverFolderPreparationHelper; _azureStorageClient = azureStorageClient; _jobRequestBuilderFactory = jobRequestBuilderFactory; _batchService = batchService; _jobJarMaker = jobJarMaker; }