GithubHelp home page GithubHelp logo

tunasync's Introduction

tunasync

Build Status Coverage Status Commitizen friendly GPLv3

Get Started

Download

Pre-built binary for Linux x86_64 and ARM64 is available at Github releases.

Design

# Architecture

- Manager: Central instance for status and job management
- Worker: Runs mirror jobs

+------------+ +---+                  +---+
| Client API | |   |    Job Status    |   |    +----------+     +----------+ 
+------------+ |   +----------------->|   |--->|  mirror  +---->|  mirror  | 
+------------+ |   |                  | w |    |  config  |     | provider | 
| Worker API | | H |                  | o |    +----------+     +----+-----+ 
+------------+ | T |   Job Control    | r |                          |       
+------------+ | T +----------------->| k |       +------------+     |       
| Job/Status | | P |   Start/Stop/... | e |       | mirror job |<----+       
| Management | | S |                  | r |       +------^-----+             
+------------+ |   |   Update Status  |   |    +---------+---------+         
+------------+ |   <------------------+   |    |     Scheduler     |
|   BoltDB   | |   |                  |   |    +-------------------+
+------------+ +---+                  +---+


# Job Run Process


PreSyncing                           Syncing                               Success
+-----------+     +----------+    +-----------+    +-------------+     +--------------+
|  pre-job  +--+->| pre-exec +--->|  job run  +--->|  post-exec  +-+-->| post-success |
+-----------+  ^  +----------+    +-----------+    +-------------+ |   +--------------+
               |                                                   |
               |                +-----------------+                | Failed
               +----------------+    post-fail    |<---------------+
                                +-----------------+

Building

Go version: 1.13

> make all

Binaries in the build-linux-amd64/.

tunasync's People

Contributors

anymoe avatar bigeagle avatar dependabot[bot] avatar dotkrnl avatar elboulangero avatar felixonmars avatar garyh4 avatar higuoxing avatar houbaron avatar huiyiqun avatar hxsf avatar jiegec avatar kinosang avatar l2dy avatar phy25 avatar scateu avatar shankerwangmiao avatar walkerning avatar xiaq avatar z4yx avatar zenithalhourlyrate avatar ziqin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tunasync's Issues

Register at Pypi

Register before the name is taken! We also need a proper setup.py.

CPU使用率过高

服务器是2C 8G内存的配置。目前一共配置了6个mirrors同步job。concurrent设置为3。但是一直会报CPU使用率过高。请问是job的参数设置有问题吗

没办法同步,希望得到帮助

manager 收到worker 的信息,但worker 似乎没有执行mirrors里边的同步脚本,按照中文教程执行了几遍,也换过几台服务器,都不行,希望能够得到帮助。

How to solve bandersnatch via proxy?

HI,

I know this is not one "bug".But I noticed that tuna also uses the bandersnatch to sync Pypi .
I use the same way in my company, but the different is that ,my company has proxy. Each time I execute bandersntach will be failed by the connection time out.

Do you have any ideas?

docker executor

mirror jobs can be spawned using docker, which has these pros:

  • mirror directory is isolated
  • execution environment is stateless

tunasynctl cannot parse " 08:42:13 +0800"" as "T"

执行 ./tunasynctl list --all 报错:

/Users/Ray/.config/tunasync/ctl.conf
[17-06-06 17:11:34][INFO] Use manager address: http://localhost:14242
Failed to correctly get information of all jobs from manager server: parsing time ""2017-06-06 08:42:13 +0800"" as ""2006-01-02T15:04:05Z07:00"": cannot parse " 08:42:13 +0800"" as "T"

请问如何解决?

dockerhub

post it to dockerhub making it easier to run

Anaconda mirror script

Currently using lftp mirroring does not seems to be quite reliable since there's no checksum verifying.

Anaconda use repodata.json to store metadata.

curl -s https://repo.continuum.io/pkgs/free/linux-32/repodata.json.bz2 | bzip2 -d -

repo sync aosp code have warning

# ubuntu 14.04
$ repo init -u https://aosp.tuna.tsinghua.edu.cn/platform/manifest -b android-6.0.1_r67
$ repo sync
remote: warning: unable to access '/root/.config/git/attributes': Permission denied        
From https://aosp.tuna.tsinghua.edu.cn/platform/external/sonivox
   1d73da2..902ce06  master     -> aosp/master
remote: warning: unable to access '/root/.config/git/attributes': Permission denied        
From https://aosp.tuna.tsinghua.edu.cn/platform/packages/providers/MediaProvider
   dcf3957..9eb7709  master     -> aosp/master
remote: warning: unable to access '/root/.config/git/attributes': Permission denied        
From https://aosp.tuna.tsinghua.edu.cn/platform/external/conscrypt
   adb03d6..0da48d5  master     -> aosp/master
remote: warning: unable to access '/root/.config/git/attributes': Permission denied        
From https://aosp.tuna.tsinghua.edu.cn/platform/external/tinyalsa

同步过程中报错

Centos7的服务器,同步过程中,报端口连接被拒绝。查看了下防火墙及SELINUX的状态都被禁用了。查看服务状态后,报错如下
systemctl status tunasync-worker.service -l

3月 06 22:09:24 p-awscn-paas tunasync[62593]: [ERROR] Failed to update mirror(centos) status: Post https://mirrors.xxxxx.com:12345/workers/mirror_worker/jobs/centos: dial tcp ip地址:12345: getsockopt: connection refused

包的确是被正常的同步下来了,但是无法使用tunasync list mirrors_worker状态查看每个包的同步状态。

Cannot make

How to reproduce:

~> git clone [email protected]:tuna/tunasync.git
~> cd tunasync
~> make

failed with following errors:

~/Source/tunasync on master   / ~> make
go get ./cmd/tunasync
package ./cmd/tunasync
        imports github.com/tuna/tunasync/internal: use of internal package not allowed
make: *** [Makefile:6: get] Error 1
Exception: make exited with 2
Traceback:
  [interactive], line 1:
    make

Software versions:

~/Source/tunasync on master   / ~> go version
go version go1.7.3 linux/amd64
~/Source/tunasync on master   / ~> make -v
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~/Source/tunasync on master   / ~> uname -a
Linux ancient 4.8.4-1-ARCH #1 SMP PREEMPT Sat Oct 22 18:26:57 CEST 2016 x86_64 GNU/Linux

ftpsync provider

ftpsync is the only offical syncing tool for debian and kali, we should either reimplement ftpsync or better integrate with it.

It seems to be easier to wrap ftpsync as a mirror provider.

报错: Error initializing DB adapter: open /var/lib/tunasync/tunasync.db: no such file or directory

(sid)scateu@localhost:~$ ./tunasync --help
NAME:
tunasync - A new cli application

USAGE:
tunasync [global options] command [command options] [arguments...]

VERSION:
0.1

COMMANDS:
manager, m start the tunasync manager
worker, w start the tunasync worker

GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version

(sid)scateu@localhost:~$ ./tunasync manager
[16-10-31 00:16:51][ERROR] Error initializing DB adapter: open /var/lib/tunasync/tunasync.db: no such file or directory
[16-10-31 00:16:51][ERROR] Error intializing TUNA sync worker.

`status_file` not work

I tried to set status_file in manager.conf, but it does not work.

I read through the sources but there's no codes for it. Does the status_file deprecated? Is there any way to get mirrors' status from a webpage?

Multiple reposync instances are confused about repomd.xml

We take use of reposync to sync yum repo.

When launching multiple instance of reposync which share similar configuration(mainly name of repo), one may falsely consider repomd.xml downloaded by another instance as fresh cache and finally results in failure.

Forcing reposync to use temporary directory(with -t) does not fix this problem.

Set retry in configuration

Make it configurable for retries in configuration.

For e.g.

in worker.conf

[global]
retry = 3

[[mirrors]]
retry = 0

Meaning of exit status

Hi, I got some error code(Exit status 10) while syncing mirrors. I tried to look through source code to find their meaning, but I didn't find out. Can you please give more information about these error codes? Thanks.

Reduce CPU Usage

CPU usage is quite high, pprof indicates that runtime.siftdownTimer consumed a lot of CPU time.
It seems that we had abused golang timer objects.

Multi-file mirror config

Make it possible to write worker config as

[global]
blah =  ""

[server]
blah = ""

[include]
include_mirrors = "/etc/tunasync/mirorrs/*.conf"

[[mirrors]]
blah = ""

In the included config files, like /etc/tunasync/mirorrs/*.conf, only [[mirrors]] section is allowed.

RsyncProvider has no "--links" in the default options.

I see that the official mirror scripts provided by Archlinux and Ubuntu both has the option "--links" in it. I'm wondering why there's no "--links" in the default options.

class RsyncProvider(MirrorProvider):

    _default_options = ['-aHvh', '--no-o', '--no-g', '--stats',
                        '--exclude', '.~tmp~/',
                        '--delete', '--delete-after', '--delay-updates',
                        '--safe-links', '--timeout=120', '--contimeout=120']
...

同步问题

mirror远程源里的rpm包没有了,为什么我本地的rpm包也会被删除,有没有办法保留本地的rpm包

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.