Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.broadinstitute.picard.workflows.sfrazer
- import java.io.File;
- import org.broadinstitute.zamboni.server.util.log.Log
- import org.broadinstitute.zamboni.server.util.ZamboniDef._
- import org.broadinstitute.zamboni.server.workflowexecution.{InternalJob, StepRunner, ZamboniJob}
- import org.broadinstitute.zamboni.server.request.{Request, RequestTrait}
- import org.broadinstitute.zamboni.server.db.entity.{Status, StepJob}
- import org.broadinstitute.zamboni.server.workflowcreation.{CompoundStepBuilder, CreateWorkflowValue, WorkflowCreator}
- import org.broadinstitute.zamboni.server.batchsystem.BatchSystemFactory
- import org.broadinstitute.zamboni.server.property._
- class FHWorkflow extends WorkflowCreator {
- def createWorkflow(request: RequestTrait) = {
- var first = new FHFirst( "first" )
- var second = new FHSecond( "second" )
- second dependsOn first
- addRootSteps(first)
- new CreateWorkflowValue(workflowName = "FHWorkflow", logDirectory = "/home/unix/sfrazer/zamboni-data")
- }
- }
- protected trait FirehoseBaseTask {
- var outputDir: String
- var taskDir: String
- var stepName: String
- def command: List[String]
- def scheduleStep: List[ZamboniJob] = {
- val moduleDir = new File(taskDir, stepName).getAbsolutePath()
- val stdoutPath = new File(moduleDir, "stdout").getAbsolutePath()
- val stderrPath = new File(moduleDir, "stderr").getAbsolutePath()
- val cmd = (command.slice(0,1))(0)
- val args = command.slice(1, command.size)
- val job = BatchSystemFactory.defaultBatchSystem.newJob(
- command="python",
- args=List("/home/unix/sfrazer/script.py", "param")
- /*workingDirectory=moduleDir,
- outputPath=stdoutPath,
- errorPath=stderrPath*/
- )
- List(job)
- }
- }
- protected class FHFirst (var stepName:String)
- extends StepRunner(stepName) with FirehoseBaseTask {
- var outputDir: String = _
- var taskDir: String = _
- def command: List[String] = {
- List("python", "script.py", stepName, "param2")
- }
- }
- protected class FHSecond (var stepName:String)
- extends StepRunner(stepName) with FirehoseBaseTask {
- var outputDir: String = _
- var taskDir: String = _
- def command: List[String] = {
- List("python", "script.py", stepName, "param2")
- }
- }
Add Comment
Please, Sign In to add comment