fix(install): make setup failures explicit and atomic

Installer pipelines masked dependency and download failures, causing
false success messages and unsafe config replacement.

Atomic updates and current upstream installers keep failures visible.
This commit is contained in:
Frank Qing
2026-07-15 00:16:33 +08:00
parent 9641876d43
commit 76395923ce
14 changed files with 350 additions and 432 deletions
+7 -20
View File
@@ -65,26 +65,6 @@ export PYSPARK_DRIVER_PYTHON="${PYSPARK_DRIVER_PYTHON:-/usr/bin/python3}"
# 默认 local[2],和原 mlxrc 保持一致
export PYSPARK_SUBMIT_ARGS="${PYSPARK_SUBMIT_ARGS:---master local[2] pyspark-shell}"
# MLXLAB devbox code disk 标记(如果启动脚本已经设置,就不要覆盖)
if [[ -n "${MLXLAB_DEVBOX_CODE_DISK}" ]]; then
export MLXLAB_DEVBOX_CODE_DISK=''
fi
# MLX / Merlin 相关变量(假设在容器启动时已经由 start_devbox.sh 导出)
# 这里统一再 export 一遍,保证交互 shell 也能继承
export MLX_USER_TOKEN='bd2a3f1b71d54ab497f13f2eefc4f5bc'
export MLX_USER='qingyuhao'
export MLX_IMAGE_VID='d51qjdbc77u9kebl603g'
export MLX_IMAGE_URL='hub.byted.org/reckon/data.reckon.mlx.image_10786:4aa09c59c9cbb1fcde50526696177c84'
export MLX_ENGINE_SID='bgi0zldy6943b7db'
export MLX_DEVBOX_ID='132783'
export MLX_HOST_URL='https://ml.bytedance.net/'
export MERLIN_HOST_URL='https://ml.bytedance.net'
export TCC_CDN_HOST='//lf6-config.bytetcc.com/obj/tcc-config-web'
export ZTI_ENV='cn'
export IS_SEED='true'
export MLXLAB_DEVBOX_CODE_DISK=''
# DOAS_ZONE(从 BYTE_REGION 推导)
if [[ "${BYTE_REGION}" == "CN" ]]; then
export DOAS_ZONE="cn"
@@ -154,7 +134,9 @@ if [[ "$WORKSPACE_ENVS_SET" != "1" ]]; then
envfile="/etc/.container_env"
if [[ -f $envfile ]]; then
while IFS= read -r line; do
[[ "$line" == *=* ]] || continue
_varname="${line%%=*}"
[[ "$_varname" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || continue
if eval "[[ -z \"\${${_varname}+x}\" ]]"; then # env is not set
export "${_varname}=${line#*=}"
fi
@@ -226,7 +208,9 @@ worker_envfile="/etc/worker_envs_$ARNOLD_WORKER_ID"
user_worker_envfile="$HOME/.worker_envs/worker_envs_$ARNOLD_WORKER_ID"
if [[ -f $user_worker_envfile ]]; then
while IFS= read -r line; do
[[ "$line" == *=* ]] || continue
_varname="${line%%=*}"
[[ "$_varname" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || continue
if eval "[[ -z \"\${${_varname}+x}\" ]]"; then # env is not set
export "${_varname}=${line#*=}"
fi
@@ -234,7 +218,9 @@ if [[ -f $user_worker_envfile ]]; then
unset _varname
elif [[ -f $worker_envfile ]]; then
while IFS= read -r line; do
[[ "$line" == *=* ]] || continue
_varname="${line%%=*}"
[[ "$_varname" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]] || continue
if eval "[[ -z \"\${${_varname}+x}\" ]]"; then # env is not set
export "${_varname}=${line#*=}"
fi
@@ -276,6 +262,7 @@ if [[ -f "$envfile" ]]; then
# 跳过注释行和空行
[[ "$line" =~ ^[[:space:]]*# ]] && continue
[[ "$line" =~ ^[[:space:]]*$ ]] && continue
[[ "$line" == *=* ]] || continue
# 提取变量名和值
var_name="${line%%=*}"