Starting the suite
A manually launched ecflow_server will start in a halted state, meaning that no tasks will be scheduled. In order to start task scheduling, the server must be restarted and the suite must be commanded to begin.
Note
The ecflow_start.sh script, referred in Getting Started, will automatically launch and start
the ecflow_server, thus skipping the need for explicitly restarting the server.
As before there are multiple ways to restart the ecflow_server and begin the suite, including using the CLI ecflow_client or programmatically via the Python API.
To check the status of the server, use the --stats command:
ecflow_client --stats
The output will indicate the server state.
If the ecflow_server is halted, restart it with the --restart command:
ecflow_client --restart
With the ecflow_server running, begin the suite with the --begin command:
ecflow_client --begin test
The following Python script demonstrates how to restart the ecflow_server and begin the suite, using the Python API. The script also loads the suite definition file, in case it was not loaded previously.
#!/usr/bin/env python3
import pathlib
from ecflow import Client
if __name__ == '__main__':
base = pathlib.Path.home() / "course"
try:
ci = Client()
print("[1] Syncing local defs with server")
ci.sync_local()
print("[2] Access the suite definition from the server")
defs = ci.get_defs()
print("[3] Restarting the server")
if len(defs) == 0:
print("No suites in server, loading defs from disk")
ci.load(str(base / "test.def"))
print("Restarting the server. This starts job scheduling")
ci.restart_server()
else:
print("read definition from disk and replace on the server")
ci.replace("/test", str(base / "test.def"))
print("[4] Begin the suite")
ci.begin_suite("test")
except RuntimeError as e:
print("Failed:", e)
What to do
Restart the ecflow_server using the CLI ecflow_client.
Begin the
testsuite using the CLI ecflow_client.(Optiona) Use the provided Python script to restart the ecflow_server and begin the suite