Add managed Lab 3 browser terminal deployment

This commit is contained in:
c4ch3c4d3
2026-04-13 16:40:14 -06:00
parent 30b919c0b9
commit cbf6c3fad3
12 changed files with 361 additions and 2 deletions
+19 -1
View File
@@ -17,9 +17,15 @@ load_runtime_env() {
: "${COURSEWARE_URL_HOST:=127.0.0.1}"
: "${COURSEWARE_PROMPTFOO_PORT:=15500}"
: "${COURSEWARE_WIKI_PORT:=80}"
: "${COURSEWARE_WETTY_PORT:=7681}"
: "${COURSEWARE_WETTY_BASE_PATH:=/wetty}"
: "${COURSEWARE_STUDENT_USERNAME:=student}"
: "${COURSEWARE_LAB3_DIR:=/home/student/lab3}"
: "${NODE_RUNTIME_BIN_DIR:=$COURSEWARE_STATE_DIR/tools/node-runtime/node_modules/node/bin}"
: "${WETTY_BIN:=$COURSEWARE_STATE_DIR/tools/wetty/node_modules/.bin/wetty}"
: "${PROMPTFOO_DIR:=$COURSEWARE_STATE_DIR/lab6}"
: "${WIKI_DIR:=$COURSEWARE_STATE_DIR/repos/LLM-Labs}"
: "${WIKI_RUNTIME_CONFIG_PATH:=$WIKI_DIR/public/courseware-runtime.json}"
: "${LLAMA_CPP_BIN_DIR:=$COURSEWARE_STATE_DIR/repos/llama.cpp/build/bin}"
if [ -n "${OLLAMA_BIN:-}" ] && [[ "$OLLAMA_BIN" != */* ]] && command -v "$OLLAMA_BIN" >/dev/null 2>&1; then
@@ -43,7 +49,8 @@ service_list() {
"embedding-atlas" \
"unsloth" \
"promptfoo" \
"wiki"
"wiki" \
"wetty"
}
service_pid_file() {
@@ -64,6 +71,7 @@ service_port() {
unsloth) printf '%s\n' "${COURSEWARE_UNSLOTH_PORT}" ;;
promptfoo) printf '%s\n' "${COURSEWARE_PROMPTFOO_PORT}" ;;
wiki) printf '%s\n' "${COURSEWARE_WIKI_PORT}" ;;
wetty) printf '%s\n' "${COURSEWARE_WETTY_PORT}" ;;
*) return 1 ;;
esac
}
@@ -78,6 +86,7 @@ service_url() {
unsloth) printf 'http://%s:%s\n' "$COURSEWARE_URL_HOST" "$COURSEWARE_UNSLOTH_PORT" ;;
promptfoo) printf 'http://%s:%s\n' "$COURSEWARE_URL_HOST" "$COURSEWARE_PROMPTFOO_PORT" ;;
wiki) printf 'http://%s:%s\n' "$COURSEWARE_URL_HOST" "$COURSEWARE_WIKI_PORT" ;;
wetty) printf 'http://%s:%s%s\n' "$COURSEWARE_URL_HOST" "$COURSEWARE_WETTY_PORT" "$COURSEWARE_WETTY_BASE_PATH" ;;
*) return 1 ;;
esac
}
@@ -144,6 +153,15 @@ service_command() {
"$COURSEWARE_BIND_HOST" \
"$COURSEWARE_WIKI_PORT"
;;
wetty)
printf 'cd "%s" && PATH="%s:$PATH" exec "%s" --host %s --port %s --base %s --allow-iframe --ssh-host 127.0.0.1 --ssh-port 22 --ssh-auth password' \
"$COURSEWARE_ROOT" \
"$NODE_RUNTIME_BIN_DIR" \
"$WETTY_BIN" \
"$COURSEWARE_BIND_HOST" \
"$COURSEWARE_WETTY_PORT" \
"$COURSEWARE_WETTY_BASE_PATH"
;;
*)
return 1
;;