annotate master/bin/internal/vmss_setup.sh @ 15:68cca895e872

make a local bin directory for each worker
author Henry S. Thompson <ht@markup.co.uk>
date Thu, 18 Oct 2018 17:01:34 +0000
parents a7637c994964
children c3e9ad8a42cf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 #!/bin/bash
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 set -e
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
3 #Arguments are instance port host --resource-group $resource --name $name
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
4 instance=$1
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
5 port=$2
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6 host=$3
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7 shift 3
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
8 #Accept host keys :-(
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 if ! ssh-keyscan -p $port $host >>~/.ssh/known_hosts 2>/dev/null; then
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
10 echo $host:$port does not seem to be up, might be overprovisioned 1>&2
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
11 exit 1
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
12 fi
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
13 #Copy azure credentials over and make delete/deallocate commands
15
68cca895e872 make a local bin directory for each worker
Henry S. Thompson <ht@markup.co.uk>
parents: 7
diff changeset
14 (echo $@ --instance-ids $instance; cd ~; tar c .azure) |ssh -o ConnectTimeout=5 -p $port $host 'read a; mkdir bin; echo -e '\''#!/bin/bash\n'\''az vmss deallocate $a >deallocate && echo -e '\''#!/bin/bash\n'\''az vmss delete-instances $a >delete && chmod +x deallocate delete && tar x && sudo mv deallocate delete /bin'
7
a7637c994964 cull_network.py, parse_load_balance.py, vmss_setup.sh x 2, vmss_create.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
15 echo ssh -p $port $host " #id $instance"