Clean job and update readme (#342)
This commit is contained in:
parent
2a78cf1d76
commit
1e98edd984
|
@ -3,7 +3,7 @@ on:
|
|||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
- cron: "0 3 * * *"
|
||||
- cron: "0 4 * * *"
|
||||
|
||||
jobs:
|
||||
check:
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
name: "Deep Check"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
schedule:
|
||||
- cron: "0 5 * * *"
|
||||
|
||||
jobs:
|
||||
check:
|
||||
if: github.repository == 'DaoCloud/public-image-mirror'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Start Proxy
|
||||
env:
|
||||
only_proxy: "m.daocloud.io"
|
||||
run: |
|
||||
wget https://github.com/wzshiming/bridge/releases/download/v0.7.13/bridge_linux_amd64 -O /usr/local/bin/bridge && chmod +x /usr/local/bin/bridge
|
||||
nohup /usr/local/bin/bridge -b :8080 -p - ${{ secrets.PROTOCOL }} 2>/dev/null &
|
||||
- name: Check Proxy
|
||||
run: |
|
||||
curl -v http://127.0.0.1:8080 || exit 1
|
||||
curl -f --proxy 127.0.0.1:8080 -v http://m.daocloud.io/v2/ || exit 1
|
||||
- name: Check
|
||||
env:
|
||||
INCREMENTAL: "true"
|
||||
QUICKLY: "true"
|
||||
QUICKLY_PATTERN: '[0-9]+(\.[0-9]+){2}|[0-9a-fA-F]{16}'
|
||||
PARALLET: "4"
|
||||
http_proxy: socks5://127.0.0.1:8080
|
||||
https_proxy: socks5://127.0.0.1:8080
|
||||
run: |
|
||||
./hack/diff.sh
|
||||
- name: Update badge
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
BADGE_PREFIX: "git://${{ github.repository }}/gh-pages"
|
||||
run: |
|
||||
wget https://github.com/wzshiming/putingh/releases/download/v0.6.3/putingh_linux_amd64 -O /usr/local/bin/putingh && chmod +x /usr/local/bin/putingh
|
||||
./hack/badge.sh
|
||||
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-deep-sync-badge.svg" badge.svg
|
||||
GH_TOKEN="${GH_TOKEN}" putingh "${BADGE_PREFIX}/daocloud-deep-sync.log" sync.log
|
||||
- name: Stats the number of not sync images
|
||||
run: |
|
||||
./hack/stats-not-sync.sh sync.log
|
|
@ -1,36 +0,0 @@
|
|||
name: Deep Sync
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 17,21,13 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
sync-images:
|
||||
if: github.repository == 'DaoCloud/public-image-mirror'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Start Proxy
|
||||
env:
|
||||
only_proxy: "m.daocloud.io"
|
||||
run: |
|
||||
wget https://github.com/wzshiming/bridge/releases/download/v0.7.13/bridge_linux_amd64 -O /usr/local/bin/bridge && chmod +x /usr/local/bin/bridge
|
||||
nohup /usr/local/bin/bridge -b :8080 -p - ${{ secrets.PROTOCOL }} 2>/dev/null &
|
||||
- name: Check Proxy
|
||||
run: |
|
||||
curl -v http://127.0.0.1:8080 || exit 1
|
||||
curl -f --proxy 127.0.0.1:8080 -v http://m.daocloud.io/v2/ || exit 1
|
||||
- name: Sync Images
|
||||
env:
|
||||
INCREMENTAL: "true"
|
||||
QUICKLY: "true"
|
||||
QUICKLY_PATTERN: '[0-9]+(\.[0-9]+){2}|[0-9a-fA-F]{16}'
|
||||
SYNC: "true"
|
||||
PARALLET: "2"
|
||||
http_proxy: socks5://127.0.0.1:8080
|
||||
https_proxy: socks5://127.0.0.1:8080
|
||||
run: |
|
||||
./hack/diff.sh
|
|
@ -2,7 +2,7 @@ name: Sync
|
|||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 19,23,11,15 * * *"
|
||||
- cron: "0 10,22 * * *"
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
|
|
15
README.md
15
README.md
|
@ -1,18 +1,9 @@
|
|||
# public-image-mirror
|
||||
|
||||
[](https://github.com/DaoCloud/public-image-mirror/raw/gh-pages/daocloud-sync.log)
|
||||
[](https://github.com/DaoCloud/public-image-mirror/raw/gh-pages/daocloud-deep-sync.log)
|
||||
|
||||
Sync: 是 tag 的同步率 只要 tag 存在就是同步的
|
||||
|
||||
Deep sync: 是 tag 内容同步率 (如 latest 这种 tag 会更新, tag 存在并不一定是最新的, 在这属于未同步)
|
||||
|
||||
每天大约同步 1k 的 tag
|
||||
|
||||
支持懒加载, 就算不在同步列表中也能直接拉取, 初次拉取会比已经同步过的慢一些, 并且[每 7 天会清理一次缓存](https://github.com/distribution/distribution/blob/e3509fc1deedaab489dd8829cc438de8f4c77fc3/registry/proxy/proxymanifeststore.go#L15)
|
||||
|
||||
如果只是临时使用的就不需要往同步列表里加了
|
||||
|
||||
## 背景
|
||||
很多镜像都在国外。比如 gcr 。国内下载很慢,需要加速。
|
||||
|
||||
|
@ -49,6 +40,12 @@ k8s.gcr.io/coredns/coredns => m.daocloud.io/k8s.gcr.io/coredns/coredns
|
|||
k8s.gcr.io/coredns/coredns => k8s-gcr.m.daocloud.io/coredns/coredns
|
||||
```
|
||||
|
||||
### 懒加载
|
||||
|
||||
**支持懒加载**, 就算不在同步列表中也能 **直接拉取**, 初次拉取会比已经同步过的慢一些, 并且[每 7 天会清理一次缓存](https://github.com/distribution/distribution/blob/e3509fc1deedaab489dd8829cc438de8f4c77fc3/registry/proxy/proxymanifeststore.go#L15)
|
||||
|
||||
如果只是临时使用的就不需要往同步列表里加了
|
||||
|
||||
## 提前同步的 Registry
|
||||
|
||||
[domain.txt](domain.txt)
|
||||
|
|
Loading…
Reference in New Issue