Skip to content

Commit

Permalink
optimize ai gateway script (higress-group#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnlanni authored Dec 26, 2024
1 parent 316b611 commit aeea245
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions all-in-one/get-ai-gateway.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ if [ "${HAS_DOCKER}" != "true" ]; then
exit 1
fi

DEFAULT_CONTAINER_NAME=higress
DEFAULT_CONTAINER_NAME=higress-ai-gateway
DEFAULT_IMAGE_REPO=higress-registry.cn-hangzhou.cr.aliyuncs.com/higress/all-in-one
DFEAULT_IMAGE_TAG=latest
DEFAULT_IMAGE_TAG=latest
DEFAULT_GATEWAY_HTTP_PORT=8080
DEFAULT_GATEWAY_HTTPS_PORT=8443
DEFAULT_CONSOLE_PORT=8001
Expand Down Expand Up @@ -124,14 +124,14 @@ configure() {

resetEnv() {
DATA_FOLDER="$ROOT"
CONTAINER_NAME="$DEFAULT_CONTAINER_NAME"
CONTAINER_NAME="${CONTAINER_NAME:-$DEFAULT_CONTAINER_NAME}"

IMAGE_REPO="$DEFAULT_IMAGE_REPO"
IMAGE_TAG="$DFEAULT_IMAGE_TAG"
IMAGE_REPO="${IMAGE_REPO:-$DEFAULT_IMAGE_REPO}"
IMAGE_TAG="${IMAGE_TAG:-$DEFAULT_IMAGE_TAG}"

GATEWAY_HTTP_PORT="$DEFAULT_GATEWAY_HTTP_PORT"
GATEWAY_HTTPS_PORT="$DEFAULT_GATEWAY_HTTPS_PORT"
CONSOLE_PORT="$DEFAULT_CONSOLE_PORT"
GATEWAY_HTTP_PORT="${GATEWAY_HTTP_PORT:-$DEFAULT_GATEWAY_HTTP_PORT}"
GATEWAY_HTTPS_PORT="${GATEWAY_HTTPS_PORT:-$DEFAULT_GATEWAY_HTTPS_PORT}"
CONSOLE_PORT="${CONSOLE_PORT:-$DEFAULT_CONSOLE_PORT}"

LLM_ENVS=()
}
Expand Down Expand Up @@ -422,9 +422,9 @@ start() {
NORMALIZED_CONFIG_FILE_PATH="$(normalizePath "${DATA_FOLDER}/${CONFIG_FILENAME}")"

$DOCKER_COMMAND run --name "${CONTAINER_NAME}" -d \
-p 127.0.0.1:$GATEWAY_HTTP_PORT:8080 \
-p 127.0.0.1:$GATEWAY_HTTPS_PORT:8443 \
-p 127.0.0.1:$CONSOLE_PORT:8001 \
-p 127.0.0.1:$GATEWAY_HTTP_PORT:$GATEWAY_HTTP_PORT \
-p 127.0.0.1:$GATEWAY_HTTPS_PORT:$GATEWAY_HTTPS_PORT \
-p 127.0.0.1:$CONSOLE_PORT:$CONSOLE_PORT \
--restart=always \
--env-file "$NORMALIZED_CONFIG_FILE_PATH" \
--mount "type=bind,source=$NORMALIZED_DATA_FOLDER_PATH,target=/data" "$IMAGE_REPO:$IMAGE_TAG" >/dev/null
Expand Down

0 comments on commit aeea245

Please sign in to comment.