How to configure a connection between two script components
In the topology, users can define how a SOURCE node connects to a TARGET node. For example, they may configure how a web application (i.e., a SOURCE node) connects to a database (i.e., a TARGET node).
Step 1. Drop
- Drop two Bash components on two compute nodes (e.g.,
Bash_1
andBash_2
).
Step 2. Connect
- Click on the connect_to_data_endpoint point of
Bash_1
and connect to the data_endpoint ofBash_2
:
In this example, Bash_1
and Bash_2
are the SOURCE node and the TARGET node of the relationship, respectively.
Step 3. Configure source node
- Click on
Bash_1
. - Provide the artifact for the operation post_configure_source. This operation will be executed on
Compute_1
after the operation configure has completed successfully.
You may use this operation to configure Bash_1
to connect to Bash_2
. For example:
In this example, some environment variables from both the source and target nodes (e.g., SOURCE_IP
, TARGET_IP
) are available in the script. For more environment variables, see this section.
Step 4. Add source node (optional)
- Click on
Bash_1
. - Provide the artifact for the operation add_source. This operation will be executed on
Compute_2
afterBash_1
has completed successfully.
You may use add_source
to notify Bash_2
that Bash_1
has completedly successfully. For example:
Expected result
During the deployment, the resulting workflow between Bash_1
and Bash_2
is as follows:
- The orchestrator setups the TARGET node first (i.e., it calls the operation
configure
ofBash_2
onCompute_2
). - Afterwards, it setups the SOURCE node to connect to the TARGET node (i.e., it calls the operation
configure
andpost_configure_source
ofBash_1
onCompute_1
). - After the SOURCE node has started successfully, the orchestrator notifies the TARGET node (i.e., it calls the operation
add_source
ofBash_1
onCompute_2
).