---
# System prepended metadata

title: Container Promotion

---

# Container Promotion

## Goals

1. Promote containers to registies using purely python and python libraries

## Requirements

1. containers can be uploaded to different registries (eg. docker.io, quay.io) at the same time.
2. containers can use as source and target the same registry, in this case, the promotion should skip the upload.
3. different tools can be used to manipulate containers (docker, podman)
4. (OPTIONAL) container validation - try to understand which containers are already uloaded and/or promoted so you don't start from scratch all the time.
5.  use remote tagging (no need to reupload the whole image just to retag)
6.  should work with different environemnt combinations (centos7/8, master/train/queens, integration pipeline, single pipeline)
7.  Has to deal with multiarch manifests, or single arch manifest.
8.  Functional testing (it should be ok to use the existing functions)
9.  Unit testing (please define if your unit is a class or a method)


## Acceptance Criteria
1. All the goals should met.
    2. define scenario of usage (eg: centos8-master = multiarch + podman + dockerapiregistry + quayapiregistry, centos7-queens = singlearch + docker + dockerapiregistry)
3. TESTS, TESTS, TESTS, TESTS, test early, test often.

## Steps

1. Container and Registry
    :::spoiler
  
      4. ```python
         
         # Sample code
         
         from registry_api import Registry
         
         docker = Registry('host', 'port','abc', 'secret123')
         quay = Registry('host', 'port','abc', 'secret123')
         ```
2. Create container_promotions.py
   1. all the promotion related operations are called from this file.
   2. Proxy class to switch between docker / podman

3. Validations for registry and images
4. Remove the old code.

### Questions

1. What is the purpose of `RegistryOrchestrator?`
   - It deals with the differnt registries. 
   - Once you push contianer to docker.io then you need to push the container to the other registry then RegistryOrchestrator is came in to the picture.
   - RegistryOrchestrator drives all the different instances of registry client.
   - 