Update ARC versions

This commit is contained in:
Corneil du Plessis
2023-01-16 13:52:30 +02:00
parent c47eb0028e
commit 44f7bed5c8
11 changed files with 101 additions and 43 deletions

View File

@@ -76,26 +76,26 @@ case $ARCH in
;;
esac
# the specific template
cp $SCDIR/k8s/runners-stream-ci-${SCALING}-template.yaml runners-stream-ci-change.yaml
cp $SCDIR/k8s/runners-stream-ci-${SCALING}-template.yaml runners-stream-ci.yaml
IMAGE_SHA=$(wget -q -O- https://hub.docker.com/v2/repositories/summerwind/actions-runner/tags | jq --arg os $OS --arg arch $ARCH '.results | map(select(.name="latest")) | .[0].images | map(select(.os==$os and .architecture==$arch)) | .[0].digest' | sed 's/\"//g')
if [ "$IMAGE_SHA" == "" ]; then
IMAGE_SHA="latest"
ARC_RUNNER_VER=$($SCDIR/determine-default.sh stream-apps-gh-runners "actions_runner_version")
if [ "$ARC_RUNNER_VER" == "" ]; then
ARC_RUNNER_VER=latest
fi
sed -i 's/tag-placeholder/'"$IMAGE_SHA"'/g' runners-stream-ci-change.yaml
sed -i 's/tag-placeholder/'"$ARC_RUNNER_VER"'/g' runners-stream-ci.yaml
if [ "$SCALING" == "auto" ]; then
MAX_RUNNERS=$((MAX_RUNNERS - DEC))
echo "Runners: changing scaling min: $MIN_RUNNERS, max: $MAX_RUNNERS"
sed -i 's/max-replicas-placeholder/'"$MAX_RUNNERS"'/g' runners-stream-ci-change.yaml
sed -i 's/min-replicas-placeholder/'"$MIN_RUNNERS"'/g' runners-stream-ci-change.yaml
sed -i 's/max-replicas-placeholder/'"$MAX_RUNNERS"'/g' runners-stream-ci.yaml
sed -i 's/min-replicas-placeholder/'"$MIN_RUNNERS"'/g' runners-stream-ci.yaml
else
echo "Runners:$CURRENT decrease by $DEC to $TARGET"
sed -i 's/replicas-placeholder/'"$TARGET"'/g' runners-stream-ci-change.yaml
sed -i 's/replicas-placeholder/'"$TARGET"'/g' runners-stream-ci.yaml
fi
cmp --silent "$SCDIR/k8s/runners-stream-ci-${SCALING}-template.yaml" runners-stream-ci-change.yaml
cmp --silent "$SCDIR/k8s/runners-stream-ci-${SCALING}-template.yaml" runners-stream-ci.yaml
RC=$?
if ((RC != 0)); then
kubectl apply -f runners-stream-ci-change.yaml
kubectl apply -f runners-stream-ci.yaml
echo "Runners: changed to $RUNNERS"
if [ "$SCALING" != "auto" ]; then
$SCDIR/wait-k8s.sh 1 --for=condition=ready --timeout=1m pod -l runner-deployment-name=runners-stream-ci --all-namespaces=true
@@ -103,5 +103,5 @@ if ((RC != 0)); then
else
echo "Runners: unchanged"
fi
rm -f runners-stream-ci-change.yaml
rm -f runners-stream-ci.yaml
$SCDIR/check-runners.sh