|
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 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 job creation checking:
Checking is done using ecflow.Defs.check_job_creation
Update test.py with:
import os
from ecflow import Defs,Suite,Task,Edit
print("Creating suite definition")
home = os.path.join(os.getenv("HOME"), "course")
defs = Defs(
Suite('test',
Edit(ECF_HOME=home),
Task('t1')))
print(defs)
print("Checking job creation: .ecf -> .job0")
print(defs.check_job_creation())
# We can assert, so that we only progress once job creation works
# assert len(defs.check_job_creation()) == 0, "Job generation failed" |
$HOME/course/test/t1.job0
|