adam-community 1.0.27__tar.gz → 1.0.28__tar.gz

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.
Files changed (39) hide show
  1. {adam_community-1.0.27 → adam_community-1.0.28}/PKG-INFO +1 -1
  2. adam_community-1.0.28/adam_community/__version__.py +1 -0
  3. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/sif_build.py +13 -48
  4. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/PKG-INFO +1 -1
  5. adam_community-1.0.27/adam_community/__version__.py +0 -1
  6. {adam_community-1.0.27 → adam_community-1.0.28}/README.md +0 -0
  7. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/__init__.py +0 -0
  8. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/__init__.py +0 -0
  9. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/build.py +0 -0
  10. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/cli.py +0 -0
  11. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/init.py +0 -0
  12. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/parser.py +0 -0
  13. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/Makefile.j2 +0 -0
  14. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/README_agent.md.j2 +0 -0
  15. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/README_kit.md.j2 +0 -0
  16. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/__init__.py +0 -0
  17. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/agent_python.py.j2 +0 -0
  18. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/configure.json.j2 +0 -0
  19. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/initial_assistant_message.md.j2 +0 -0
  20. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/initial_assistant_message_en.md.j2 +0 -0
  21. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/initial_system_prompt.md.j2 +0 -0
  22. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/initial_system_prompt_en.md.j2 +0 -0
  23. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/input.json.j2 +0 -0
  24. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/kit_python.py.j2 +0 -0
  25. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/long_description.md.j2 +0 -0
  26. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/long_description_en.md.j2 +0 -0
  27. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/templates/rag_python.py.j2 +0 -0
  28. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/cli/updater.py +0 -0
  29. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/tool.py +0 -0
  30. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community/util.py +0 -0
  31. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/SOURCES.txt +0 -0
  32. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/dependency_links.txt +0 -0
  33. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/entry_points.txt +0 -0
  34. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/requires.txt +0 -0
  35. {adam_community-1.0.27 → adam_community-1.0.28}/adam_community.egg-info/top_level.txt +0 -0
  36. {adam_community-1.0.27 → adam_community-1.0.28}/setup.cfg +0 -0
  37. {adam_community-1.0.27 → adam_community-1.0.28}/setup.py +0 -0
  38. {adam_community-1.0.27 → adam_community-1.0.28}/test/test_sif_upload.py +0 -0
  39. {adam_community-1.0.27 → adam_community-1.0.28}/test/test_util_tool.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.27
3
+ Version: 1.0.28
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -0,0 +1 @@
1
+ __version__ = "1.0.28"
@@ -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, chunk_size, keep_temp):
416
- """将 SIF 文件切片并构建 Docker 镜像推送到仓库
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/5: 验证环境[/bold blue]")
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/5: 创建工作目录[/bold blue]")
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: 切片 SIF 文件 =====
487
- console.print("\n[bold blue]📦 步骤 3/5: 切片 SIF 文件[/bold blue]")
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/5: 生成 Dockerfile[/bold blue]")
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\n"
558
- f"切片数: {len(chunks)}",
523
+ f"大小: {file_size_mb:.2f} MB",
559
524
  border_style="green"
560
525
  ))
561
526
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: adam_community
3
- Version: 1.0.27
3
+ Version: 1.0.28
4
4
  Summary: Adam Community Tools and Utilities
5
5
  Home-page: https://github.com/yourusername/adam-community
6
6
  Author: Adam Community
@@ -1 +0,0 @@
1
- __version__ = "1.0.27"