45 lines
1.2 KiB
Bash
45 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
# Helpers to delegate server lifecycle and argument rendering to
|
|
# `python -m sskj.deploy`. The deployment profile is the single source of
|
|
# engine launch args; experiment scripts should call these helpers instead of
|
|
# maintaining their own copies.
|
|
|
|
DEPLOY_PYTHON="${PYTHON:-python3}"
|
|
|
|
deploy_profile_abs() {
|
|
local profile="$1"
|
|
printf '%s' "${ROOT_DIR}/deploy/profiles/${profile}.env"
|
|
}
|
|
|
|
deploy_start() {
|
|
local profile="$1"
|
|
local tp="$2"
|
|
local dp="$3"
|
|
local log_dir="$4"
|
|
local port="$5"
|
|
local model_path="$6"
|
|
local container="$7"
|
|
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy start \
|
|
--profile "$(deploy_profile_abs "$profile")" \
|
|
--tp "$tp" \
|
|
--dp "$dp" \
|
|
--log-dir "$log_dir" \
|
|
--port "$port" \
|
|
--model-path "$model_path" \
|
|
--container-name "$container"
|
|
}
|
|
|
|
deploy_render_args() {
|
|
local profile="$1"
|
|
local tp="$2"
|
|
local dp="$3"
|
|
local port="$4"
|
|
local model_path="$5"
|
|
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy render-args \
|
|
--profile "$(deploy_profile_abs "$profile")" \
|
|
--tp "$tp" \
|
|
--dp "$dp" \
|
|
--port "$port" \
|
|
--model-path "$model_path"
|
|
}
|