Add OSS ability-video upload helpers and ignore runtime artifacts.

Commit _oss_*.py ops scripts alongside existing _cf_* helpers; gitignore bucket marker and upload PID.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
voson
2026-07-27 20:31:00 +08:00
co-authored by Cursor
parent 124bdbb7c7
commit 74deb17888
5 changed files with 443 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
"""Launch OSS upload as a detached process inheriting current env (keyzoo inject)."""
from __future__ import annotations
import os
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent
LOG = ROOT / "oss_upload.log"
ERR = ROOT / "oss_upload_err.log"
PID = ROOT / "oss_upload.pid"
def main() -> None:
if not os.environ.get("KEYZOO_ASSET_SECRET_ACCESSKEY_SECRET") and not os.environ.get(
"OSS_ACCESS_KEY_SECRET"
):
raise SystemExit("missing AccessKey secret in env")
# Clear previous logs.
for p in (LOG, ERR):
if p.exists():
p.unlink()
creationflags = 0
if sys.platform == "win32":
creationflags = subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.DETACHED_PROCESS
out = open(LOG, "w", encoding="utf-8")
err = open(ERR, "w", encoding="utf-8")
proc = subprocess.Popen(
[sys.executable, str(ROOT / "_oss_ability_videos.py"), "upload"],
cwd=str(ROOT),
stdout=out,
stderr=err,
env=os.environ.copy(),
creationflags=creationflags,
close_fds=True,
)
PID.write_text(str(proc.pid), encoding="utf-8")
print(f"started_pid={proc.pid}")
print(f"log={LOG}")
if __name__ == "__main__":
main()