Skip to content
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

Try to make mutatenodes more robust against being interrupted. #384

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions scripts/mutatenodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ then
fi
fi

if [ -z "$SCP" ]
then
if [ -r "$JITSI_SSH_CONFIG" ]
then
SCP="scp -o StrictHostKeyChecking=no -F $JITSI_SSH_CONFIG -q"
else
SCP="scp -o StrictHostKeyChecking=no -q"
fi
fi

NODE_FAILURE_LOG=$(mktemp)

mutate_node() {
Expand Down Expand Up @@ -81,11 +91,11 @@ mutate_node() {
exit 1
fi

$SSH $2 cat /opt/selenium_grid_extras/node_5555.json > $node_config_orig
$SCP "$2:/opt/selenium_grid_extras/node_5555.json" $node_config_orig
jq ".capabilities[0].maxInstances = $max_instances | .capabilities[0].applicationName = \"$application_name\" | .maxSession = $max_session" $node_config_orig > $node_config

$SSH $2 "cat > node_5555.json" < $node_config
$SSH $2 "sudo mv node_5555.json /opt/selenium_grid_extras/; sudo chown selenium:selenium /opt/selenium_grid_extras/node_5555.json; sudo chmod 644 /opt/selenium_grid_extras/node_5555.json; sudo systemctl restart selenium-grid-extras-node"
$SCP $node_config "$2:node_5555.json"
$SSH $2 "sudo mv node_5555.json /opt/selenium_grid_extras/ && sudo chown selenium:selenium /opt/selenium_grid_extras/node_5555.json && sudo chmod 644 /opt/selenium_grid_extras/node_5555.json && sudo systemctl restart selenium-grid-extras-node"
rm $node_config_orig $node_config
}

Expand Down