-
Notifications
You must be signed in to change notification settings - Fork 107
Remove device name and ip address from required parameters of configure_nw_interfaces.sh #2999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
...s/aws-parallelcluster-environment/files/default/network_interfaces/configure_nw_interface.sh
Outdated
Show resolved
Hide resolved
...s/aws-parallelcluster-environment/files/default/network_interfaces/configure_nw_interface.sh
Outdated
Show resolved
Hide resolved
fi | ||
|
||
# Check if this is an EFA-only interface (no device name or IP) | ||
if [ -z "${DEVICE_NAME}" ] || [ -z "${DEVICE_IP_ADDRESS}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where it is documented that efa-only interfaces do not have a device name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find official documentation but when you try to run this script with an efa-only interface type it has the following input:
{"DEVICE_NAME"=>"", "DEVICE_NUMBER"=>"1", "NETWORK_CARD_INDEX"=>"1", "GW_IP_ADDRESS"=>"192.168.112.1", "DEVICE_IP_ADDRESS"=>nil, "CIDR_PREFIX_LENGTH"=>"20", "NETMASK"=>"255.255.240.0", "CIDR_BLOCK"=>"192.168.112.0/20", "MAC"=>"02:6e:6f:a7:24:8d"}
So it doesn't input a device name or ip address.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is ok for EFA only, but removing the check on DEVICE_NAME
and DEVICE_IP_ADDRESS
(lines above) we are accepting invalid values for the other types of interface.
Before your change we required all network interfaces to have both DEVICE_NAME
and DEVICE_IP_ADDRESS
. Now we don't check anymore. Removing the check makes sense for EFA only interfaces, but it does not for the other types.
A more robust logic should be: require all variables are set, unless both DEVICE_NAME
and DEVICE_IP_ADDRESS
are unset
this change contributes to supporting GB200 instance types. Let' make sure to capture an entry in the changelog |
|
||
# If one of these is missing but not both, it is an invalid configuration | ||
if [ -z "${DEVICE_NAME}" ] || [ -z "${DEVICE_IP_ADDRESS}" ]; then | ||
echo "One or more environment variables missing" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please specify the name of variables that may be missing.
This script does not have -x, so if we see from the logs the message 'One or more environment variables missing' we do not know if it is the first or second check that is failing.
9fe8c05
to
81cf5a0
Compare
@@ -1,18 +1,29 @@ | |||
#!/bin/sh | |||
|
|||
set -ex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for aligning all Os specific scripts.
Since we are doing it, please use the same execution options: set -ex
everywhere to facilitate troubleshooting in case of issues
Description of changes
configure_nw_interfaces.sh
Tests
References
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.