Skip to content

Commit

Permalink
updates scripts to add UI image
Browse files Browse the repository at this point in the history
Signed-off-by: bharathappali <abharath@redhat.com>
  • Loading branch information
bharathappali committed Aug 10, 2023
1 parent cb52066 commit 102545c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
10 changes: 10 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,16 @@ KRUIZE_CRC_DEPLOY_MANIFEST_MINIKUBE="${CRC_DIR}/minikube/kruize-crc-minikube.yam

AUTOTUNE_PORT="8080"
AUTOTUNE_DOCKER_REPO="docker.io/kruize/autotune_operator"

#Fetch autotune version from the pom.xml file.
AUTOTUNE_VERSION="$(grep -A 1 "autotune" "${ROOT_DIR}"/pom.xml | grep version | awk -F '>' '{ split($2, a, "<"); print a[1] }')"
AUTOTUNE_DOCKER_IMAGE=${AUTOTUNE_DOCKER_REPO}:${AUTOTUNE_VERSION}

# Kruize UI repo
KRUIZE_UI_REPO="quay.io/kruize/kruize-ui"
KRUIZE_UI_VERSION="$(curl -s https://raw.githubusercontent.com/kruize/kruize-ui/main/package.json | grep -m1 '\"version\"' | tr -d ' ' | cut -d: -f2 | tr -d \" | sed 's/,$//')"
KRUIZE_UI_DOCKER_IMAGE=${KRUIZE_UI_REPO}:${KRUIZE_UI_VERSION}

HPO_DOCKER_REPO="docker.io/kruize/hpo"
# From the kruize/hpo repo
HPO_VERSION=0.0.2
Expand Down Expand Up @@ -161,6 +168,9 @@ do
t)
setup=0
;;
u)
KRUIZE_UI_DOCKER_IMAGE="${OPTARG}"
;;
[?])
usage
esac
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
image: quay.io/kruize/kruize-ui:test
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
image: quay.io/kruize/kruize-ui:test
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
image: quay.io/kruize/kruize-ui:test
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ metadata:
spec:
containers:
- name: kruize-ui-nginx-container
image: docker.io/bharathappali/kruize-ui:central-config
image: quay.io/kruize/kruize-ui:test
imagePullPolicy: Always
env:
- name: KRUIZE_UI_ENV
Expand Down
7 changes: 5 additions & 2 deletions scripts/common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,17 @@ kruize_crc_start() {
CRC_MANIFEST_FILE_OLD="/tmp/kruize.yaml"

cp ${CRC_MANIFEST_FILE} ${CRC_MANIFEST_FILE_OLD}
awk -v image_name=${AUTOTUNE_DOCKER_IMAGE} '{
awk -v image_name=${AUTOTUNE_DOCKER_IMAGE} -v ui_image_name=${KRUIZE_UI_DOCKER_IMAGE} '{
if ($2=="name:") {
prev=$3;
print
} else if ($1=="image:" && prev=="kruize") {
$2=image_name;
printf" %s %s\n", $1, $2;
} else { print }
} else if ($1=="image:" && prev=="kruize-ui-nginx-container") {
$2=ui_image_name;
printf" %s %s\n", $1, $2;
} else { print }
}' ${CRC_MANIFEST_FILE_OLD} > ${CRC_MANIFEST_FILE}
${kubectl_cmd} apply -f ${CRC_MANIFEST_FILE}
check_running kruize ${autotune_ns} kruize-ui
Expand Down

0 comments on commit 102545c

Please sign in to comment.