Skip to content

ecFlow suite realization: write ECF_HOST, ECF_PORT, and ECF_SSL exports directly into generated .ecf files #928

@AnnaSmoot-NOAA

Description

@AnnaSmoot-NOAA

Description

When uwtools provisions an ecFlow server (see #868), it knows — and only it knows — the server's host, port, and SSL state at realize time. Job scripts (.ecf files) need these values exported into their shell environment so that ecFlow child commands (ecflow_client --init, --complete, --abort, etc.) can call back to the server from the compute node.

uwtools should write the connection variable exports directly into each generated .ecf file during suite realization. Near the top of each generated .ecf (before any child commands are invoked), uwtools should emit:

export ECF_HOST=<hostname>
export ECF_PORT=<port>
export ECF_SSL=<1|0>

where the values are resolved at realize time from the server provisioning step. This makes each job self-contained: no ECF_INCLUDE path needs to be configured, and no shared header file needs to exist on the compute node.

Alternatives Considered

  • Shared header file (head.h): uwtools generates a minimal head.h containing the three exports, and applications extend it via ECF_INCLUDE. Requires ECF_INCLUDE to be set correctly in the job environment and introduces a uwtools-owned file that may collide with application-specific header conventions.
  • Def-only ownership: uwtools writes edit ECF_SSL <state> into the suite definition, and applications add export ECF_SSL=%ECF_SSL% to their own headers. Keeps uwtools out of header management but is not fully turnkey. Applications must add the export line themselves.

Acceptance Criteria

  • uwtools suite realization writes export ECF_HOST, export ECF_PORT, and export ECF_SSL into each generated .ecf file, with values resolved from the active server provisioning context.
  • The exports appear before any ecFlow child commands in the script.
  • No ECF_INCLUDE configuration is required for the connection variables to be available in the job environment.
  • Behavior is documented, noting that connection logic is duplicated across generated .ecf files and is not user-editable in a single location.

Additional Context

Related to #868. Approach discussed and selected as the most NCO-friendly option by the uwtools team.

Metadata

Metadata

Labels

featureAdded functionality
No fields configured for Feature.

Projects

Status
Blocked

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions