def makeWorkflow(): job = Job() r1 = job.addService(TestServiceSerialization("woot1")) r2 = job.addService(TestServiceSerialization("woot2")) r3 = job.addService(TestServiceSerialization("woot3")) job.addChildFn(fnTest, [ r1, r2, r3 ], outFile) return job
def makeWorkflow(): job = Job() r1 = job.addService(ToySerializableService("woot1")) r2 = job.addService(ToySerializableService("woot2")) r3 = job.addService(ToySerializableService("woot3")) job.addChildFn(fnTest, [r1, r2, r3], outFile) return job
def testServiceSerialization(self): """ Tests that a service can receive a promise without producing a serialization error. """ job = Job() service = TestServiceSerialization("woot") startValue = job.addService(service) # Add a first service to job subService = TestServiceSerialization(startValue) # Now create a child of # that service that takes the start value promise from the parent service job.addService(subService, parentService=service) # This should work if # serialization on services is working correctly. self.runToil(job)
def testServiceSerialization(self): """ Tests that a service can receive a promise without producing a serialization error. """ job = Job() service = ToySerializableService("woot") startValue = job.addService(service) # Add a first service to job subService = ToySerializableService(startValue) # Now create a child of # that service that takes the start value promise from the parent service job.addService(subService, parentService=service) # This should work if # serialization on services is working correctly. self.runToil(job)
# Return a value that enables another process to connect to the database return "loginCredentials" def check(self): # A function that if it returns False causes the service to quit # If it raises an exception the service is killed and an error is reported return True def stop(self, fileStore): # Cleanup the database here pass j = Job() s = DemoService() loginCredentialsPromise = j.addService(s) def dbFn(loginCredentials): # Use the login credentials returned from the service's start method to connect to the service pass j.addChildFn(dbFn, loginCredentialsPromise) if __name__ == "__main__": options = Job.Runner.getDefaultOptions("./toilWorkflowRun") options.logLevel = "INFO" options.clean = "always" with Toil(options) as toil: