mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-29 19:12:03 +00:00
Merge pull request #32043 from ClickHouse/better_worker_scripts
Better scripts for runners
This commit is contained in:
commit
e80ff2c0c5
@ -1,20 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -uo pipefail
|
||||
|
||||
echo "Running init script"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export RUNNER_HOME=/home/ubuntu/actions-runner
|
||||
|
||||
echo "Receiving token"
|
||||
export RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
export RUNNER_URL="https://github.com/ClickHouse"
|
||||
# Funny fact, but metadata service has fixed IP
|
||||
export INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
||||
|
||||
while true; do
|
||||
runner_pid=`pgrep run.sh`
|
||||
echo "Got runner pid $runner_pid"
|
||||
|
||||
cd $RUNNER_HOME
|
||||
if [ -z "$runner_pid" ]; then
|
||||
echo "Receiving token"
|
||||
RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
|
||||
echo "Will try to remove runner"
|
||||
sudo -u ubuntu ./config.sh remove --token $RUNNER_TOKEN ||:
|
||||
|
||||
echo "Going to configure runner"
|
||||
sudo -u ubuntu ./config.sh --url $RUNNER_URL --token $RUNNER_TOKEN --name $INSTANCE_ID --runnergroup Default --labels 'self-hosted,Linux,X64,builder' --work _work
|
||||
|
||||
echo "Run"
|
||||
sudo -u ubuntu ./run.sh
|
||||
sudo -u ubuntu ./run.sh &
|
||||
sleep 15
|
||||
else
|
||||
echo "Runner is working with pid $runner_pid, nothing to do"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
@ -1,20 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -uo pipefail
|
||||
|
||||
echo "Running init script"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export RUNNER_HOME=/home/ubuntu/actions-runner
|
||||
|
||||
echo "Receiving token"
|
||||
export RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
export RUNNER_URL="https://github.com/ClickHouse"
|
||||
# Funny fact, but metadata service has fixed IP
|
||||
export INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
||||
|
||||
while true; do
|
||||
runner_pid=`pgrep run.sh`
|
||||
echo "Got runner pid $runner_pid"
|
||||
|
||||
cd $RUNNER_HOME
|
||||
if [ -z "$runner_pid" ]; then
|
||||
echo "Receiving token"
|
||||
RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
|
||||
echo "Will try to remove runner"
|
||||
sudo -u ubuntu ./config.sh remove --token $RUNNER_TOKEN ||:
|
||||
|
||||
echo "Going to configure runner"
|
||||
sudo -u ubuntu ./config.sh --url $RUNNER_URL --token $RUNNER_TOKEN --name $INSTANCE_ID --runnergroup Default --labels 'self-hosted,Linux,X64,func-tester' --work _work
|
||||
|
||||
echo "Run"
|
||||
sudo -u ubuntu ./run.sh
|
||||
sudo -u ubuntu ./run.sh &
|
||||
sleep 15
|
||||
else
|
||||
echo "Runner is working with pid $runner_pid, nothing to do"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
@ -1,20 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
set -uo pipefail
|
||||
|
||||
echo "Running init script"
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
export RUNNER_HOME=/home/ubuntu/actions-runner
|
||||
|
||||
echo "Receiving token"
|
||||
export RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
export RUNNER_URL="https://github.com/ClickHouse"
|
||||
# Funny fact, but metadata service has fixed IP
|
||||
export INSTANCE_ID=`curl -s http://169.254.169.254/latest/meta-data/instance-id`
|
||||
|
||||
while true; do
|
||||
runner_pid=`pgrep run.sh`
|
||||
echo "Got runner pid $runner_pid"
|
||||
|
||||
cd $RUNNER_HOME
|
||||
if [ -z "$runner_pid" ]; then
|
||||
echo "Receiving token"
|
||||
RUNNER_TOKEN=`/usr/local/bin/aws ssm get-parameter --name github_runner_registration_token --with-decryption --output text --query Parameter.Value`
|
||||
|
||||
echo "Will try to remove runner"
|
||||
sudo -u ubuntu ./config.sh remove --token $RUNNER_TOKEN ||:
|
||||
|
||||
echo "Going to configure runner"
|
||||
sudo -u ubuntu ./config.sh --url $RUNNER_URL --token $RUNNER_TOKEN --name $INSTANCE_ID --runnergroup Default --labels 'self-hosted,Linux,X64,stress-tester' --work _work
|
||||
|
||||
echo "Run"
|
||||
sudo -u ubuntu ./run.sh
|
||||
sudo -u ubuntu ./run.sh &
|
||||
sleep 15
|
||||
else
|
||||
echo "Runner is working with pid $runner_pid, nothing to do"
|
||||
sleep 10
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user