@@ -113,9 +113,14 @@ create_uesr_data () {
113113 # ENCODED_USER_DATA=$(echo "$USER_DATA" | base64 | tr -d \\n)
114114 cat << EOF > user_data.sh
115115#!/bin/bash
116+ export RUNNER_LABEL="${INSTANCE_TYPE} "
116117if command -v yum &> /dev/null; then
118+ # add rhel to the label
119+ export RUNNER_LABEL="rhel,${INSTANCE_TYPE} "
117120 yum install -y curl jq libicu
118121else
122+ # add ubuntu to the label
123+ export RUNNER_LABEL="ubuntu,${INSTANCE_TYPE} "
119124 apt-get update
120125 apt-get install -y curl jq
121126fi
@@ -135,7 +140,7 @@ tar xzf ./actions-runner-linux-x64-2.311.0.tar.gz
135140# Create the runner and start the configuration experience
136141# there is a bug in the github instruction. The config script does not work with sudo unless we set RUNNER_ALLOW_RUNASROOT=true
137142export RUNNER_ALLOW_RUNASROOT=true
138- ./config.sh --replace --unattended --name ${RUNNER_NAME} --url "https://github.com/${GITHUB_REPO} " --token ${RUNNER_TOKEN}
143+ ./config.sh --replace --unattended --name ${RUNNER_NAME} --url "https://github.com/${GITHUB_REPO} " --token ${RUNNER_TOKEN} --labels " \$ {RUNNER_LABEL}"
139144# Last step, run it!
140145./run.sh
141146EOF
@@ -216,9 +221,9 @@ create_runner () {
216221 # then we extract the minimum required price and use that as the new bid price
217222 if [[ " $INSTANCE_JSON " == * " SpotMaxPriceTooLow" * ]]; then
218223 debug " SpotMaxPriceTooLow error, extracting minimum required price"
219- MIN_PRICE=$( echo -n " $INSTANCE_JSON " | awk ' {print $NF}' | head -c -2)
224+ MIN_PRICE=$( echo -n " $INSTANCE_JSON " | awk ' {print $NF}' | head -c -2 | tr -d ' \r ' )
220225 debug " Minimum required price: ${MIN_PRICE} "
221- # BID_PRICE=$(echo "$MIN_PRICE * 1.1 " | bc)
226+ BID_PRICE=$( echo " $MIN_PRICE * 1.01 " | bc)
222227 BID_PRICE=$MIN_PRICE
223228 continue
224229 else
0 commit comments