feat: 支持脚本管理离线上传包

This commit is contained in:
2026-07-31 16:57:59 +08:00
parent dbe2024b6e
commit ad50be3256
3 changed files with 113 additions and 8 deletions
+5 -7
View File
@@ -38,23 +38,21 @@ Use `--window 2026073110001100` to require one exact source window. Without it,
## Metrix Script Management
The target server is offline, so build the runtime image on a connected machine and import it through Metrix Container Management:
The target server is offline. Build the dependency image locally, then generate a self-contained Script Management upload ZIP:
```powershell
docker build -t interference-etl-runtime:1.1 .
New-Item -ItemType Directory -Force dist | Out-Null
docker save -o dist\interference-etl-runtime-1.1.tar interference-etl-runtime:1.1
python scripts\build_offline_package.py
```
The local `dist/` directory is intentionally excluded from Git. Transfer the generated TAR as a deployment artifact rather than source code.
The current `1.1` TAR is 46,944,256 bytes with SHA-256 `BF92BF776D52865CA484D0B7D1B10336C998A07E8310D6F01576C74A65A1FF6A`.
The generated `dist/InterferenceETL-offline-1.1.zip` contains `main.py` plus `openpyxl`, `et_xmlfile`, and `PyMySQL`. The builder verifies imports using the standard `python:3.13.11-slim` image, so the uploaded workspace does not need an online `pip install` or a custom runtime image. The ZIP is 325,932 bytes with SHA-256 `D57930E36B3C70DF7D209C4A83546FEA3B73F87022910D1FDB548D6BED71675D`.
Create the Metrix script project with:
Create the project, then upload and extract the ZIP in its Script Management workspace. Use these project settings:
```text
Name: InterferenceETL
Language: python
Base image: interference-etl-runtime:1.1
Base image: python:3.13.11-slim
Network: bridge
Run command: python main.py
Timeout: 1800 seconds