fix: stabilize sub2api codex pool operations

This commit is contained in:
Codex
2026-07-01 15:52:22 +00:00
parent 8f54b591d7
commit 113b6809d1
16 changed files with 509 additions and 59 deletions
@@ -325,6 +325,7 @@ tag=${shQuote(target.tag)}
base_image=${shQuote(target.baseImage)}
openai_version=${shQuote(sentinel.sdk.openaiPythonVersion)}
base_image_cache_policy=${shQuote(targetRuntime.sentinelImageBuild.baseImageCachePolicy)}
proxy_env_path=${shQuote(targetRuntime.sentinelImageBuild.proxyEnvPath ?? "")}
work=/tmp/unidesk-sub2api-sentinel-image
mkdir -p "$work"
dockerfile_path="$work/sentinel.Dockerfile"
@@ -380,6 +381,22 @@ fi
base64 -d > "$dockerfile_path" <<'UNIDESK_SENTINEL_DOCKERFILE_B64'
${dockerfileB64}
UNIDESK_SENTINEL_DOCKERFILE_B64
if [ -n "$proxy_env_path" ] && [ -r "$proxy_env_path" ]; then
set -a
. "$proxy_env_path"
set +a
fi
HTTP_PROXY="$(printenv HTTP_PROXY 2>/dev/null || true)"
HTTPS_PROXY="$(printenv HTTPS_PROXY 2>/dev/null || true)"
ALL_PROXY="$(printenv ALL_PROXY 2>/dev/null || true)"
http_proxy_value="$(printenv http_proxy 2>/dev/null || true)"
https_proxy_value="$(printenv https_proxy 2>/dev/null || true)"
all_proxy_value="$(printenv all_proxy 2>/dev/null || true)"
if [ -z "$HTTP_PROXY" ]; then HTTP_PROXY="$http_proxy_value"; fi
if [ -z "$HTTPS_PROXY" ]; then HTTPS_PROXY="$https_proxy_value"; fi
if [ -z "$ALL_PROXY" ]; then ALL_PROXY="$all_proxy_value"; fi
if [ -z "$HTTPS_PROXY" ]; then HTTPS_PROXY="$HTTP_PROXY"; fi
if [ -z "$ALL_PROXY" ]; then ALL_PROXY="$HTTP_PROXY"; fi
export NO_PROXY=${shQuote(targetRuntime.sentinelImageBuild.noProxy)}
export no_proxy=$NO_PROXY
set -- --pull
@@ -389,9 +406,11 @@ if [ "$base_image_cache_policy" = "local-if-present" ] && docker image inspect "
base_image_source="local-cache"
fi
docker build "$@" \\
--network host \\
--build-arg BASE_IMAGE="$base_image" \\
--build-arg OPENAI_PYTHON_VERSION="$openai_version" \\
--build-arg HTTP_PROXY= --build-arg HTTPS_PROXY= --build-arg http_proxy= --build-arg https_proxy= \\
--build-arg HTTP_PROXY="$HTTP_PROXY" --build-arg HTTPS_PROXY="$HTTPS_PROXY" --build-arg ALL_PROXY="$ALL_PROXY" \\
--build-arg http_proxy="$HTTP_PROXY" --build-arg https_proxy="$HTTPS_PROXY" --build-arg all_proxy="$ALL_PROXY" \\
--build-arg NO_PROXY --build-arg no_proxy \\
-f "$dockerfile_path" \\
-t "$image" \\