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.
Description
When
uwtoolsprovisions an ecFlow server (see #868), it knows — and only it knows — the server's host, port, and SSL state at realize time. Job scripts (.ecffiles) 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.uwtoolsshould write the connection variable exports directly into each generated.ecffile during suite realization. Near the top of each generated.ecf(before any child commands are invoked),uwtoolsshould emit:where the values are resolved at realize time from the server provisioning step. This makes each job self-contained: no
ECF_INCLUDEpath needs to be configured, and no shared header file needs to exist on the compute node.Alternatives Considered
head.h):uwtoolsgenerates a minimalhead.hcontaining the three exports, and applications extend it viaECF_INCLUDE. RequiresECF_INCLUDEto be set correctly in the job environment and introduces auwtools-owned file that may collide with application-specific header conventions.uwtoolswritesedit ECF_SSL <state>into the suite definition, and applications addexport ECF_SSL=%ECF_SSL%to their own headers. Keepsuwtoolsout of header management but is not fully turnkey. Applications must add the export line themselves.Acceptance Criteria
uwtoolssuite realization writesexport ECF_HOST,export ECF_PORT, andexport ECF_SSLinto each generated.ecffile, with values resolved from the active server provisioning context.ECF_INCLUDEconfiguration is required for the connection variables to be available in the job environment..ecffiles 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.