ecFlow's documentation is now on readthedocs!

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

The next step is to let ecf_server know about your suite or to “load” the suite definition file.

This checks the file test.def and describes the suite to the ecf_server.

This can be done in several ways, depending on how the suite was created.

Loading a Suite created as a text file

From within the course directory do the following from the unix shell:

> ecf_client --load=test.def

The executable ecf_client provides the shell level interface for communication with the ecf_server.

You will have already seen ecf_client being used in head.h and tail.h include files.

For a full list of commands type:

> ecf_client --help

Note

All the functionality provided by ecf_client is also available via the ecFlow Python Api. Please see ecflow.Client

Loading Suite created in python

We can ask the python script to write out the defs as ‘.def’ definition file:

#!/usr/bin/env python2.5
import os
import ecflow 
   
defs = ecflow.Defs("test.def")
suite = defs.add_suite("test")
suite.add_variable("ECF_HOME",os.getenv("HOME") + "/course")
suite.add_task("t1")

# this will generate a file 'test.def'
defs.save_as_defs()

You can also print the defs. The output will written to standard out:

print defs

If you called “defs.save_as_defs()” the file test.def will be written.

This can be loaded in the server as described earlier Loading a Suite created as a text file

However since the ecFlow Python Api allows the definition to be built in memory, it is more efficient if this could be directly loaded into the ecf_server.

This can be done by using ecflow.Client python class:

ci = ecflow.Client();
ci.set_host_port("localhost","3141")

try:
   ci.ping()                 # Ping the server, to see if its running
   ci.load(defs)             # load the definition into the server
except RuntimeError, e:
   print "failed: " + str(e);

If everything is OK, you should have defined a suite.

Have a look in the window running the ecf_server, and look at the log file

What to do:

  1. Load the definition file
  2. Check the log file
  • No labels