mirror/merlin
Max Erenberg e900874833 use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
..
arthur refactor sync 2023-05-03 01:10:33 -04:00
cmd/arthur modify arthur status message 2023-05-03 01:10:33 -04:00
config use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
logger use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
sync use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
test fix gitignore 2021-09-09 00:31:28 -04:00
.gitignore use ftpsync for debian and debian-security 2023-05-03 01:10:33 -04:00
Handoff.md force overrides trace and update x.org repo 2023-05-03 01:10:33 -04:00
README.md minor fixes 2023-05-03 01:10:33 -04:00
go.mod Bump version, add verbosity and dry run options 2022-06-23 02:43:42 +00:00
go.sum Bump version, add verbosity and dry run options 2022-06-23 02:43:42 +00:00
merlin-config-all.ini fix up csc-sync-debian 2023-05-03 01:10:33 -04:00
merlin-config-test.ini fix up csc-sync-debian 2023-05-03 01:10:33 -04:00
merlin-config.ini use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
merlin-go.service use quick-fedora-mirror for fedora repos 2023-05-03 01:10:33 -04:00
merlin.go minor fixes 2023-05-03 01:10:33 -04:00

README.md

Merlin

Build Status

This folder contains the code for merlin (which does the actual syncing) and arthur (which sends commands to merlin).

Check out the the mirror env for a testing environment

Usage

go build merlin.go

Then configure merlin-config.ini and run using ./merlin

Nice Features To Add

  • detect if an rsync process is stuck (watch the stdout/stderr of the rsync processes)
  • detect if config file is changed and automatically reload (fsnotify)
  • sort arthur status by last time synced
  • respond to arthur without blocking main thread
  • state files appear to be getting extra newlines
  • log rotation for log files (also maybe state reporting to prometheus)
  • split off arthur with a more featureful arthur for debugging
    • last sync runtime, time until next sync, due to sync (true/false for repo would sync if could)
    • get expected rsync command or repo config
    • details for last 10 syncs (avg time, success rate, data read/written)

Completed

  • add bwlimit option for each rsync process
  • write process manager
  • save state (last attempted time, last attempted status) for each repo, and restore state on startup (e.g. use JSON/INI file for each repo)
  • calculate difference between the scheduled time of a job and the time at which it actually ran; log this
  • add all repos to merlin-config.ini (*)
  • handle termination signals in merlin (SIGINT, SIGTERM); close stopChan for this
  • listen on Unix socket in merlin
  • implement arthur.go (commands: sync and status)
  • allow dynamic reloading in merlin
  • use separate log file for each child process (currently sharing stdout/stderr with parent)
  • implement zfssync in merlin (just invoke the existing Python script)