public void Main(string[] args) { var binaryFilePath = Path.Combine(Path.GetDirectoryName(_applicationEnvironment.ApplicationBasePath), "SimpleTaskRunner\\bin\\debug"); var dataFilePath = Path.Combine(_applicationEnvironment.ApplicationBasePath, "Data"); var container = GetCloudBlobContainer(_configuration.GetSection("AppSettings:StorageConnectionString").Value, "batch"); var taskDefiniton = new ComputeTaskDefinition { BinaryFilePath = binaryFilePath, DataFilePath = dataFilePath, StorageUri = container.Uri, ExecutableName = "SimpleTaskRunner.exe" }; var computeTasks = new List<IComputeTask> { new ComputeTask("task-1", taskDefiniton).AddArguments(new InputComputeTaskArgument("taskdata1.txt"), new SimpleComputeTaskArgument("3")), new ComputeTask("task-2", taskDefiniton).AddArguments(new InputComputeTaskArgument("taskdata2.txt"), new SimpleComputeTaskArgument("3")), new ComputeTask("task-3", taskDefiniton).AddArguments(new InputComputeTaskArgument("taskdata3.txt"), new SimpleComputeTaskArgument("3")) }.ToArray(); var computeJob = new ComputeJob("job-1") { ComputeTasks = computeTasks }; Console.WriteLine("Prepared the files. Press Enter to continue."); Console.ReadLine(); var jobInstance = new JobInstance(_scheduler, container); jobInstance.OnScheduleRequested(computeJob); jobInstance.PrepareJob(); jobInstance.Execute(); jobInstance.ProcessResults(); //jobInstance.Cleanup(); }
public ComputeTask(string id, ComputeTaskDefinition definition) { Id = id; Definition = definition; }