adam-community 1.0.27__py3-none-any.whl → 1.0.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adam_community/__version__.py +1 -1
- adam_community/cli/sif_build.py +13 -48
- {adam_community-1.0.27.dist-info → adam_community-1.0.28.dist-info}/METADATA +1 -1
- {adam_community-1.0.27.dist-info → adam_community-1.0.28.dist-info}/RECORD +7 -7
- {adam_community-1.0.27.dist-info → adam_community-1.0.28.dist-info}/WHEEL +0 -0
- {adam_community-1.0.27.dist-info → adam_community-1.0.28.dist-info}/entry_points.txt +0 -0
- {adam_community-1.0.27.dist-info → adam_community-1.0.28.dist-info}/top_level.txt +0 -0
adam_community/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.0.
|
|
1
|
+
__version__ = "1.0.28"
|
adam_community/cli/sif_build.py
CHANGED
|
@@ -410,18 +410,11 @@ def sif():
|
|
|
410
410
|
@click.argument('image_url')
|
|
411
411
|
@click.option('--username', help='Docker 仓库用户名')
|
|
412
412
|
@click.option('--password', help='Docker 仓库密码')
|
|
413
|
-
@click.option('--chunk-size', help='覆盖自适应计算的切片大小(如 100M, 500M)')
|
|
414
413
|
@click.option('--keep-temp', is_flag=True, help='保留临时文件')
|
|
415
|
-
def upload(sif_file, image_url, username, password,
|
|
416
|
-
"""将 SIF
|
|
414
|
+
def upload(sif_file, image_url, username, password, keep_temp):
|
|
415
|
+
"""将 SIF 文件打包为 Docker 镜像并推送到仓库
|
|
417
416
|
|
|
418
|
-
|
|
419
|
-
- 文件 < 500MB:不切片,直接使用原文件
|
|
420
|
-
- 文件 500MB-2GB:切片大小 100MB
|
|
421
|
-
- 文件 2GB-10GB:切片大小 500MB
|
|
422
|
-
- 文件 > 10GB:切片大小 1GB
|
|
423
|
-
|
|
424
|
-
可通过 --chunk-size 参数覆盖自适应策略
|
|
417
|
+
直接使用完整的 SIF 文件,不进行切片,避免合并问题。
|
|
425
418
|
|
|
426
419
|
示例:
|
|
427
420
|
adam-cli sif upload ./xxx.sif xxx.cn-hangzhou.cr.aliyuncs.com/openscore/openscore-core:1.0.0
|
|
@@ -444,7 +437,7 @@ def upload(sif_file, image_url, username, password, chunk_size, keep_temp):
|
|
|
444
437
|
|
|
445
438
|
try:
|
|
446
439
|
# ===== 步骤 1: 验证环境 =====
|
|
447
|
-
console.print("\n[bold blue]📦 步骤 1/
|
|
440
|
+
console.print("\n[bold blue]📦 步骤 1/4: 验证环境[/bold blue]")
|
|
448
441
|
|
|
449
442
|
# 验证 SIF 文件
|
|
450
443
|
valid, error_msg = validateSifFile(sif_path)
|
|
@@ -475,51 +468,24 @@ def upload(sif_file, image_url, username, password, chunk_size, keep_temp):
|
|
|
475
468
|
border_style="red"
|
|
476
469
|
))
|
|
477
470
|
sys.exit(1)
|
|
478
|
-
console.print(" ✓ split 命令可用")
|
|
479
471
|
console.print(" ✓ Docker 已安装并运行")
|
|
480
472
|
|
|
481
473
|
# ===== 步骤 2: 创建工作目录 =====
|
|
482
|
-
console.print("\n[bold blue]📦 步骤 2/
|
|
474
|
+
console.print("\n[bold blue]📦 步骤 2/4: 创建工作目录[/bold blue]")
|
|
483
475
|
work_dir = createWorkDir(sif_path)
|
|
484
476
|
console.print(f" ✓ 工作目录: {work_dir}")
|
|
485
477
|
|
|
486
|
-
# ===== 步骤 3:
|
|
487
|
-
console.print("\n[bold blue]📦 步骤 3/
|
|
488
|
-
|
|
489
|
-
# 计算切片大小
|
|
490
|
-
if chunk_size:
|
|
491
|
-
actual_chunk_size = chunk_size
|
|
492
|
-
console.print(f" 切片策略: 自定义 ({chunk_size})")
|
|
493
|
-
else:
|
|
494
|
-
actual_chunk_size = calculateOptimalChunkSize(file_size)
|
|
495
|
-
if actual_chunk_size:
|
|
496
|
-
console.print(f" 切片策略: 自适应 ({actual_chunk_size})")
|
|
497
|
-
else:
|
|
498
|
-
console.print(f" 切片策略: 不切片 (文件 < 500MB)")
|
|
478
|
+
# ===== 步骤 3: 复制 SIF 文件 =====
|
|
479
|
+
console.print("\n[bold blue]📦 步骤 3/4: 复制 SIF 文件[/bold blue]")
|
|
499
480
|
|
|
481
|
+
# 直接复制完整的 SIF 文件,不进行切片
|
|
482
|
+
dest_file = work_dir / sif_path.name
|
|
483
|
+
shutil.copy2(sif_path, dest_file)
|
|
484
|
+
console.print(f" ✓ SIF 文件已复制: {dest_file.name}")
|
|
500
485
|
console.print(f" 文件大小: {file_size_mb:.2f} MB")
|
|
501
486
|
|
|
502
|
-
# 执行切片
|
|
503
|
-
try:
|
|
504
|
-
chunks = splitSifFile(sif_path, actual_chunk_size, work_dir)
|
|
505
|
-
console.print(f" ✓ 切片完成: {len(chunks)} 个文件")
|
|
506
|
-
|
|
507
|
-
# 显示切片详情
|
|
508
|
-
console.print(f"\n 📄 切片详情:")
|
|
509
|
-
for chunk in chunks:
|
|
510
|
-
chunk_size_mb = chunk.stat().st_size / (1024 * 1024)
|
|
511
|
-
console.print(f" - {chunk.name} ({chunk_size_mb:.2f} MB)")
|
|
512
|
-
except subprocess.CalledProcessError as e:
|
|
513
|
-
console.print(Panel.fit(
|
|
514
|
-
f"[bold red]❌ SIF 文件切片失败[/bold red]\n"
|
|
515
|
-
f"错误: {e.stderr}",
|
|
516
|
-
border_style="red"
|
|
517
|
-
))
|
|
518
|
-
cleanupTempFiles(work_dir, keep_temp, console)
|
|
519
|
-
sys.exit(1)
|
|
520
|
-
|
|
521
487
|
# ===== 步骤 4: 生成 Dockerfile =====
|
|
522
|
-
console.print("\n[bold blue]📦 步骤 4/
|
|
488
|
+
console.print("\n[bold blue]📦 步骤 4/4: 生成 Dockerfile[/bold blue]")
|
|
523
489
|
dockerfile_path = generateDockerfile(work_dir)
|
|
524
490
|
console.print(f" ✓ Dockerfile 已生成")
|
|
525
491
|
|
|
@@ -554,8 +520,7 @@ def upload(sif_file, image_url, username, password, chunk_size, keep_temp):
|
|
|
554
520
|
console.print(Panel.fit(
|
|
555
521
|
f"[bold green]✅ 构建成功![/bold green]\n"
|
|
556
522
|
f"镜像: {image_url}\n"
|
|
557
|
-
f"大小: {file_size_mb:.2f} MB
|
|
558
|
-
f"切片数: {len(chunks)}",
|
|
523
|
+
f"大小: {file_size_mb:.2f} MB",
|
|
559
524
|
border_style="green"
|
|
560
525
|
))
|
|
561
526
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
adam_community/__init__.py,sha256=vAmF9VQR6D4peppH0hnrHDmZK5cFeFPh11GIsTKUXhE,429
|
|
2
|
-
adam_community/__version__.py,sha256=
|
|
2
|
+
adam_community/__version__.py,sha256=pC0eKGXF1PH-qw7ZFRVVeFacCzuUE-x6jPc3T4w6jNc,23
|
|
3
3
|
adam_community/tool.py,sha256=F6jxRU3urqTfgjLIZSW-hVWyj0FpNwvY65jOODXI19w,4954
|
|
4
4
|
adam_community/util.py,sha256=SDXnWLHLfJxEJ5WBnwNq_FeHNwXxGK_F36dpI_hVkNc,17766
|
|
5
5
|
adam_community/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
@@ -7,7 +7,7 @@ adam_community/cli/build.py,sha256=fCteEXjtU2ZsXXUWa-j61gh_JVU-6xSAH_LpOP5swFc,1
|
|
|
7
7
|
adam_community/cli/cli.py,sha256=UMJo6olpWF4D99_xYZ6n8ztdcVUFf8n48Lroy568G8g,2883
|
|
8
8
|
adam_community/cli/init.py,sha256=JiRjUkYVnha6Oz-eQ9BgB0nEN6y-tkrNXfy3s342_74,9717
|
|
9
9
|
adam_community/cli/parser.py,sha256=LWYVW69z4ICFXgvD5Vtcy1P-rEUxV_Rs4X96n34i3gE,17732
|
|
10
|
-
adam_community/cli/sif_build.py,sha256=
|
|
10
|
+
adam_community/cli/sif_build.py,sha256=dGhVwdxAWHQZveItNRpcdHTw-w1kg2rgBYgVH4ipVQ8,16413
|
|
11
11
|
adam_community/cli/updater.py,sha256=zN521c-G20MKz63wm7h16quBxiEZp4vQ6AbyV-IqtXk,6304
|
|
12
12
|
adam_community/cli/templates/Makefile.j2,sha256=arpo9AzOZTmjxIYiya9S_G_ldHYVVvf4cVOxNooQeGs,113
|
|
13
13
|
adam_community/cli/templates/README_agent.md.j2,sha256=lbhaEPZrgbCfUG-T7GItkgfIV9h1rqxyfRQuGhcdOqU,8901
|
|
@@ -26,8 +26,8 @@ adam_community/cli/templates/long_description.md.j2,sha256=Rj6hcuNzEL0Sp17GQVCRJ
|
|
|
26
26
|
adam_community/cli/templates/long_description_en.md.j2,sha256=xSbahwGarXlWopZqHw7lrcv1dQuvwj2ChhZv5pJmUy4,1725
|
|
27
27
|
adam_community/cli/templates/rag_python.py.j2,sha256=YJL7-WIx-Dumt7lHuUGxl3Rbaw0kpkh8hpcCJ5lz9lA,2494
|
|
28
28
|
adam_community/cli/templates/toolbox_python.py.j2,sha256=EOnmsJUvQRrcO7K7c88kI42gMmcM0Z4ab46qwOJXbH8,4192
|
|
29
|
-
adam_community-1.0.
|
|
30
|
-
adam_community-1.0.
|
|
31
|
-
adam_community-1.0.
|
|
32
|
-
adam_community-1.0.
|
|
33
|
-
adam_community-1.0.
|
|
29
|
+
adam_community-1.0.28.dist-info/METADATA,sha256=pCes8Oix7qsB1Y_aBOWD9855DjLGW7GlDHgbClDVZF4,3628
|
|
30
|
+
adam_community-1.0.28.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
31
|
+
adam_community-1.0.28.dist-info/entry_points.txt,sha256=4I7yRkn7cHwPY8-fWQLeAvKjc24zUy8Z65VsZNs0Wos,56
|
|
32
|
+
adam_community-1.0.28.dist-info/top_level.txt,sha256=MS8jbePXKZChih9kGizNVX0I1MFZFGWBMCIW_r86qhU,15
|
|
33
|
+
adam_community-1.0.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|