mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-04 10:09:42 +00:00
b5938: Rework sym links for hudson instance setup
This commit is contained in:
1 parent
61284318e4
commit
591316191b
8 files changed
+69
-66
No files matched your search
@@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
imageType="$1"
|
||||
aws ec2 describe-images --filter Name=tag:image-type,Values=${imageType} | jq --raw-output '.Images | sort_by(.CreationDate) | .[].ImageId' | tail -n 1
|
||||
@@ -0,0 +1 @@
|
||||
../environments_scripts/build_server/files/usr/local/bin/getLatestImageOfType.sh
|
||||
File renamed without changes.
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
imageType="$1"
|
||||
aws ec2 describe-images --filter Name=tag:image-type,Values=${imageType} | jq --raw-output '.Images | sort_by(.CreationDate) | .[].ImageId' | tail -n 1
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Enable sudo for user hudson for this script by adding the following to /etc/sudoers.d/hudsoncanlaunchec2instances:
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
AWS=/bin/aws
|
||||
REGION=eu-west-1
|
||||
HUDSON_SLAVE_AMI_ID=$( /usr/local/bin/getLatestImageOfType.sh hudson-slave )
|
||||
echo Launching instance from AMI ${HUDSON_SLAVE_AMI_ID} ...
|
||||
instanceid=`$AWS ec2 run-instances --image-id $HUDSON_SLAVE_AMI_ID --count 1 --instance-type c5d.4xlarge --key-name Axel --security-groups "Sailing Analytics App" --region $REGION --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=Hudson Build Instance}]' --instance-initiated-shutdown-behavior terminate | tee /tmp/slavelaunch.out | jq .Instances[0].InstanceId | sed -e 's/"//g'`
|
||||
if [ "$instanceid" = "" ]; then
|
||||
echo Error launching instance
|
||||
exit 1
|
||||
else
|
||||
echo Instance ID is $instanceid
|
||||
while [ "`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].State.Name`" != "\"running\"" ]; do
|
||||
echo Instance $instanceid not running yet\; trying again...
|
||||
sleep 5
|
||||
done
|
||||
echo Instance $instanceid seems running now
|
||||
private_ip=`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].PrivateIpAddress | sed -e 's/"//g'`
|
||||
echo Probing for SSH on private IP $private_ip
|
||||
# Note: it's important to redirect stdin/stdout from/to /dev/null to ensure the Hudon master can properly connect stdin/stdout to the slave later
|
||||
while ! su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip mkdir -p /home/hudson/workspace/___test___\; rmdir /home/hudson/workspace/___test___ </dev/null >/dev/null 2>/dev/null"; do
|
||||
echo SSH daemon not reachable yet. Trying again in a few seconds...
|
||||
sleep 10
|
||||
done
|
||||
echo SSH daemon reached. State should be ready to connect to now.
|
||||
su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip \"/opt/sapjvm_8/bin/java -jar slave.jar; sudo /sbin/shutdown -h now\""
|
||||
$AWS ec2 terminate-instances --instance-ids $instanceid
|
||||
fi
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
# Enable sudo for user hudson for this script by adding the following to /etc/sudoers.d/hudsoncanlaunchec2instances:
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
AWS=/usr/bin/aws
|
||||
REGION=eu-west-1
|
||||
HUDSON_SLAVE_AMI_ID=$( /usr/local/bin/getLatestImageOfType.sh hudson-slave-11 )
|
||||
echo Launching instance from AMI ${HUDSON_SLAVE_AMI_ID} ...
|
||||
instanceid=`$AWS ec2 run-instances --image-id $HUDSON_SLAVE_AMI_ID --count 1 --instance-type c5d.4xlarge --key-name Axel --security-groups "Sailing Analytics App" --region $REGION --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=Hudson Ubuntu Slave Java 11}]' --instance-initiated-shutdown-behavior terminate | tee /tmp/slavelaunch.out | jq .Instances[0].InstanceId | sed -e 's/"//g'`
|
||||
if [ "$instanceid" = "" ]; then
|
||||
echo Error launching instance
|
||||
exit 1
|
||||
else
|
||||
echo Instance ID is $instanceid
|
||||
while [ "`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].State.Name`" != "\"running\"" ]; do
|
||||
echo Instance $instanceid not running yet\; trying again...
|
||||
sleep 5
|
||||
done
|
||||
echo Instance $instanceid seems running now
|
||||
private_ip=`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].PrivateIpAddress | sed -e 's/"//g'`
|
||||
echo Probing for SSH on private IP $private_ip
|
||||
# Note: it's important to redirect stdin/stdout from/to /dev/null to ensure the Hudon master can properly connect stdin/stdout to the slave later
|
||||
while ! su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip mkdir -p /home/hudson/workspace/___test___\; rmdir /home/hudson/workspace/___test___ </dev/null >/dev/null 2>/dev/null"; do
|
||||
echo SSH daemon not reachable yet. Trying again in a few seconds...
|
||||
sleep 10
|
||||
done
|
||||
echo SSH daemon reached. State should be ready to connect to now.
|
||||
su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip \"/opt/sapjvm_8/bin/java -jar slave.jar; sudo /sbin/shutdown -h now\""
|
||||
$AWS ec2 terminate-instances --instance-ids $instanceid
|
||||
fi
|
||||
@@ -1 +1 @@
|
||||
../environments_scripts/build_server/files/etc/hudson
|
||||
../environments_scripts/build_server/files/etc/sysconfig/hudson
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Enable sudo for user hudson for this script by adding the following to /etc/sudoers.d/hudsoncanlaunchec2instances:
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
AWS=/bin/aws
|
||||
REGION=eu-west-1
|
||||
HUDSON_SLAVE_AMI_ID=$( /usr/local/bin/getLatestImageOfType.sh hudson-slave )
|
||||
echo Launching instance from AMI ${HUDSON_SLAVE_AMI_ID} ...
|
||||
instanceid=`$AWS ec2 run-instances --image-id $HUDSON_SLAVE_AMI_ID --count 1 --instance-type c5d.4xlarge --key-name Axel --security-groups "Sailing Analytics App" --region $REGION --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=Hudson Build Instance}]' --instance-initiated-shutdown-behavior terminate | tee /tmp/slavelaunch.out | jq .Instances[0].InstanceId | sed -e 's/"//g'`
|
||||
if [ "$instanceid" = "" ]; then
|
||||
echo Error launching instance
|
||||
exit 1
|
||||
else
|
||||
echo Instance ID is $instanceid
|
||||
while [ "`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].State.Name`" != "\"running\"" ]; do
|
||||
echo Instance $instanceid not running yet\; trying again...
|
||||
sleep 5
|
||||
done
|
||||
echo Instance $instanceid seems running now
|
||||
private_ip=`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].PrivateIpAddress | sed -e 's/"//g'`
|
||||
echo Probing for SSH on private IP $private_ip
|
||||
# Note: it's important to redirect stdin/stdout from/to /dev/null to ensure the Hudon master can properly connect stdin/stdout to the slave later
|
||||
while ! su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip mkdir -p /home/hudson/workspace/___test___\; rmdir /home/hudson/workspace/___test___ </dev/null >/dev/null 2>/dev/null"; do
|
||||
echo SSH daemon not reachable yet. Trying again in a few seconds...
|
||||
sleep 10
|
||||
done
|
||||
echo SSH daemon reached. State should be ready to connect to now.
|
||||
su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip \"/opt/sapjvm_8/bin/java -jar slave.jar; sudo /sbin/shutdown -h now\""
|
||||
$AWS ec2 terminate-instances --instance-ids $instanceid
|
||||
fi
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
environments_scripts/build_server/files/usr/local/bin/launchhudsonslave
|
||||
@@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Enable sudo for user hudson for this script by adding the following to /etc/sudoers.d/hudsoncanlaunchec2instances:
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/launchhudsonslave-java11
|
||||
# hudson ALL = (root) NOPASSWD: /usr/local/bin/getLatestImageOfType.sh
|
||||
AWS=/usr/bin/aws
|
||||
REGION=eu-west-1
|
||||
HUDSON_SLAVE_AMI_ID=$( /usr/local/bin/getLatestImageOfType.sh hudson-slave-11 )
|
||||
echo Launching instance from AMI ${HUDSON_SLAVE_AMI_ID} ...
|
||||
instanceid=`$AWS ec2 run-instances --image-id $HUDSON_SLAVE_AMI_ID --count 1 --instance-type c5d.4xlarge --key-name Axel --security-groups "Sailing Analytics App" --region $REGION --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=Hudson Ubuntu Slave Java 11}]' --instance-initiated-shutdown-behavior terminate | tee /tmp/slavelaunch.out | jq .Instances[0].InstanceId | sed -e 's/"//g'`
|
||||
if [ "$instanceid" = "" ]; then
|
||||
echo Error launching instance
|
||||
exit 1
|
||||
else
|
||||
echo Instance ID is $instanceid
|
||||
while [ "`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].State.Name`" != "\"running\"" ]; do
|
||||
echo Instance $instanceid not running yet\; trying again...
|
||||
sleep 5
|
||||
done
|
||||
echo Instance $instanceid seems running now
|
||||
private_ip=`$AWS ec2 describe-instances --region $REGION --instance-ids $instanceid | jq .Reservations[0].Instances[0].PrivateIpAddress | sed -e 's/"//g'`
|
||||
echo Probing for SSH on private IP $private_ip
|
||||
# Note: it's important to redirect stdin/stdout from/to /dev/null to ensure the Hudon master can properly connect stdin/stdout to the slave later
|
||||
while ! su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip mkdir -p /home/hudson/workspace/___test___\; rmdir /home/hudson/workspace/___test___ </dev/null >/dev/null 2>/dev/null"; do
|
||||
echo SSH daemon not reachable yet. Trying again in a few seconds...
|
||||
sleep 10
|
||||
done
|
||||
echo SSH daemon reached. State should be ready to connect to now.
|
||||
su - hudson -c "ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no hudson@$private_ip \"/opt/sapjvm_8/bin/java -jar slave.jar; sudo /sbin/shutdown -h now\""
|
||||
$AWS ec2 terminate-instances --instance-ids $instanceid
|
||||
fi
|
||||
+1
@@ -0,0 +1 @@
|
||||
environments_scripts/build_server/files/usr/local/bin/launchhudsonslave-java11
|
||||
Reference in new issue
Block a user