Skip to content

Commit 268b19f

Browse files
committed
Verify operator and image versions match first in run.sh (#1183)
(cherry picked from commit 13adb37)
1 parent f99eeda commit 268b19f

File tree

1 file changed

+12
-12
lines changed
  • pkg/workloads/cortex/serve

1 file changed

+12
-12
lines changed

pkg/workloads/cortex/serve/run.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616

1717
set -e
1818

19+
# CORTEX_VERSION x1
20+
export EXPECTED_CORTEX_VERSION=0.18.1
21+
22+
if [ "$CORTEX_VERSION" != "$EXPECTED_CORTEX_VERSION" ]; then
23+
if [ "$CORTEX_PROVIDER" == "local" ]; then
24+
echo "your Cortex CLI version ($CORTEX_VERSION) doesn't match your predictor image version ($EXPECTED_CORTEX_VERSION); please update your predictor image by modifying the \`image\` field in your API configuration file (e.g. cortex.yaml) and re-running \`cortex deploy\`, or update your CLI by following the instructions at https://docs.cortex.dev/cluster-management/update#upgrading-to-a-newer-version-of-cortex"
25+
else
26+
echo "your Cortex operator version ($CORTEX_VERSION) doesn't match your predictor image version ($EXPECTED_CORTEX_VERSION); please update your predictor image by modifying the \`image\` field in your API configuration file (e.g. cortex.yaml) and re-running \`cortex deploy\`, or update your cluster by following the instructions at https://docs.cortex.dev/cluster-management/update#upgrading-to-a-newer-version-of-cortex"
27+
fi
28+
exit 1
29+
fi
30+
1931
mkdir -p /mnt/workspace
2032
mkdir -p /mnt/requests
2133

@@ -66,18 +78,6 @@ if [ -f "/mnt/project/conda-packages.txt" ]; then
6678
fi
6779
fi
6880

69-
# CORTEX_VERSION x1
70-
export EXPECTED_CORTEX_VERSION=0.18.1
71-
72-
if [ "$CORTEX_VERSION" != "$EXPECTED_CORTEX_VERSION" ]; then
73-
if [ "$CORTEX_PROVIDER" == "local" ]; then
74-
echo "your Cortex CLI version ($CORTEX_VERSION) doesn't match your predictor image version ($EXPECTED_CORTEX_VERSION); please update your predictor image by modifying the \`image\` field in your API configuration file (e.g. cortex.yaml) and re-running \`cortex deploy\`, or update your CLI by following the instructions at https://docs.cortex.dev/cluster-management/update#upgrading-to-a-newer-version-of-cortex"
75-
else
76-
echo "your Cortex operator version ($CORTEX_VERSION) doesn't match your predictor image version ($EXPECTED_CORTEX_VERSION); please update your predictor image by modifying the \`image\` field in your API configuration file (e.g. cortex.yaml) and re-running \`cortex deploy\`, or update your cluster by following the instructions at https://docs.cortex.dev/cluster-management/update#upgrading-to-a-newer-version-of-cortex"
77-
fi
78-
exit 1
79-
fi
80-
8181
# install pip packages
8282
if [ -f "/mnt/project/requirements.txt" ]; then
8383
pip --no-cache-dir install -r /mnt/project/requirements.txt

0 commit comments

Comments
 (0)