|
In the previous section we have implemented our first task (the t1.ecf file).
The t1.ecf script needs to be preprocessed to generate the job file.
This pre-processing is done automatically by ecflow_server the when the task is about to run.
However it is possible to check the job creation before the suite definition is loaded into the ecflow_server.
Automated job creation checking is only available with Python.
If the ecflow_server can’t locate the ecf script, please see ecf file location algorithm
The following points should be noted about about job creation checking:
Checking is done using ecflow.Defs.check_job_creation
Update $HOME/course/test.py with:
#!/usr/bin/env python2.7
import os
import ecflow
print "Creating suite definition"
defs = ecflow.Defs()
suite = defs.add_suite("test")
suite.add_variable("ECF_HOME", os.path.join(os.getenv("HOME"), "course"))
suite.add_task("t1")
print defs
print "Checking job creation: .ecf -> .job0"
print defs.check_job_creation()
# We can assert, so that we only progress, once all job creation works
# assert len(defs.check_job_creation()) == 0, "Job generation failed"
$HOME/course/test/t1.job0
|