Skip to content

Container Images Sync

Actions
Container Images Sync
v1.1.0
Latest
Star (4)

Container Images Sync

PyPI-python3-cisctl

Github Actions for Container Images Sync

How to Use by Github Actions

    - name: Container Images Sync
      uses: x-actions/python3-cisctl@v1
      env:
        GIT_ORG: "x-mirrors"
        GIT_REPO: "gcr.io"
        GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        SRC_IMAGE_LIST_URL: "https://raw.githubusercontent.com/x-mirrors/gcr.io/main/registry.k8s.io/all-repos.txt"
        DEST_REPO: "docker.io/gcmirrors"
        SRC_TRANSPORT: "docker"
        DEST_TRANSPORT: "docker"
        DEST_TRANSPORT_USER: "user"
        DEST_TRANSPORT_PASSWORD: "password"
        THREAD_POOL_NUM: 2
        AFTER_TIMEUPLOADEDMS: 0
        LOG_LEVEL: "DEBUG"

Environment Variables:

Dev and Test

  • local run
# install
pip3 install -r requirements.txt

# set env
export GIT_ORG="x-mirrors"
export GIT_REPO="gcr.io"
export GIT_TOKEN='${{ secrets.GITHUB_TOKEN }}'
export SRC_IMAGE_LIST_URL="https://raw.githubusercontent.com/x-mirrors/gcr.io/main/registry.k8s.io/all-repos.txt"
export DEST_REPO="docker.io/gcmirrors"
export SRC_TRANSPORT="docker"
export DEST_TRANSPORT="docker"
export DEST_TRANSPORT_USER="xianbinxie"
export DEST_TRANSPORT_PASSWORD="<passwords>"

# dev
export PYTHONPATH=$(pwd)
python3 cisctl/shell.py --help
python3 cisctl/shell.py help sync
python3 cisctl/shell.py sync xxx
  • tests
python3 -m unittest cisctl.tests.unit.test_skopeo.SkopeoTestCase.test_do_sync
  • Docker API Rate Limiting

  • X-RateLimit-Limit - The limit of requests per minute.

  • X-RateLimit-Remaining - The remaining amount of calls within the limit period.

  • X-RateLimit-Reset - The unix timestamp of when the remaining resets.

If you have hit the limit, you will receive a response status of 429 and the X-Retry-After header in the response.

The X-Retry-After header is a unix timestamp of when you can call the API again.

< x-ratelimit-limit: 180
< x-ratelimit-reset: 1646881125
< x-ratelimit-remaining: 180

ref

Container Images Sync is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Container Images Sync
v1.1.0
Latest

Container Images Sync is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.