同步引擎与任务编排(SSH 直推 / 中转 registry 双模式)

Open
#5 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@linuxsuren-fs is already working on this.

Since Nov 18, 2026.

  • #16 by @linuxsuren-fs — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
15/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, go

Research direction

First resolve the architecture decision in issue #1, which determines where images are pulled, the transfer mode, and the log streaming contract. Then inspect the task, transport, and UI entry points selected by that decision; this issue names no files or tests to start from. Done means multi image, multi target sync reports progress and results, handles retries, cancellation and duplicate digests, and passes the listed failure injection and race checks. An open linked pull request (#16) indicates work is already underway.

Written by the indexing model from the issue text.

Description

requirement
背景

核心执行链路:把清单里的镜像从来源同步到目标。必须先落实 #1 的架构决策(拉取位置与传输模式)。

需求
  1. 同步任务:选择「镜像清单(可多选)」+「目标(一组服务器,M1 模式;或中转 registry,M2 模式)」,手动触发;后续可扩展定时
  2. 执行编排:
    • 按镜像 × 目标生成子步骤,逐层(blob 级)上报进度
    • 失败重试:指数退避,可配置次数;单目标失败不影响其他目标
    • 并发上限可配置(默认 3),防止打满带宽
  3. 任务历史与日志:状态机(排队/运行中/成功/失败/取消)、耗时、传输字节数;日志可流式查看(SSE 或轮询,按 #1 契约决定)
  4. 取消:运行中的任务可取消,已开始传输的目标要能干净中止
  5. 幂等:目标已存在同 digest 镜像时跳过传输并标记「已存在」
技术要点
  • A2 纯 Go 直拷(若 #1 采纳):需处理 manifest list(多架构)选择、并发拉 blob、断点续传(Range)
  • M1 模式:SSH 流式管道,注意远端 docker load 失败时管道破裂的错误归因
  • e2e:CI 中用 registry:2 容器做源/中转、sshd 容器做目标,跑通最小闭环
验收标准
  • 一条命令/一次点击完成「多镜像 → 多服务器」同步,进度与结果在 UI 可见
  • 失败注入测试(源 401、网络中断、目标盘满)各自呈现正确错误码
  • 取消后无残留 goroutine/连接(-race 通过)
  • 幂等:重复执行第二次全部「已存在」且耗时趋近于零
Dominant language
Go
Stars
2
Forks
1
Avg merge
1h 37m
Merged PRs (30d)
6

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LinuxSuRen/open-img-sync

All issues in LinuxSuRen/open-img-sync

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.