Skip to main content

Pubtools-quay

Project description

Set of scripts used for operating with Quay service

Requirements

  • Python 2.6+

  • Python 3.5+

  • Skopeo is required for the tagging operation

Features

  • pubtools-quay-tag-image - Copy a quay image from source to destination(s)

  • pubtools-quay-merge-manifest-list - Merge manifest lists of new and old images. The architectures of new (source) image overwrite destination’s archs. Archs missing from the source image will still remain in the merged manifest list. Destination image’s manifest list is overwritten by the merged manifest list.

  • pubtools-quay-untag - Remove tags from quay repositories. Tags to remove are specified by image references. In addition to Docker credentials, Quay API OAuth token has to be specified. Script will not perform the untagging operation if some image in a repo will lose its last tag. In this scenario, untagging can be forced by using the –remove-last argument.

Setup

$ pip install -r requirements.txt
$ pip install .
or
$ python setup.py install

Usage

Locally copy an image from source to destination. Quay password is injected from the environment variable.

$ export QUAY_PASSWORD=token
$ pubtools-quay-tag-image \
  --source-ref quay.io/source/image:34 \
  --dest-ref quay.io/target/image:34 \
  --quay-user quay+username \

Connect to a remote host via ssh (using password) and perform the copying to multiple destinations.

$ export QUAY_PASSWORD=token
$ export SSH_PASSWORD=123456
$ pubtools-quay-tag-image \
  --source-ref quay.io/source/image:34 \
  --dest-ref quay.io/target/image:34 \
  --dest-ref quay.io/target/image2:34 \
  --quay-user quay+username \
  --remote-exec \
  --ssh-remote-host 127.0.0.1 \
  --ssh-remote-host-port 2222 \
  --ssh-username user

Connect to a remote host via ssh (using private key), perform the copying, and send a UMB message.

$ export QUAY_PASSWORD=token
$ export SSH_PASSWORD=123456
$ pubtools-quay-tag-image \
  --source-ref quay.io/source/image:34 \
  --dest-ref quay.io/target/image:34 \
  --quay-user quay+username \
  --remote-exec \
  --ssh-remote-host 127.0.0.1 \
  --ssh-remote-host-port 2222 \
  --ssh-username user \
  --ssh-key-filename /path/to/file.key \
  --send-umb-msg \
  --umb-url amqps://url:5671 \
  --umb-url amqps://url2:5671 \
  --umb-cert /path/to/file.crt \
  --umb-topic VirtualTopic.eng.pub.some_topic

Merge manifest lists of source-ref and dest-ref and overwrite dest-ref with the result.

$ export QUAY_PASSWORD=token
$ pubtools-quay-merge-manifest-list \
  --source-ref quay.io/src/image:1 \
  --dest-ref quay.io/dest/image:1 \
  --quay-user quay+username

Untag multiple images and send a UMB message.

$ export QUAY_PASSWORD=token
$ export QUAY_API_TOKEN=oauth_token
$ pubtools-quay-tag-image \
  --reference quay.io/src/image:1 \
  --reference quay.io/src/image:2 \
  --quay-user quay+username \
  --remote-exec \
  --ssh-remote-host 127.0.0.1 \
  --ssh-remote-host-port 2222 \
  --ssh-username user \
  --ssh-key-filename /path/to/file.key \
  --send-umb-msg \
  --umb-url amqps://url:5671 \
  --umb-url amqps://url2:5671 \
  --umb-cert /path/to/file.crt \
  --umb-topic VirtualTopic.eng.pub.some_topic

Untag an image and force the operation in case the tag is a last reference of some digest.

$ export QUAY_PASSWORD=token
$ export QUAY_API_TOKEN=oauth_token
$ pubtools-quay-tag-image \
  --reference quay.io/src/image:1 \
  --remove-last \
  --quay-user quay+username \

ChangeLog

0.8.0 (2021-9-7)

  • Use SSL certificates for Pyxis authentication

  • Remove duplicate digests when getting signatures from Pyxis

  • Remove return of push_docker entrypoint

0.7.2 (2021-8-23)

  • Don’t raise 404 errors when deleting tags during rollback

0.7.1 (2021-8-20)

  • Fix installation of ‘docker’ dependency on Python 2.6

0.7.0 (2021-8-18)

  • Add hooks to declare events of interest

  • Create documentation

  • Add option to execute commands inside a container

  • Add pagination support for getting all tags via Docker HTTP API

  • Capture IIB operation exception

  • Get index image manifests with its own token

  • Lower python-qpid-proton version

0.6.0 (2021-7-14)

  • Create entrypoint for removing a Quay repo

  • Create entrypoint for clearing a Quay repo

  • Add signature removal to tag-docker operations

  • Drop unnecessary ‘external_repos’

  • Add using extra Quay tokens for OSBS organizations

  • Allow specifying multiple repos in remove-repo and clear-repo tasks

  • Skip signing when no operator claim messages are constructed

  • Add support for delimeter-less repositories

  • Change “repo” parameter of claim messages to have external representation

  • Fix loggers per pubtools conventions

  • Check username in output of skopeo –get-login

  • Remove the usage of Quay API reading repo data

  • Add signature removal for IIB operations

  • Update sigstore to be up-to-date with current implementation

  • Allow pushing to non-existent repo

0.5.0 (2021-6-2)

  • Fix intermediate index image

  • Implement tag docker

  • Add skip to signing if signing key is None

  • Fix pub XMLRPC call

  • Implement entrypoints for IIB methods

0.4.0 (2021-5-4)

  • Implement push-docker prototype

  • Change signing order to happen before pushing

  • Use intermediate index image for signing

0.3.0 (2021-2-11)

  • Fix the versioning constraint of pyrsistent dependency

0.2.0 (2021-2-9)

  • Fix the definition of requirements.txt, allowing installation on Python 2.6

0.1.0 (2021-2-9)

  • Initial release.

  • Added tag image entrypoint

  • Added merge manifest list entrypoint

  • Added push docker code skeleton

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pubtools-quay-0.8.0.tar.gz (79.2 kB view details)

Uploaded Source

Built Distribution

pubtools_quay-0.8.0-py2.py3-none-any.whl (84.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pubtools-quay-0.8.0.tar.gz.

File metadata

  • Download URL: pubtools-quay-0.8.0.tar.gz
  • Upload date:
  • Size: 79.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for pubtools-quay-0.8.0.tar.gz
Algorithm Hash digest
SHA256 bc4ed6907cd221f7e781f39dfdecd509156cd13beac48faf258bba5ffa2051c1
MD5 b0ae5891cb06f6f59b92fba705b0e774
BLAKE2b-256 d0b58d04808e9abd9b534798dd364373ce1c194d9c534b4335ef5b1a61e35930

See more details on using hashes here.

File details

Details for the file pubtools_quay-0.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pubtools_quay-0.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 84.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for pubtools_quay-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 09293b77b2fe8cca2e4b54bfb60d56da03b3c3cae9f72ec045c1ccd81af98752
MD5 d675f3d7937833ffa006f0479ae430f8
BLAKE2b-256 cb50828956d8f71c4b3e716c5e9a29b2b4e1a95f95c2939f4adfd2e5027465bc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page